From c1430f11f149e0c6c40231b12e8fe77f6b88e6d0 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Tue, 21 Apr 2020 23:35:08 -0400 Subject: [PATCH] Remove PETSc vector copy constructor --- include/deal.II/lac/petsc_vector.h | 18 ------------------ source/lac/petsc_parallel_vector.cc | 20 -------------------- tests/petsc/64.cc | 1 - 3 files changed, 39 deletions(-) diff --git a/include/deal.II/lac/petsc_vector.h b/include/deal.II/lac/petsc_vector.h index ab08a6ba69..c1d851913e 100644 --- a/include/deal.II/lac/petsc_vector.h +++ b/include/deal.II/lac/petsc_vector.h @@ -204,24 +204,6 @@ namespace PETScWrappers const dealii::Vector &v, const size_type local_size); - - /** - * Copy-constructor the values from a PETSc wrapper vector class. - * - * @arg local_size denotes the size of the chunk that shall be stored on - * the present process. - * - * @arg communicator denotes the MPI communicator over which the - * different parts of the vector shall communicate - * - * @deprecated The use of objects that are explicitly of type VectorBase - * is deprecated: use PETScWrappers::MPI::Vector instead. - */ - DEAL_II_DEPRECATED - explicit Vector(const MPI_Comm & communicator, - const VectorBase &v, - const size_type local_size); - /** * Construct a new parallel ghosted PETSc vector from IndexSets. * diff --git a/source/lac/petsc_parallel_vector.cc b/source/lac/petsc_parallel_vector.cc index 5b66bf5b4c..8784877b87 100644 --- a/source/lac/petsc_parallel_vector.cc +++ b/source/lac/petsc_parallel_vector.cc @@ -49,26 +49,6 @@ namespace PETScWrappers - Vector::Vector(const MPI_Comm & communicator, - const VectorBase &v, - const size_type local_size) - : VectorBase(v) - , communicator(communicator) - { - // In the past (before it was deprecated) this constructor did a - // byte-for-byte copy of v. This choice resulted in two problems: - // 1. The created vector will have the same size as v, not local size. - // 2. Since both the created vector and v maintain ownership of the same - // PETSc Vec, both will try to destroy it: this does not make sense. - // - // For the sake of backwards compatibility, preserve the behavior of the - // copy, but correct the ownership bug. Note that in both this (and the - // original) implementation local_size is ultimately unused. - (void)local_size; - } - - - Vector::Vector(const IndexSet &local, const IndexSet &ghost, const MPI_Comm &communicator) diff --git a/tests/petsc/64.cc b/tests/petsc/64.cc index 88c60427e3..4b6b56f5df 100644 --- a/tests/petsc/64.cc +++ b/tests/petsc/64.cc @@ -72,7 +72,6 @@ main(int argc, char **argv) IndexSet locally_owned_dofs(n_dofs); locally_owned_dofs.add_range(my_id * n_dofs / n_mpi_processes, (my_id + 1) * n_dofs / n_mpi_processes); - locally_relevant_dofs.add_index(0); DynamicSparsityPattern dsp(n_dofs); dsp.add(0, 0); PETScWrappers::MPI::SparseMatrix v2; -- 2.39.5