← Back to team overview

dolfin team mailing list archive

Re: FiniteElement class

 



Anders Logg wrote:
The first constructor for FiniteElement seems to be wrong. When we use
shared pointers, I thought the conclusion was to have two
constructors: one that takes a reference and one that takes a
shared_ptr. This is what we do in NewFunction using NoDeleter.


Yes, this is true.

The reason that the first constructor takes a pointer is that FiniteElement is still in development. In a number of places in the code, pointers to a ufc::finite_element are returned. We need to figure out how we want to deal with this, e.g. should ElementLibrary return a plain pointer or a shared pointer?

Garth

In the first case, the user owns the data and in the second case
the user and the created object share the data.

I'm having trouble now when initializing a dolfin::FiniteElement from
a ufc::finite_element in Python since both Python and the created
dolfin::FiniteElement want to delete the ufc::finite_element.



------------------------------------------------------------------------

_______________________________________________
DOLFIN-dev mailing list
DOLFIN-dev@xxxxxxxxxx
http://www.fenics.org/mailman/listinfo/dolfin-dev




Follow ups

References