]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Update the documentation of DerivativeForm::covariant_form(). 2428/head
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 28 Mar 2016 15:44:18 +0000 (10:44 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 28 Mar 2016 15:54:12 +0000 (10:54 -0500)
Also update the implementation slightly for style.

include/deal.II/base/derivative_form.h

index d13549f059d87ebd82c370058f5785c5a08afae7..16a8409a0829898733e32266a4fcc9378c383bc9 100644 (file)
@@ -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 <i>covariant</i> 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<order,dim,spacedim,Number>::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<Tensor<2,dim,Number> >(*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; i<dim; ++i)
         for (unsigned int j=0; j<dim; ++j)
           G[i][j] = DF_t[i] * DF_t[j];
 
       return (this->times_T_t(invert(G)));
-
     }
-
 }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.