← Back to team overview

dolfin team mailing list archive

Re: about Mesh, WF

 

> > This can be fixed (using Triangle or TetGen for the generation of the
> > mesh). If you're familiar with any any of these, feel free to
> > contribute. I can give you suggestions.
> > 
> 
> I am familiar with both! I am all ears!

I suggest two new classes to be placed in src/kernel/mesh:

    TriangleMeshGenerator
    TetGenMeshGenerator

This is similar to other mesh algorithms (like MeshRefinement and MeshInit).

Both would have a static method (or several) named create():

    static create(Mesh& mesh, arguments);

The arguments to the create() method would be the list of necessary
arguments to Triangle or TetGen, for example names of files containing
input data for Triangle or TetGen. There could also be several other
overloaded methods named create() taking different arguments.

Later, we could add new constructors to Mesh to create shortcuts for
mesh generation:

Mesh(const std::string& filename)
{
    // Choose type of mesh from filename suffix

    ...

    Triangle::create(*this, filename);
}

Both new classes need to friends of Mesh. Take a look at the class
XMLMesh to see which methods to call when building a mesh (createNode(),
createCell(), ...).

> > > FemSpace Vh(Th, P1), Uh(Th, P1); //P1 langrangian elements
> > > 
> > > Problem WeakFormulation( grad(Vh)*grad(Uh) - f*Vh ); //for a Poisson
> > problem
> > > or even
> > > Problem WeakFormulation( Vh.dx*Uh.dx+Vh.dy*Uh.dy - f*Vh ); //
> > 
> > This will happen in the future. In fact, this part will be moved outside
> > of DOLFIN (but still look as if it were part of DOLFIN). The evaluation
> > of variational forms will be moved to other subprojects within the
> > FEniCS project.
> > 
> > Sure, you will have all that and more. But understand that DOLFIN (and
> > FEniCS) is a research project which means that our first priority is to
> > get things right.
> > 
> So do you have any suggestions on how to implement this! I had
> expression-templates in mind but I would like to use something simpler.
> Do you 
> have any idea how should I design the element classes and that class
> which reads
> the weak formulation? It is very important to me since if implemented 
> once it will make my code dimension independed and will save lots of
> hours of
> debugging! 

This is something we're working on currently. The main idea is that
finite elements will be generated using FIAT (see
http://people.cs.uchicago.edu/~kirby/index.cgi?page=fiat). Robert Kirby
(University of Chicago) and Matthew Knepley (Argonne) also have some
code for the interpretation/generation of variational forms that we're
working on integrating with the FEniCS project.

/Anders