Wiki

Clone wiki

FEniCS Developer Tools / MeshView

Create MeshView in DOLFIN

There are open questions about how to do this:

  • Inherit an interface shared with Mesh? Makes e.g. dofmap implementation simple but may incur overhead in iteration over mesh entities. Unknown how significant this overhead is.

  • Simply allow for the fact that Mesh and MeshView must both be handled many places? Not as elegant, quite a bit of work distributed over the codebase, however it will be clear and in the open what happens.

  • Template the assembler and other components over Mesh and MeshView. Templates do not in general go well with dynamic interfaces and the python interface so careful consideration would be needed.

  • [GNW] How about a MeshSet that stores the indices of a 'subset' of mesh entities, the dimension and a pointer to a mesh? The MeshSet can provide iterators, etc and just 'index' into the mesh. This would avoid the overhead of virtual function calls. We would just have one level of indirection, which for a full mesh a compiler should handle well.

Create MeshView in UFL

Current sketch is that ufl.Mesh and ufl.MeshView both inherit from ufl.Domain, while ufl.MeshView has a reference to its parent ufl.Mesh. The dolfin.Mesh inherits from ufl.Mesh and dolfin.MeshView inherits from ufl.MeshView.

This requires C++ MeshView to also be a Variable to get an .id().

See FunctionSpace in UFL for more details and context.

Assembler

A common usage case is assembling a form that involves integration over all cells, plus surface integrals that are defined only in the surface 'mesh view'. This is related to https://bitbucket.org/fenics-project/dolfin/issue/219.

Dofmap

FunctionSpace

Updated