From 8e086a01f9c64ddbab4f6a15d5d1e737cc925105 Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Fri, 6 May 2022 07:51:07 +0200 Subject: [PATCH] Add LinearAlgebra::distributed::BlockVector::set_ghost_state() --- include/deal.II/lac/la_parallel_block_vector.h | 8 +++++++- .../deal.II/lac/la_parallel_block_vector.templates.h | 10 ++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) 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, -- 2.39.5