]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add LinearAlgebra::distributed::BlockVector::set_ghost_state() 13681/head
authorPeter Munch <peterrmuench@gmail.com>
Fri, 6 May 2022 05:51:07 +0000 (07:51 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Fri, 6 May 2022 05:51:07 +0000 (07:51 +0200)
include/deal.II/lac/la_parallel_block_vector.h
include/deal.II/lac/la_parallel_block_vector.templates.h

index ed6f38500f9f9aa169b6d32fd83f826019f66d03..0065701ab45a161c0be97022582a768e3931c215 100644 (file)
@@ -361,11 +361,17 @@ namespace LinearAlgebra
       zero_out_ghost_values() const;
 
       /**
-       * Return if this Vector contains ghost elements.
+       * Return if any of the blocks in this vector contains ghost elements.
        */
       bool
       has_ghost_elements() const;
 
+      /**
+       * Change the ghost state of all blocks in this vector to @p ghosted.
+       */
+      void
+      set_ghost_state(const bool ghosted) const;
+
       /**
        * This method copies the data in the locally owned range from another
        * distributed vector @p src into the calling vector. As opposed to
index 8583819aef35dc37fbecb65f8f6e9fb8e3e9741c..82eab7f53e17a6ca86649519b68142622047b9bc 100644 (file)
@@ -421,6 +421,16 @@ namespace LinearAlgebra
 
 
 
+    template <typename Number>
+    void
+    BlockVector<Number>::set_ghost_state(const bool ghosted) const
+    {
+      for (unsigned int block = 0; block < this->n_blocks(); ++block)
+        this->block(block).set_ghost_state(ghosted);
+    }
+
+
+
     template <typename Number>
     void
     BlockVector<Number>::reinit(const VectorSpaceVector<Number> &V,

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.