← Back to team overview

dolfin team mailing list archive

Re: MeshData

 

On Jan 16 2011, Anders Logg wrote:

On Sat, Jan 15, 2011 at 04:42:51PM +0000, Garth N. Wells wrote:
I would like to suggest that we be more explicit with respect to what is
in MeshData, for example not putting parallel and coloring related data
into the maps, but having them appear explicitly. I don't see the sense
in using maps for data that DOLFIN will always have (according to the
comment in MeshData.h):

  /// The following named mesh data are recognized by DOLFIN:

I'm finding it awkward and error prone to generalise the coloring of
mesh entities using the present MeshData approach.

I think that's the main strength of the MeshData class, that it's easy
to expand. New data can be created on demand and it doesn't take up
any space if the data is not needed. It also doesn't clutter the
interface with lots of extra functions.

Is there anything in particular that is difficult to store in
MeshData?


Yes, the colouring data. It's natural to associate a triplet (coloured dim, neighbour dim, distance) with a collection of vectors/arrays, and putting this in a string is clunky, especially with multiple colourings. It's technically possible, but the code becomes very confusing and a pain to implement.

An alternative approach would be to create

 BoundaryData
 ParallelData
 ColoringData

and store pointers to those in MeshData. Then the first time they are
requested by

 mesh.data().coloring()

the pointer is created.

But I would really like to avoid that. Another reason for keeping the
current design is that by relying on simple arrays, it's all
automatically stored as part of the DOLFIN XML format which can
read/write MeshData, including whatever stuff we throw in there.


That's fine for throwing in new stuff, but if we start from the point that every mesh is distributed and possibly coloured, then handling the parallel and coloring data is simple.

Garth

--
Anders




Follow ups

References