]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove PETSc vector copy constructor
authorDaniel Arndt <arndtd@ornl.gov>
Wed, 22 Apr 2020 03:35:08 +0000 (23:35 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Wed, 22 Apr 2020 03:40:17 +0000 (23:40 -0400)
include/deal.II/lac/petsc_vector.h
source/lac/petsc_parallel_vector.cc
tests/petsc/64.cc

index ab08a6ba69db798e3399a582357b776ad9c8dced..c1d851913e3b6010c1bb0a79ee8865b441b2155f 100644 (file)
@@ -204,24 +204,6 @@ namespace PETScWrappers
                       const dealii::Vector<Number> &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.
        *
index 5b66bf5b4c1dda6be88979cc4c21514f6c073889..8784877b8794f40a3a57e60adfacb706f52b8b52 100644 (file)
@@ -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)
index 88c60427e3c457693b2636ddd5e6145a68d64f36..4b6b56f5df11605e64c8ac37801352730b6aa5c8 100644 (file)
@@ -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;

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.