]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Un-inline PETScWrappers::MPI::Vector::operator=(Vector &). 4330/head
authorDavid Wells <wellsd2@rpi.edu>
Sat, 29 Apr 2017 02:20:14 +0000 (22:20 -0400)
committerDavid Wells <wellsd2@rpi.edu>
Sat, 29 Apr 2017 14:08:21 +0000 (10:08 -0400)
This function is long enough that the compiler probably won't inline it anyway.

include/deal.II/lac/petsc_parallel_vector.h
source/lac/petsc_parallel_vector.cc

index fcd19d58bab6b74e2d17b546f4743008acd93903..1ce64fe10af32f9f25c3e7d583c82e271b6ece52 100644 (file)
@@ -471,43 +471,6 @@ namespace PETScWrappers
 
 
 
-    inline
-    Vector &
-    Vector::operator= (const Vector &v)
-    {
-      // make sure left- and right-hand side of the assignment are compress()'ed:
-      Assert(v.last_action == VectorOperation::unknown,
-             internal::VectorReference::ExcWrongMode (VectorOperation::unknown,
-                                                      v.last_action));
-      Assert(last_action == VectorOperation::unknown,
-             internal::VectorReference::ExcWrongMode (VectorOperation::unknown,
-                                                      last_action));
-
-      // if the vectors have different sizes,
-      // then first resize the present one
-      if (size() != v.size())
-        {
-          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);
-        }
-
-      PetscErrorCode ierr = VecCopy (v.vector, vector);
-      AssertThrow (ierr == 0, ExcPETScError(ierr));
-
-      if (has_ghost_elements())
-        {
-          ierr = VecGhostUpdateBegin(vector, INSERT_VALUES, SCATTER_FORWARD);
-          AssertThrow (ierr == 0, ExcPETScError(ierr));
-          ierr = VecGhostUpdateEnd(vector, INSERT_VALUES, SCATTER_FORWARD);
-          AssertThrow (ierr == 0, ExcPETScError(ierr));
-        }
-      return *this;
-    }
-
-
-
     template <typename number>
     inline
     Vector &
index 5965ffaa938b77b488010487cedb04486463558d..a296d7ef9f9d48f5621fd09a960b0c57f9aa228a 100644 (file)
@@ -96,6 +96,42 @@ namespace PETScWrappers
 
 
 
+    Vector &
+    Vector::operator= (const Vector &v)
+    {
+      // make sure left- and right-hand side of the assignment are compress()'ed:
+      Assert(v.last_action == VectorOperation::unknown,
+             internal::VectorReference::ExcWrongMode (VectorOperation::unknown,
+                                                      v.last_action));
+      Assert(last_action == VectorOperation::unknown,
+             internal::VectorReference::ExcWrongMode (VectorOperation::unknown,
+                                                      last_action));
+
+      // if the vectors have different sizes,
+      // then first resize the present one
+      if (size() != v.size())
+        {
+          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);
+        }
+
+      PetscErrorCode ierr = VecCopy (v.vector, vector);
+      AssertThrow (ierr == 0, ExcPETScError(ierr));
+
+      if (has_ghost_elements())
+        {
+          ierr = VecGhostUpdateBegin(vector, INSERT_VALUES, SCATTER_FORWARD);
+          AssertThrow (ierr == 0, ExcPETScError(ierr));
+          ierr = VecGhostUpdateEnd(vector, INSERT_VALUES, SCATTER_FORWARD);
+          AssertThrow (ierr == 0, ExcPETScError(ierr));
+        }
+      return *this;
+    }
+
+
+
     void
     Vector::clear ()
     {

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.