]> https://gitweb.dealii.org/ - dealii.git/commit
Fix, and deprecate, a PETSc parallel vector copy constructor.
authorDavid Wells <wellsd2@rpi.edu>
Sat, 11 Feb 2017 22:29:44 +0000 (17:29 -0500)
committerDavid Wells <wellsd2@rpi.edu>
Sat, 11 Feb 2017 23:08:56 +0000 (18:08 -0500)
commite2482a0855e2e5b0d3a1a0ea3b64b7bb05e75dc6
treefab073e93125b557e091b85e406791f1ff4772ef
parentdb054bf26447343c1c1010fdce2443fd6c894001
Fix, and deprecate, a PETSc parallel vector copy constructor.

The former implementation of this copy constructor contained a subtle bug: since
VectorBase::operator= is implicitly defined, calling it simply copies (byte for
byte) the members of a VectorBase. This is erroneous because now two different
destructors will call VecDestroy on the underlying Vec.

The fix is simple: (nearly) preserve the current behavior by just deep copying
the vector.

Since one should never have an explicit instance of VectorBase (and there is no
reasonable way to copy a parallel vector and then enforce a possibly different
local_size) this constructor I also marked this constructor for deprecation: one
should use one of the concrete classes (Vector or MPI::Vector) in applications.
include/deal.II/lac/petsc_parallel_vector.h
source/lac/petsc_parallel_vector.cc

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.