> Date: Thu, 30 May 2013 09:47:27 +0200
> From: [email protected]
> To: [email protected]
> CC: [email protected]
> Subject: Re: [FEniCS] FEM LIBRARY WITH OCTAVE
>
> On Thu, May 30, 2013 at 09:42:12AM +0200, Martin Sandve Alnæs wrote:
> > On 30 May 2013 09:34, Johan Hake <[1][email protected]> wrote:
> >
> > Hi Marco!
> > DOLFIN use SWIG to create Python wrappers. SWIG provides Octave
> > wrappers
> > too. Are you going to use those?
> > [2]http://www.swig.org/Doc2.0/SWIGDocumentation.html#Octave
> > SWIG use a flat namespace for the generated wrapper code, so you
> > would
> > still have nameclashes for the Array class. However it will
> > internally
> > keep all original C++ type information. SWIG also allows you to
> > rename
> > any C++ entity, classes, functions, variables, methods, aso, to
> > whatever
> > in the target language. You can then just tell SWIG to rename the
> > dolfin::Array to, let say, dolfin::ArrayDolfin.
> > Another challenge you might consider before you invest too much is
> > to
> > figure out how you should integrate the code generation part of
> > FEniCS.
> > For now that is handled by the Python packages of FFC, FIAT, UFL,
> > and
> > parts of UFC. Because these are all in Python we have been able to
> > integrate these seamlessly (but not without bumps) with the Python
> > interface of DOLFIN.
> >
> >
> > Doing this within octave will be challenging.
> >
> > To say the least... I'd say it's close to impossible to get the same
> > level of integration with just in time compilation as we have in
> > python.
> > However if it's possible to wrap pregenerated forms (i.e. header files
> > generated by running ffc on the commandline) it could be useful to
> > assemble matrices directly in octave for analysing eigenvalues etc. In
> > some older internal code here at Simula we had the concept of a "matrix
> > factory" which could assemble common matrices from a number of
> > pregenerated form files, e.g. mass, stiffness, convection etc.
>
> A matrix factory approach sounds like a very good fit for Octave. I
> suggest using that approach and implementing an extensive list of
> "finite element matrices" for various degrees of polynomials and
> possibly different element families.
>
Following your advice, as a first step for the matrix factory I'm creating
a function for the conversion of .xml mesh to/from (p,e,t) format.
1) In the conversion from (p,e,t) to xml I'm doing something very
simple like
for(uint i = 0; i < num_vertex; ++i)
editor.add_vertex(i, p(0,i), p(1,i));
for(uint i = 0; i < num_cells; ++i)
editor.add_cell(i, t(0,i)-1, t(1,i)-1, t(2,i)-1);
which works fine. But I have some problem when i try to use the information
contained in the "e" matrix about the number of the geometrical border
containing the side
edge.
I would like to use something like
FacetFunction<uint> boundary_markers(mesh);
as it is showed in the book.
I would like to assign the information about the geometrical border
while I'm editing the mesh instead of iterating over all the facets of
the mesh and then recover the information with another loop on the
"e" matrix looking for the corresponding Facets. (And even in this case,
how can I get extract information of the indexes related to the facets?)
Is something like this possible??
for(uint i = 0; i < num_side_edges; ++i){
editor.add_facets(i, from vertex a(i) to b(i));
boundary_markers[i] = number_geometrical_border;
}
2) When I read a function from a .xml file, is there any way in which I can know
if something like boundary_markers, sub-domains, colours had been defined on the
mesh??
Marco V.
> An alternative, if you can live with calling Python from within the
> internals of your Octave package, would be to work with strings that
> are passed to Python. So you could do something like
>
> mesh = <some Octave data structure for a mesh like (p, e, t)>
> A = fem_matrix("dot(grad(u), grad(v))*dx, mesh, "P1")
>
> --
> Anders
> _______________________________________________
> fenics mailing list
> [email protected]
> http://fenicsproject.org/mailman/listinfo/fenics
_______________________________________________
fenics mailing list
[email protected]
http://fenicsproject.org/mailman/listinfo/fenics