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=refs%2Fpull%2F8135%2Fhead;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); }