ffc team mailing list archive
-
ffc team
-
Mailing list archive
-
Message #01972
Re: [DOLFIN-dev] About signatures in FFC-generated dolfin::Form subclasses
2008/12/3 Garth N. Wells <gnw20@xxxxxxxxx>:
>
>
> Martin Sandve Alnæs wrote:
>>
>> There is a signature:
>>
>> // Create form on given function space(s) with given coefficient(s)
>> (shared data)
>> PoissonLinearForm(std::tr1::shared_ptr<const dolfin::FunctionSpace>
>> V0, dolfin::Function& w0) : dolfin::Form(), f(*this)
>>
>> but no signature where both the function spaces and functions are
>> shared pointers. For an application with full use of shared pointers,
>> we need that.
>>
>
> I don't think that it's required. I brought this point up a while ago,
>
> http://www.fenics.org/pipermail/ffc-dev/2008-November/001923.html
Quoting this:
"""
On Thu, Nov 06, 2008 at 08:14:47PM +0000, Garth N. Wells wrote:
> For the 'shared' versions, shouldn't the coefficients also be shared
> pointers?
It's not necessary since these arguments will not be stored as
data. They will just be assigned to the coefficients.
"""
That's just plain wrong. Through Coefficient::attach, the Form will
store shared pointers to them with NoDeleters, and these pointers
won't share the reference count of an eventual shared pointer I
have in my application.
--
Martin
Follow ups
References