]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add LA::d::Vector::set_ghost_state() and use it in VectorDataExchange::update_ghost_v... 7782/head
authorDenis Davydov <davydden@gmail.com>
Wed, 6 Mar 2019 12:43:08 +0000 (13:43 +0100)
committerDenis Davydov <davydden@gmail.com>
Wed, 6 Mar 2019 16:42:17 +0000 (17:42 +0100)
include/deal.II/lac/la_parallel_vector.h
include/deal.II/matrix_free/matrix_free.h

index 840a5ca0311680563fb20f9d87a0bc21c48662bc..8b7cbb9119ff82b0e88f72501bcbca3748bedd61 100644 (file)
@@ -1192,6 +1192,13 @@ namespace LinearAlgebra
       bool
       partitioners_are_globally_compatible(
         const Utilities::MPI::Partitioner &part) const;
+
+      /**
+       * Change the ghost state of this vector to @p ghosted.
+       */
+      void
+      set_ghost_state(const bool ghosted) const;
+
       //@}
 
       /**
@@ -1812,6 +1819,15 @@ namespace LinearAlgebra
       return partitioner;
     }
 
+
+
+    template <typename Number, typename MemorySpace>
+    inline void
+    Vector<Number, MemorySpace>::set_ghost_state(const bool ghosted) const
+    {
+      vector_is_ghosted = ghosted;
+    }
+
 #endif
 
   } // namespace distributed
index a0134ebfe76d6bbfaab8aac6c15002342fe5c37e..e1d18fc083a71ddecda6d58f70a475060e3a9f2d 100644 (file)
@@ -2805,6 +2805,10 @@ namespace internal
           matrix_free.release_scratch_data_non_threadsafe(
             tmp_data[component_in_block_vector]);
           tmp_data[component_in_block_vector] = nullptr;
+
+          // let vector know that ghosts are being updated and we can read from
+          // them
+          vec.set_ghost_state(true);
 #  endif
         }
     }
@@ -2938,6 +2942,9 @@ namespace internal
                       .local_element(j + part.local_size()) = 0.;
                   }
             }
+
+          // let vector know that it's not ghosted anymore
+          vec.set_ghost_state(false);
 #  endif
         }
     }

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.