From 4a6ff058b0beb84b17344681870406c27ba7d633 Mon Sep 17 00:00:00 2001 From: Doug Shi-Dong Date: Thu, 31 Oct 2019 22:27:59 -0400 Subject: [PATCH] Fix templating of some DerivativeForm functions. The previous implementation would automatically try to convert into double. --- include/deal.II/base/derivative_form.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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]); -- 2.39.5