From 3b589f88e318c218076ea644c4c3c6bdc5929904 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Sun, 3 Jul 2022 10:06:41 -0400 Subject: [PATCH] doxygen: fix SymmetricTensor friends - remove duplicate instances of deviator, trace, etc. - put documentation where doxygen can see it --- include/deal.II/base/symmetric_tensor.h | 67 +++++++++++++------------ 1 file changed, 35 insertions(+), 32 deletions(-) diff --git a/include/deal.II/base/symmetric_tensor.h b/include/deal.II/base/symmetric_tensor.h index 0fd3c1cf80..e8afc5fc6d 100644 --- a/include/deal.II/base/symmetric_tensor.h +++ b/include/deal.II/base/symmetric_tensor.h @@ -125,14 +125,46 @@ template constexpr DEAL_II_ALWAYS_INLINE SymmetricTensor<4, dim, Number> invert(const SymmetricTensor<4, dim, Number> &); +/** + * Compute and return the trace of a tensor of rank 2, i.e. the sum of its + * diagonal entries. The trace is the first invariant of a rank-2 tensor. + * \f[ + * \text{tr} \mathbf A = \sum_i A_{ii} + * \f] + * + * @relatesalso SymmetricTensor + */ template constexpr inline DEAL_II_ALWAYS_INLINE Number trace(const SymmetricTensor<2, dim2, Number> &); +/** + * Compute the deviator of a symmetric tensor, which is defined as + * $\text{dev} \mathbf T = \mathbf T - + * \frac{1}{\text{dim}} \text{tr}\mathbf T \; \mathbf I$, where $\mathbf I$ + * is the identity operator. This + * quantity equals the original tensor minus its contractive or dilative + * component and refers to the shear in, for example, elasticity. + * + * @relatesalso SymmetricTensor + */ template constexpr inline DEAL_II_ALWAYS_INLINE SymmetricTensor<2, dim, Number> deviator(const SymmetricTensor<2, dim, Number> &); +/** + * Compute the determinant of a rank 2 symmetric tensor. The determinant is + * also commonly referred to as the third invariant of rank-2 tensors. + * + * For a one-dimensional tensor, the determinant equals the only element and + * is therefore equivalent to the trace. + * + * For greater notational simplicity, there is also a + * third_invariant() + * function that returns the determinant of a tensor. + * + * @relatesalso SymmetricTensor + */ template DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE Number determinant(const SymmetricTensor<2, dim, Number> &); @@ -1069,6 +1101,8 @@ private: */ base_tensor_type data; +#ifndef DOXYGEN + // Make all other symmetric tensors friends. template friend class SymmetricTensor; @@ -1105,6 +1139,7 @@ private: friend struct internal::SymmetricTensorImplementation:: Inverse<4, dim, Number>; +#endif }; @@ -2727,19 +2762,6 @@ constexpr DEAL_II_ALWAYS_INLINE -/** - * Compute the determinant of a rank 2 symmetric tensor. The determinant is - * also commonly referred to as the third invariant of rank-2 tensors. - * - * For a one-dimensional tensor, the determinant equals the only element and - * is therefore equivalent to the trace. - * - * For greater notational simplicity, there is also a - * third_invariant() - * function that returns the determinant of a tensor. - * - * @relatesalso SymmetricTensor - */ template DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE Number determinant(const SymmetricTensor<2, dim, Number> &t) @@ -2789,15 +2811,6 @@ third_invariant(const SymmetricTensor<2, dim, Number> &t) -/** - * Compute and return the trace of a tensor of rank 2, i.e. the sum of its - * diagonal entries. The trace is the first invariant of a rank-2 tensor. - * \f[ - * \text{tr} \mathbf A = \sum_i A_{ii} - * \f] - * - * @relatesalso SymmetricTensor - */ template constexpr inline DEAL_II_ALWAYS_INLINE Number trace(const SymmetricTensor<2, dim, Number> &d) @@ -3297,16 +3310,6 @@ transpose(const SymmetricTensor &t) -/** - * Compute the deviator of a symmetric tensor, which is defined as - * $\text{dev} \mathbf T = \mathbf T - - * \frac{1}{\text{dim}} \text{tr}\mathbf T \; \mathbf I$, where $\mathbf I$ - * is the identity operator. This - * quantity equals the original tensor minus its contractive or dilative - * component and refers to the shear in, for example, elasticity. - * - * @relatesalso SymmetricTensor - */ template constexpr inline DEAL_II_ALWAYS_INLINE SymmetricTensor<2, dim, Number> deviator(const SymmetricTensor<2, dim, Number> &t) -- 2.39.5