From 62b9994171adb1f84297ec60cd66fce2e29d16a3 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 28 Mar 2016 10:44:18 -0500 Subject: [PATCH] Update the documentation of DerivativeForm::covariant_form(). Also update the implementation slightly for style. --- include/deal.II/base/derivative_form.h | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/include/deal.II/base/derivative_form.h b/include/deal.II/base/derivative_form.h index d13549f059..16a8409a08 100644 --- a/include/deal.II/base/derivative_form.h +++ b/include/deal.II/base/derivative_form.h @@ -117,9 +117,12 @@ public: double determinant () const; /** - * Assuming (*this) stores the jacobian of the mapping F, it computes its - * covariant matrix, namely $DF*G^{-1}$, where $G = DF^{t}*DF$. If $DF$ is - * square, covariant from gives $DF^{-t}$. + * Assuming that the current object stores the Jacobian of a mapping + * $F$, then the current function computes the covariant form + * of the derivative, namely $(\nabla F)G^{-1}$, where $G = (\nabla + * F)^{T}*(\nabla F)$. If $\nabla F$ is a square matrix (i.e., $F: + * {\mathbb R}^n \mapsto {\mathbb R}^n$), then this function + * simplifies to computing $\nabla F^{-T}$. */ DerivativeForm<1, dim, spacedim, Number> covariant_form() const; @@ -349,27 +352,22 @@ inline DerivativeForm<1,dim,spacedim,Number> DerivativeForm::covariant_form() const { - if (dim == spacedim) { - - Tensor<2,dim,Number> DF_t (dealii::transpose(invert( (Tensor<2,dim,Number>)(*this) ))); - DerivativeForm<1,dim, spacedim> result = DF_t; - return (result); + const Tensor<2,dim,Number> DF_t + = dealii::transpose (invert (static_cast >(*this))); + return DerivativeForm<1,dim, spacedim> (DF_t); } else { - - DerivativeForm<1,spacedim,dim> DF_t = this->transpose(); + const DerivativeForm<1,spacedim,dim> DF_t = this->transpose(); Tensor<2,dim,Number> G; //First fundamental form for (unsigned int i=0; itimes_T_t(invert(G))); - } - } -- 2.39.5