From: Peter Munch Date: Fri, 6 May 2022 05:51:07 +0000 (+0200) Subject: Add LinearAlgebra::distributed::BlockVector::set_ghost_state() X-Git-Tag: v9.4.0-rc1~273^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e086a01f9c64ddbab4f6a15d5d1e737cc925105;p=dealii.git Add LinearAlgebra::distributed::BlockVector::set_ghost_state() --- diff --git a/include/deal.II/lac/la_parallel_block_vector.h b/include/deal.II/lac/la_parallel_block_vector.h index ed6f38500f..0065701ab4 100644 --- a/include/deal.II/lac/la_parallel_block_vector.h +++ b/include/deal.II/lac/la_parallel_block_vector.h @@ -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 diff --git a/include/deal.II/lac/la_parallel_block_vector.templates.h b/include/deal.II/lac/la_parallel_block_vector.templates.h index 8583819aef..82eab7f53e 100644 --- a/include/deal.II/lac/la_parallel_block_vector.templates.h +++ b/include/deal.II/lac/la_parallel_block_vector.templates.h @@ -421,6 +421,16 @@ namespace LinearAlgebra + template + void + BlockVector::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 void BlockVector::reinit(const VectorSpaceVector &V,