<h3>Specific improvements</h3>
<ol>
+ <li>
+ Fixed: various fixes with assignment and reinit of PETScWrappers::MPI::Vector.
+ <br>
+ (Timo Heister, 2013/08/05)
+ </li>
+
<li>Fixed: An assertion wrongly triggered in
DoFTools::make_hanging_node_constraints when used with a particular
combination of FESystem elements containing FE_Nothing. This is now fixed.
Vector &
Vector::operator = (const Vector &v)
{
+ if (v.size()==0)
+ {
+ // this happens if v has not been initialized to something useful:
+ // Vector x,v;x=v;
+ // we skip the code below and create a simple serial vector of
+ // length 0
+ const int n = 0;
+ const int ierr
+ = VecCreateSeq (PETSC_COMM_SELF, n, &vector);
+ AssertThrow (ierr == 0, ExcPETScError(ierr));
+ ghosted = false;
+ ghost_indices.clear();
+ return *this;
+ }
+
// if the vectors have different sizes,
// then first resize the present one
if (size() != v.size())
- reinit (v.communicator, v.size(), v.local_size(), true);
+ {
+ if (v.has_ghost_elements())
+ reinit( v.locally_owned_elements(), v.ghost_indices, v.communicator);
+ else
+ reinit (v.communicator, v.size(), v.local_size(), true);
+ }
const int ierr = VecCopy (v.vector, vector);
AssertThrow (ierr == 0, ExcPETScError(ierr));