From 9e07499ec824e66cc23a2946dfb6843a5648262d Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sun, 29 Nov 2020 22:11:35 -0700 Subject: [PATCH] Move two classes into an internal namespace. --- include/deal.II/lac/affine_constraints.h | 206 ++++++++++++----------- 1 file changed, 108 insertions(+), 98 deletions(-) diff --git a/include/deal.II/lac/affine_constraints.h b/include/deal.II/lac/affine_constraints.h index 4be3e09e87..2b74c2b884 100644 --- a/include/deal.II/lac/affine_constraints.h +++ b/include/deal.II/lac/affine_constraints.h @@ -2280,110 +2280,116 @@ class BlockSparsityPatternBase; template class BlockSparseMatrixEZ; -/** - * A "traits" class that can be used to determine whether a given type is a - * block matrix type or not. For example, - * @code - * IsBlockMatrix >::value - * @endcode - * has the value `false`, whereas - * @code - * IsBlockMatrix >::value - * @endcode - * is true. This is sometimes useful in template contexts where we may want to - * do things differently depending on whether a template type denotes a - * regular or a block matrix type. - * - * @see - * @ref GlossBlockLA "Block (linear algebra)" - */ -template -struct IsBlockMatrix +namespace internal { -private: - /** - * Overload returning true if the class is derived from BlockMatrixBase, - * which is what block matrices do (with the exception of - * BlockSparseMatrixEZ). - */ - template - static std::true_type - check(const BlockMatrixBase *); + namespace AffineConstraints + { + /** + * A "traits" class that can be used to determine whether a given type is a + * block matrix type or not. For example, + * @code + * IsBlockMatrix >::value + * @endcode + * has the value `false`, whereas + * @code + * IsBlockMatrix >::value + * @endcode + * is true. This is sometimes useful in template contexts where we may want + * to do things differently depending on whether a template type denotes a + * regular or a block matrix type. + * + * @see + * @ref GlossBlockLA "Block (linear algebra)" + */ + template + struct IsBlockMatrix + { + private: + /** + * Overload returning true if the class is derived from BlockMatrixBase, + * which is what block matrices do (with the exception of + * BlockSparseMatrixEZ). + */ + template + static std::true_type + check(const BlockMatrixBase *); - /** - * Overload for BlockSparseMatrixEZ, which is the only block matrix not - * derived from BlockMatrixBase at the time of writing this class. - */ - template - static std::true_type - check(const BlockSparseMatrixEZ *); + /** + * Overload for BlockSparseMatrixEZ, which is the only block matrix not + * derived from BlockMatrixBase at the time of writing this class. + */ + template + static std::true_type + check(const BlockSparseMatrixEZ *); - /** - * Catch all for all other potential types that are then apparently not block - * matrices. - */ - static std::false_type - check(...); + /** + * Catch all for all other potential types that are then apparently not + * block matrices. + */ + static std::false_type + check(...); -public: - /** - * A statically computable value that indicates whether the template - * argument to this class is a block matrix (in fact whether the type is - * derived from BlockMatrixBase or is one of the other block matrix - * types). - */ - static const bool value = - std::is_same())), - std::true_type>::value; -}; + public: + /** + * A statically computable value that indicates whether the template + * argument to this class is a block matrix (in fact whether the type is + * derived from BlockMatrixBase or is one of the other block matrix + * types). + */ + static const bool value = + std::is_same())), + std::true_type>::value; + }; -// instantiation of the static member -template -const bool IsBlockMatrix::value; + // instantiation of the static member + template + const bool IsBlockMatrix::value; -/** - * A class that can be used to determine whether a given type is a block - * sparsity pattern type or not. In this, it matches the IsBlockMatrix - * class. - * - * @see - * @ref GlossBlockLA "Block (linear algebra)" - */ -template -struct IsBlockSparsityPattern -{ -private: - /** - * Overload returning true if the class is derived from - * BlockSparsityPatternBase, which is what block sparsity patterns do. - */ - template - static std::true_type - check(const BlockSparsityPatternBase *); + /** + * A class that can be used to determine whether a given type is a block + * sparsity pattern type or not. In this, it matches the IsBlockMatrix + * class. + * + * @see + * @ref GlossBlockLA "Block (linear algebra)" + */ + template + struct IsBlockSparsityPattern + { + private: + /** + * Overload returning true if the class is derived from + * BlockSparsityPatternBase, which is what block sparsity patterns do. + */ + template + static std::true_type + check(const BlockSparsityPatternBase *); - /** - * Catch all for all other potential types that are then apparently not block - * sparsity patterns. - */ - static std::false_type - check(...); + /** + * Catch all for all other potential types that are then apparently not + * block sparsity patterns. + */ + static std::false_type + check(...); -public: - /** - * A statically computable value that indicates whether the template - * argument to this class is a block sparsity pattern (in fact whether the - * type is derived from BlockSparsityPatternBase). - */ - static const bool value = - std::is_same())), - std::true_type>::value; -}; + public: + /** + * A statically computable value that indicates whether the template + * argument to this class is a block sparsity pattern (in fact whether the + * type is derived from BlockSparsityPatternBase). + */ + static const bool value = + std::is_same())), + std::true_type>::value; + }; -// instantiation of the static member -template -const bool IsBlockSparsityPattern::value; + // instantiation of the static member + template + const bool IsBlockSparsityPattern::value; + } // namespace AffineConstraints +} // namespace internal template @@ -2404,7 +2410,9 @@ AffineConstraints::distribute_local_to_global( global_matrix, dummy, false, - std::integral_constant::value>()); + std::integral_constant< + bool, + internal::AffineConstraints::IsBlockMatrix::value>()); } @@ -2429,7 +2437,9 @@ AffineConstraints::distribute_local_to_global( global_matrix, global_vector, use_inhomogeneities_for_rhs, - std::integral_constant::value>()); + std::integral_constant< + bool, + internal::AffineConstraints::IsBlockMatrix::value>()); } @@ -2450,9 +2460,9 @@ AffineConstraints::add_entries_local_to_global( sparsity_pattern, keep_constrained_entries, dof_mask, - std::integral_constant< - bool, - IsBlockSparsityPattern::value>()); + std::integral_constant::value>()); } DEAL_II_NAMESPACE_CLOSE -- 2.39.5