From f2111e33c0d8be45097ba8a0a1d007fd4f340db2 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Tue, 1 Nov 2016 16:28:00 +0100 Subject: [PATCH] add MatrixFreeOperators::set_constrained_entries_to_one() and make clear() virtual --- include/deal.II/matrix_free/operators.h | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/include/deal.II/matrix_free/operators.h b/include/deal.II/matrix_free/operators.h index f9287d5460..f621df0981 100644 --- a/include/deal.II/matrix_free/operators.h +++ b/include/deal.II/matrix_free/operators.h @@ -72,7 +72,7 @@ namespace MatrixFreeOperators * Release all memory and return to a state just like after having called * the default constructor. */ - void clear(); + virtual void clear(); /** * Initialize operator on fine scale. @@ -173,6 +173,12 @@ namespace MatrixFreeOperators protected: + /** + * Set constrained entries (both from hanging nodes and edge constraints) + * of @p dst to one. + */ + void set_constrained_entries_to_one (LinearAlgebra::distributed::Vector &dst) const; + /** * Apply operator to @p src and add result in @p dst. */ @@ -197,12 +203,13 @@ namespace MatrixFreeOperators */ LinearAlgebra::distributed::Vector inverse_diagonal_entries; + private: + /** * Indices of DoFs on edge in case the operator is used in GMG context. */ std::vector edge_constrained_indices; - private: /** * Auxiliary vector. */ @@ -557,6 +564,20 @@ namespace MatrixFreeOperators + template + void + Base::set_constrained_entries_to_one (LinearAlgebra::distributed::Vector &dst) const + { + const std::vector & + constrained_dofs = data->get_constrained_dofs(); + for (unsigned int i=0; i void Base::vmult (LinearAlgebra::distributed::Vector &dst, -- 2.39.5