From: Doug Shi-Dong Date: Fri, 1 Nov 2019 02:27:59 +0000 (-0400) Subject: Fix templating of some DerivativeForm functions. X-Git-Tag: v9.2.0-rc1~926^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F8985%2Fhead;p=dealii.git Fix templating of some DerivativeForm functions. The previous implementation would automatically try to convert into double. --- diff --git a/include/deal.II/base/derivative_form.h b/include/deal.II/base/derivative_form.h index 211b056b82..b6e23b5c7b 100644 --- a/include/deal.II/base/derivative_form.h +++ b/include/deal.II/base/derivative_form.h @@ -344,12 +344,12 @@ DerivativeForm::covariant_form() const { const Tensor<2, dim, Number> DF_t = dealii::transpose(invert(static_cast>(*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 -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]);