From: Wolfgang Bangerth Date: Mon, 28 Mar 2016 15:44:18 +0000 (-0500) Subject: Update the documentation of DerivativeForm::covariant_form(). X-Git-Tag: v8.5.0-rc1~1156^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2428%2Fhead;p=dealii.git Update the documentation of DerivativeForm::covariant_form(). Also update the implementation slightly for style. --- 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))); - } - }