From 411765f0f827159cb8c4c838a55727509e4ccc3c Mon Sep 17 00:00:00 2001 From: Maximilian Bergbauer Date: Tue, 9 Nov 2021 14:37:57 +0100 Subject: [PATCH] Introduce masks in read_dof_values --- include/deal.II/matrix_free/fe_evaluation.h | 35 ++++++++++++--------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/include/deal.II/matrix_free/fe_evaluation.h b/include/deal.II/matrix_free/fe_evaluation.h index 31e1718c8d..d2961eaebb 100644 --- a/include/deal.II/matrix_free/fe_evaluation.h +++ b/include/deal.II/matrix_free/fe_evaluation.h @@ -592,7 +592,10 @@ public: */ template void - read_dof_values(const VectorType &src, const unsigned int first_index = 0); + read_dof_values(const VectorType & src, + const unsigned int first_index = 0, + const std::bitset &mask = + std::bitset().flip()); /** * For the vector @p src, read out the values on the degrees of freedom of @@ -625,7 +628,9 @@ public: template void read_dof_values_plain(const VectorType & src, - const unsigned int first_index = 0); + const unsigned int first_index = 0, + const std::bitset &mask = + std::bitset().flip()); /** * Takes the values stored internally on dof values of the current cell and @@ -4971,6 +4976,12 @@ FEEvaluationBase:: for (unsigned int v = 0; v < n_filled_lanes; ++v) { + if (mask[v] == false) + { + vector_ptrs[v] = nullptr; + continue; + } + Assert(cells[v] != numbers::invalid_unsigned_int, ExcNotImplemented()); Assert(ind < this->dof_info->dof_indices_contiguous_sm.size(), @@ -5437,7 +5448,9 @@ template inline void FEEvaluationBase:: - read_dof_values(const VectorType &src, const unsigned int first_index) + read_dof_values(const VectorType & src, + const unsigned int first_index, + const std::bitset &mask) { const auto src_data = internal::get_vector_data( src, @@ -5448,11 +5461,7 @@ FEEvaluationBase:: this->dof_info); internal::VectorReader reader; - read_write_operation(reader, - src_data.first, - src_data.second, - std::bitset().flip(), - true); + read_write_operation(reader, src_data.first, src_data.second, mask, true); apply_hanging_node_constraints(); @@ -5471,7 +5480,9 @@ template inline void FEEvaluationBase:: - read_dof_values_plain(const VectorType &src, const unsigned int first_index) + read_dof_values_plain(const VectorType & src, + const unsigned int first_index, + const std::bitset &mask) { const auto src_data = internal::get_vector_data( src, @@ -5482,11 +5493,7 @@ FEEvaluationBase:: this->dof_info); internal::VectorReader reader; - read_write_operation(reader, - src_data.first, - src_data.second, - std::bitset().flip(), - false); + read_write_operation(reader, src_data.first, src_data.second, mask, false); # ifdef DEBUG dof_values_initialized = true; -- 2.39.5