]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix templating of some DerivativeForm functions. 8985/head
authorDoug Shi-Dong <doug.shidong@gmail.com>
Fri, 1 Nov 2019 02:27:59 +0000 (22:27 -0400)
committerDoug Shi-Dong <doug.shidong@gmail.com>
Fri, 1 Nov 2019 02:52:30 +0000 (22:52 -0400)
The previous implementation would automatically try to convert into double.

include/deal.II/base/derivative_form.h

index 211b056b82054da0e3c023a1924e02dcc679e8e7..b6e23b5c7b082c9a45cdb949492c214058c63c11 100644 (file)
@@ -344,12 +344,12 @@ DerivativeForm<order, dim, spacedim, Number>::covariant_form() const
     {
       const Tensor<2, dim, Number> DF_t =
         dealii::transpose(invert(static_cast<Tensor<2, dim, Number>>(*this)));
-      return DerivativeForm<1, dim, spacedim>(DF_t);
+      return DerivativeForm<1, dim, spacedim, Number>(DF_t);
     }
   else
     {
-      const DerivativeForm<1, spacedim, dim> DF_t = this->transpose();
-      Tensor<2, dim, Number>                 G; // First fundamental form
+      const DerivativeForm<1, spacedim, dim, Number> 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];
@@ -415,11 +415,11 @@ apply_transformation(const DerivativeForm<1, dim, spacedim, Number> &grad_F,
  */
 // rank=2
 template <int spacedim, int dim, typename Number>
-inline DerivativeForm<1, spacedim, dim>
+inline DerivativeForm<1, spacedim, dim, Number>
 apply_transformation(const DerivativeForm<1, dim, spacedim, Number> &grad_F,
                      const Tensor<2, dim, Number> &                  D_X)
 {
-  DerivativeForm<1, spacedim, dim> dest;
+  DerivativeForm<1, spacedim, dim, Number> dest;
   for (unsigned int i = 0; i < dim; ++i)
     dest[i] = apply_transformation(grad_F, D_X[i]);
 

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.