← Back to team overview

dolfin team mailing list archive

[Bug 453207] Re: Assigning a Function to another Function does not work.

 

Could you post the smallest possible complete program that reproduces
the error?

-- 
Assigning a Function to another Function does not work.
https://bugs.launchpad.net/bugs/453207
You received this bug notification because you are subscribed to DOLFIN.

Status in DOLFIN: New

Bug description:
There is an error when one wants to assign a Function to a new one:

Function copy = orig;

or

Function copy(orig);

raise both an error as

/scratch-second/priesen/FEniCS/build/include/boost/smart_ptr/shared_ptr.hpp:412: 
typename boost::detail::shared_ptr_traits<T>::reference 
boost::shared_ptr< <template-parameter-1-1> >::operator*() const [with T 
= dolfin::GenericVector]: Assertion `px != 0' failed.

in 

#3  0x00007f98fc291a09 in dolfin::Function::operator= 
(this=0x7fff047d2810, v=@0x7fff047d29c0) at 
/scratch-second/priesen/FEniCS/build/include/boost/smart_ptr/shared_ptr.hpp:412
#4  0x00007f98fc291d09 in Function (this=0x7fff047d2810, 
v=@0x7fff047d29c0) at dolfin/function/Function.cpp:113

Workaround:

use

Function copy(V_orig);
copy.vector() = orig.vector();


References