From 73ed8d2e2208a181110c5dc3adc065f6f1a905e1 Mon Sep 17 00:00:00 2001 From: Jean-Paul Pelteret Date: Thu, 12 Apr 2018 15:39:11 +0200 Subject: [PATCH] Instantiate SymmetricTensor class for auto-differentiable numbers --- .../changes/minor/20180412Jean-PaulPelteret-4 | 4 + source/base/symmetric_tensor.cc | 6 +- source/base/symmetric_tensor.inst.in | 124 ++++++------------ 3 files changed, 45 insertions(+), 89 deletions(-) create mode 100644 doc/news/changes/minor/20180412Jean-PaulPelteret-4 diff --git a/doc/news/changes/minor/20180412Jean-PaulPelteret-4 b/doc/news/changes/minor/20180412Jean-PaulPelteret-4 new file mode 100644 index 0000000000..edb1c45a9b --- /dev/null +++ b/doc/news/changes/minor/20180412Jean-PaulPelteret-4 @@ -0,0 +1,4 @@ +Fixed: The SymmetricTensor class was previously not instantiated for +auto-differentiable numbers. +
+(Jean-Paul Pelteret, 2018/04/12) diff --git a/source/base/symmetric_tensor.cc b/source/base/symmetric_tensor.cc index b6c125d0e5..f4b6242ca5 100644 --- a/source/base/symmetric_tensor.cc +++ b/source/base/symmetric_tensor.cc @@ -16,12 +16,8 @@ #include // Required for instantiation of template functions -#ifdef DEAL_II_WITH_TRILINOS - -# include - +#include #include -#endif #include #include diff --git a/source/base/symmetric_tensor.inst.in b/source/base/symmetric_tensor.inst.in index e321af8d47..7e7963fe7d 100644 --- a/source/base/symmetric_tensor.inst.in +++ b/source/base/symmetric_tensor.inst.in @@ -22,123 +22,79 @@ for (deal_II_dimension : DIMENSIONS; number : REAL_SCALARS) template class SymmetricTensor<4,deal_II_dimension,number>; - namespace internal - \{ - namespace SymmetricTensorImplementation - \{ template - void - tridiagonalize - (const dealii::SymmetricTensor<2,deal_II_dimension,number> &, - dealii::Tensor<2,deal_II_dimension,number> &, - std::array &, - std::array &); + std::array + eigenvalues (const SymmetricTensor<2,deal_II_dimension,number> &); template std::array >,deal_II_dimension> - ql_implicit_shifts - (const dealii::SymmetricTensor<2,deal_II_dimension,number> &); - - template - std::array >,deal_II_dimension> - jacobi - (dealii::SymmetricTensor<2,deal_II_dimension,number>); - -#ifdef DEAL_II_WITH_TRILINOS - template - void - tridiagonalize > - (const dealii::SymmetricTensor<2,deal_II_dimension,Sacado::Fad::DFad > &, - dealii::Tensor<2,deal_II_dimension,Sacado::Fad::DFad > &, - std::array,deal_II_dimension> &, - std::array,deal_II_dimension-1> &); - - template - std::array, Tensor<1,deal_II_dimension,Sacado::Fad::DFad > >,deal_II_dimension> - ql_implicit_shifts > - (const dealii::SymmetricTensor<2,deal_II_dimension,Sacado::Fad::DFad > &); - - template - std::array, Tensor<1,deal_II_dimension,Sacado::Fad::DFad > >,deal_II_dimension> - jacobi > - (dealii::SymmetricTensor<2,deal_II_dimension,Sacado::Fad::DFad >); -#endif - \} - \} + eigenvectors (const SymmetricTensor<2,deal_II_dimension,number> &, + const SymmetricTensorEigenvectorMethod); } -for (deal_II_dimension : DIMENSIONS; number : COMPLEX_SCALARS) +for (deal_II_dimension : DIMENSIONS; number : DIFFERENTIABLE_ADOLC_REAL_SCALARS) { template class SymmetricTensor<2,deal_II_dimension,number>; template class SymmetricTensor<4,deal_II_dimension,number>; -} - -for (number : REAL_SCALARS) -{ - namespace internal - \{ - namespace SymmetricTensorImplementation - \{ template - struct Inverse<4,3,number>; - \} - \} + std::array + eigenvalues (const SymmetricTensor<2,deal_II_dimension,number> &); template - SymmetricTensor<4,3,number> - invert (const SymmetricTensor<4,3,number> &t); + std::array >,deal_II_dimension> + eigenvectors (const SymmetricTensor<2,deal_II_dimension,number> &, + const SymmetricTensorEigenvectorMethod); +} +for (deal_II_dimension : DIMENSIONS; number : DIFFERENTIABLE_TRILINOS_SACADO_REAL_SCALARS) +{ template - std::array - eigenvalues (const SymmetricTensor<2,1,number> &); + class SymmetricTensor<2,deal_II_dimension,number>; template - std::array - eigenvalues (const SymmetricTensor<2,2,number> &); + class SymmetricTensor<4,deal_II_dimension,number>; template - std::array - eigenvalues (const SymmetricTensor<2,3,number> &); + std::array + eigenvalues (const SymmetricTensor<2,deal_II_dimension,number> &); -#ifdef DEAL_II_WITH_TRILINOS template - std::array,1> - eigenvalues (const SymmetricTensor<2,1,Sacado::Fad::DFad > &); + std::array >,deal_II_dimension> + eigenvectors (const SymmetricTensor<2,deal_II_dimension,number> &, + const SymmetricTensorEigenvectorMethod); +} +for (deal_II_dimension : DIMENSIONS; number : COMPLEX_SCALARS) +{ template - std::array,2> - eigenvalues (const SymmetricTensor<2,2,Sacado::Fad::DFad > &); + class SymmetricTensor<2,deal_II_dimension,number>; template - std::array,3> - eigenvalues (const SymmetricTensor<2,3,Sacado::Fad::DFad > &); -#endif + class SymmetricTensor<4,deal_II_dimension,number>; +} - namespace internal - \{ - namespace SymmetricTensorImplementation - \{ - template - std::array >,2> - hybrid (const dealii::SymmetricTensor<2,2,number> &); +for (number : REAL_SCALARS) +{ template - std::array >,3> - hybrid (const dealii::SymmetricTensor<2,3,number> &A); + SymmetricTensor<4,3,number> + invert (const SymmetricTensor<4,3,number> &t); +} -#ifdef DEAL_II_WITH_TRILINOS +for (number : DIFFERENTIABLE_ADOLC_REAL_SCALARS) +{ template - std::array, Tensor<1,2,Sacado::Fad::DFad > >,2> - hybrid (const dealii::SymmetricTensor<2,2,Sacado::Fad::DFad > &); + SymmetricTensor<4,3,number> + invert (const SymmetricTensor<4,3,number> &t); +} +for (number : DIFFERENTIABLE_TRILINOS_SACADO_REAL_SCALARS) +{ template - std::array, Tensor<1,3,Sacado::Fad::DFad > >,3> - hybrid (const dealii::SymmetricTensor<2,3,Sacado::Fad::DFad > &A); -#endif - \} - \} + SymmetricTensor<4,3,number> + invert (const SymmetricTensor<4,3,number> &t); } -- 2.39.5