← Back to team overview

dolfin team mailing list archive

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

 

I've added this code to

   sandbox/misc/cpp

(fenics.org server is down at the moment, will push soon) for testing.

** Changed in: dolfin
       Status: New => Confirmed

** Changed in: dolfin
   Importance: Undecided => High

** Changed in: dolfin
    Milestone: None => 0.9.5

-- 
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: Confirmed

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