I updated from 1.2 to 1.4 and now on my call to
*x.get()->vector() = *other.x.get()->vector()->copy();
I get an error from PETSC:
*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
***
*** fenics@fenicsproject.org
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------------------------------------------------------------------------
*** Error: Unable to successfully call PETSc function 'VecCopy'.
*** Reason: PETSc error code is: 73.
*** Where: This error was encountered inside ~/Work/FEniCS/src/dolfin-1.4.0/dolfin/la/PETScVector.cpp.
*** Process: unknown
***
*** DOLFIN version: 1.4.0
*** Git changeset:
*** -------------------------------------------------------------------------
The PETSc error
[0]PETSC ERROR: --------------------- Error Message ------------------------------------
[0]PETSC ERROR: Object is in wrong state!
[0]PETSC ERROR: Not for unassembled vector!
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Petsc Release Version 3.4.2, Jul, 02, 2013
[0]PETSC ERROR: See docs/changes/index.html for recent updates.
[0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
[0]PETSC ERROR: See docs/index.html for manual pages.
[0]PETSC ERROR: ------------------------------------------------------------------------
Do I need to do something differently with 1.4? Perhaps an apply call?
This seems to work, though rather syntactically heavy:
std::vector<double> temp_val;
other.x->vector()->get_local(temp_val);
x->vector()->set_local(temp_val);
std::dynamic_pointer_cast<PETScVector>(x->vector())->apply("");
It would also be nice to not need the working vector temp_val to perform the copy