On Wed, May 15, 2013 at 10:48:31AM +0100, Garth N. Wells wrote:
> Chris and I are working on IO (including parallel) via HDF5 for mesh
> data structures. An issue that I've run into before and which is
> making things complicated now are the circular dependences in the Mesh
> class.
>
> Every Mesh has a MeshDomains object and a MeshData object. MeshDomains
> stores a reference to its Mesh, and it stores MeshFunctions, that hold
> a shared_ptr to a Mesh (it also has MeshValueCollections which we'll
> probably also let store a pointer to the Mesh).

We should strive to avoid this (the owned object having a pointer to
the owner), but it often creeps in for convenience.

> This all makes memory management complicated because the objects are
> constructed with the Mesh '*this' object, and leads to a lot of 'no
> deleter' shared pointers. Since MeshDomains are always associates with
> a Mesh and a Mesh always has a MeshDomains object, any objections to
> just using plain STL vectors to hold the MeshDomain data?

What would the changes be in the interface?

--
Anders
_______________________________________________
fenics mailing list
[email protected]
http://fenicsproject.org/mailman/listinfo/fenics

Reply via email to