From: Daniel Arndt Date: Mon, 13 May 2019 22:52:18 +0000 (+0200) Subject: Create vector before assigning X-Git-Tag: v9.1.0-rc1~12^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=965c1c3a55d7a8b0b159ed83cd60b0586154053c;p=dealii.git Create vector before assigning --- diff --git a/source/lac/petsc_parallel_vector.cc b/source/lac/petsc_parallel_vector.cc index da90e9ab77..69fcd36593 100644 --- a/source/lac/petsc_parallel_vector.cc +++ b/source/lac/petsc_parallel_vector.cc @@ -87,7 +87,13 @@ namespace PETScWrappers Vector::Vector(const Vector &v) : VectorBase() + , communicator(v.communicator) { + if (v.has_ghost_elements()) + Vector::create_vector(v.size(), v.local_size(), v.ghost_indices); + else + Vector::create_vector(v.size(), v.local_size()); + this->operator=(v); }