← Back to team overview

dolfin team mailing list archive

Re: FiniteElement class

 

On Mon, Oct 06, 2008 at 06:32:23PM +0200, Anders Logg wrote:
> On Mon, Oct 06, 2008 at 05:03:23PM +0100, Garth N. Wells wrote:
> > 
> > 
> > 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
> 
> I think a shared pointer is safer. And since ElementLibrary is not
> really part of the user interface, they won't be visible. I'll change
> this and see if it solves my segmentation fault.

I started out doing this but it was a mess to fix, in particular for
the recursive extraction of sub elements. So I left the old
constructor there and added a new one with some comments. The new one
has an additional dummy argument which allowed me to pick the right
one in interpolate.py. We'll have to fix this soon, but it was too
much for me tonight... :-)

-- 
Anders

Attachment: signature.asc
Description: Digital signature


References