From: Denis Davydov Date: Tue, 1 Nov 2016 15:28:00 +0000 (+0100) Subject: add MatrixFreeOperators::set_constrained_entries_to_one() and make clear() virtual X-Git-Tag: v8.5.0-rc1~511^2~3 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2111e33c0d8be45097ba8a0a1d007fd4f340db2;p=dealii.git add MatrixFreeOperators::set_constrained_entries_to_one() and make clear() virtual --- 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,