From fa5ab972f283a744f094e7fb2a306c92408a9466 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 6 Nov 2024 18:05:12 -0700 Subject: [PATCH] Adjust return type of eigenvectors(SymmetricTensor). --- include/deal.II/base/symmetric_tensor.h | 3 +- .../deal.II/base/symmetric_tensor.templates.h | 15 ++++---- source/base/symmetric_tensor.cc | 36 +++++++++---------- source/base/symmetric_tensor.inst.in | 14 ++++---- 4 files changed, 34 insertions(+), 34 deletions(-) diff --git a/include/deal.II/base/symmetric_tensor.h b/include/deal.II/base/symmetric_tensor.h index d0ac3626a8..c2346b665b 100644 --- a/include/deal.II/base/symmetric_tensor.h +++ b/include/deal.II/base/symmetric_tensor.h @@ -3025,8 +3025,7 @@ enum struct SymmetricTensorEigenvectorMethod * @relatesalso SymmetricTensor */ template -std::array>, - std::integral_constant::value> +std::array>, dim> eigenvectors(const SymmetricTensor<2, dim, Number> &T, const SymmetricTensorEigenvectorMethod method = SymmetricTensorEigenvectorMethod::ql_implicit_shifts); diff --git a/include/deal.II/base/symmetric_tensor.templates.h b/include/deal.II/base/symmetric_tensor.templates.h index 2498998f1b..b54b715939 100644 --- a/include/deal.II/base/symmetric_tensor.templates.h +++ b/include/deal.II/base/symmetric_tensor.templates.h @@ -848,8 +848,7 @@ namespace internal template -std::array>, - std::integral_constant::value> +std::array>, dim> eigenvectors(const SymmetricTensor<2, dim, Number> &T, const SymmetricTensorEigenvectorMethod method) { @@ -1055,18 +1054,18 @@ eigenvalues(const SymmetricTensor<2, 3, adouble> & /*T*/); template <> std::array>, 1> -eigenvectors(const SymmetricTensor<2, 1, adouble> & /*T*/, - const SymmetricTensorEigenvectorMethod /*method*/); +eigenvectors<1, adouble>(const SymmetricTensor<2, 1, adouble> & /*T*/, + const SymmetricTensorEigenvectorMethod /*method*/); template <> std::array>, 2> -eigenvectors(const SymmetricTensor<2, 2, adouble> & /*T*/, - const SymmetricTensorEigenvectorMethod /*method*/); +eigenvectors<2, adouble>(const SymmetricTensor<2, 2, adouble> & /*T*/, + const SymmetricTensorEigenvectorMethod /*method*/); template <> std::array>, 3> -eigenvectors(const SymmetricTensor<2, 3, adouble> & /*T*/, - const SymmetricTensorEigenvectorMethod /*method*/); +eigenvectors<3, adouble>(const SymmetricTensor<2, 3, adouble> & /*T*/, + const SymmetricTensorEigenvectorMethod /*method*/); #endif DEAL_II_NAMESPACE_CLOSE diff --git a/source/base/symmetric_tensor.cc b/source/base/symmetric_tensor.cc index 341420406b..8c9fb0a3d3 100644 --- a/source/base/symmetric_tensor.cc +++ b/source/base/symmetric_tensor.cc @@ -83,8 +83,8 @@ eigenvalues(const SymmetricTensor<2, 3, adouble> & /*T*/) template <> std::array>, 1> -eigenvectors(const SymmetricTensor<2, 1, adouble> & /*T*/, - const SymmetricTensorEigenvectorMethod /*method*/) +eigenvectors<1, adouble>(const SymmetricTensor<2, 1, adouble> & /*T*/, + const SymmetricTensorEigenvectorMethod /*method*/) { AssertThrow(false, ExcADOLCAdvancedBranching()); return std::array>, 1>(); @@ -94,8 +94,8 @@ eigenvectors(const SymmetricTensor<2, 1, adouble> & /*T*/, template <> std::array>, 2> -eigenvectors(const SymmetricTensor<2, 2, adouble> & /*T*/, - const SymmetricTensorEigenvectorMethod /*method*/) +eigenvectors<2, adouble>(const SymmetricTensor<2, 2, adouble> & /*T*/, + const SymmetricTensorEigenvectorMethod /*method*/) { AssertThrow(false, ExcADOLCAdvancedBranching()); return std::array>, 2>(); @@ -105,8 +105,8 @@ eigenvectors(const SymmetricTensor<2, 2, adouble> & /*T*/, template <> std::array>, 3> -eigenvectors(const SymmetricTensor<2, 3, adouble> & /*T*/, - const SymmetricTensorEigenvectorMethod /*method*/) +eigenvectors<3, adouble>(const SymmetricTensor<2, 3, adouble> & /*T*/, + const SymmetricTensorEigenvectorMethod /*method*/) { AssertThrow(false, ExcADOLCAdvancedBranching()); return std::array>, 3>(); @@ -124,16 +124,16 @@ template std::array eigenvalues(const SymmetricTensor<2, 3, adouble> &); template std::array>, 1> -eigenvectors(const SymmetricTensor<2, 1, adouble> &, - const SymmetricTensorEigenvectorMethod); +eigenvectors<1, adouble>(const SymmetricTensor<2, 1, adouble> &, + const SymmetricTensorEigenvectorMethod); template std::array>, 2> -eigenvectors(const SymmetricTensor<2, 2, adouble> &, - const SymmetricTensorEigenvectorMethod); +eigenvectors<2, adouble>(const SymmetricTensor<2, 2, adouble> &, + const SymmetricTensorEigenvectorMethod); template std::array>, 3> -eigenvectors(const SymmetricTensor<2, 3, adouble> &, - const SymmetricTensorEigenvectorMethod); +eigenvectors<3, adouble>(const SymmetricTensor<2, 3, adouble> &, + const SymmetricTensorEigenvectorMethod); # endif template std::array @@ -146,16 +146,16 @@ template std::array eigenvalues(const SymmetricTensor<2, 3, adtl::adouble> &); template std::array>, 1> -eigenvectors(const SymmetricTensor<2, 1, adtl::adouble> &, - const SymmetricTensorEigenvectorMethod); +eigenvectors<1, adtl::adouble>(const SymmetricTensor<2, 1, adtl::adouble> &, + const SymmetricTensorEigenvectorMethod); template std::array>, 2> -eigenvectors(const SymmetricTensor<2, 2, adtl::adouble> &, - const SymmetricTensorEigenvectorMethod); +eigenvectors<2, adtl::adouble>(const SymmetricTensor<2, 2, adtl::adouble> &, + const SymmetricTensorEigenvectorMethod); template std::array>, 3> -eigenvectors(const SymmetricTensor<2, 3, adtl::adouble> &, - const SymmetricTensorEigenvectorMethod); +eigenvectors<3, adtl::adouble>(const SymmetricTensor<2, 3, adtl::adouble> &, + const SymmetricTensorEigenvectorMethod); #endif // explicit instantiations diff --git a/source/base/symmetric_tensor.inst.in b/source/base/symmetric_tensor.inst.in index 0474476c62..c402f3b55e 100644 --- a/source/base/symmetric_tensor.inst.in +++ b/source/base/symmetric_tensor.inst.in @@ -23,9 +23,10 @@ for (deal_II_dimension : DIMENSIONS; number : REAL_SCALARS) const SymmetricTensor<2, deal_II_dimension, number> &); template std::array>, - std::integral_constant::value> - eigenvectors(const SymmetricTensor<2, deal_II_dimension, number> &, - const SymmetricTensorEigenvectorMethod); + deal_II_dimension> + eigenvectors( + const SymmetricTensor<2, deal_II_dimension, number> &, + const SymmetricTensorEigenvectorMethod); } for (deal_II_dimension : DIMENSIONS; number : DIFFERENTIABLE_ADOLC_REAL_SCALARS) @@ -46,9 +47,10 @@ for (deal_II_dimension : DIMENSIONS; const SymmetricTensor<2, deal_II_dimension, number> &); template std::array>, - std::integral_constant::value> - eigenvectors(const SymmetricTensor<2, deal_II_dimension, number> &, - const SymmetricTensorEigenvectorMethod); + deal_II_dimension> + eigenvectors( + const SymmetricTensor<2, deal_II_dimension, number> &, + const SymmetricTensorEigenvectorMethod); } for (deal_II_dimension : DIMENSIONS; number : COMPLEX_SCALARS) -- 2.39.5