const Vector<double> vA = Notation::Kelvin::to_vector(A);
const FullMatrix<double> mA = Notation::Kelvin::to_matrix(A);
- using InpType = typename std::decay<decltype(A)>::type;
- const auto vA_conv = Notation::Kelvin::to_tensor<InpType>(vA);
- const auto mA_conv = Notation::Kelvin::to_tensor<InpType>(mA);
+ using InpType = typename std::decay<decltype(A)>::type;
+ // Here and below we need both types to work around a problem present in GCC
+ // 5.4.0 in which the compiler does not correctly handle SFINAE with
+ // static_assert(). This was fixed by GCC 9.
+ const auto vA_conv = Notation::Kelvin::to_tensor<InpType, double>(vA);
+ const auto mA_conv = Notation::Kelvin::to_tensor<InpType, double>(mA);
Assert(std::abs(vA_conv - A) < 1e-12,
ExcMessage("Different result for vector conversion"));
const Vector<double> vA = Notation::Kelvin::to_vector(A);
using InpType = typename std::decay<decltype(A)>::type;
- const auto vA_conv = Notation::Kelvin::to_tensor<InpType>(vA);
+ const auto vA_conv = Notation::Kelvin::to_tensor<InpType, double>(vA);
Assert((vA_conv - A).norm() < 1e-12,
ExcMessage("Different result for vector conversion"));
const FullMatrix<double> mA = Notation::Kelvin::to_matrix(A);
using InpType = typename std::decay<decltype(A)>::type;
- const auto vA_conv = Notation::Kelvin::to_tensor<InpType>(vA);
- const auto mA_conv = Notation::Kelvin::to_tensor<InpType>(mA);
+ const auto vA_conv = Notation::Kelvin::to_tensor<InpType, double>(vA);
+ const auto mA_conv = Notation::Kelvin::to_tensor<InpType, double>(mA);
Assert((vA_conv - A).norm() < 1e-12,
ExcMessage("Different result for vector conversion"));
const FullMatrix<double> mA = Notation::Kelvin::to_matrix(A);
using InpType = typename std::decay<decltype(A)>::type;
- const auto vA_conv = Notation::Kelvin::to_tensor<InpType>(vA);
- const auto mA_conv = Notation::Kelvin::to_tensor<InpType>(mA);
+ const auto vA_conv = Notation::Kelvin::to_tensor<InpType, double>(vA);
+ const auto mA_conv = Notation::Kelvin::to_tensor<InpType, double>(mA);
Assert((vA_conv - A).norm() < 1e-12,
ExcMessage("Different result for vector conversion"));
Notation::Kelvin::to_matrix<dim, Tensor<1, dim>, Tensor<2, dim>>(A);
using InpType = typename std::decay<decltype(A)>::type;
- const auto mA_conv = Notation::Kelvin::to_tensor<InpType>(mA);
+ const auto mA_conv = Notation::Kelvin::to_tensor<InpType, double>(mA);
Assert((mA_conv - A).norm() < 1e-12,
ExcMessage("Different result for matrix conversion"));
Notation::Kelvin::to_matrix<dim, Tensor<2, dim>, Tensor<1, dim>>(A);
using InpType = typename std::decay<decltype(A)>::type;
- const auto mA_conv = Notation::Kelvin::to_tensor<InpType>(mA);
+ const auto mA_conv = Notation::Kelvin::to_tensor<InpType, double>(mA);
Assert((mA_conv - A).norm() < 1e-12,
ExcMessage("Different result for matrix conversion"));
A);
using InpType = typename std::decay<decltype(A)>::type;
- const auto mA_conv = Notation::Kelvin::to_tensor<InpType>(mA);
+ const auto mA_conv = Notation::Kelvin::to_tensor<InpType, double>(mA);
Assert((mA_conv - A).norm() < 1e-12,
ExcMessage("Different result for matrix conversion"));
A);
using InpType = typename std::decay<decltype(A)>::type;
- const auto mA_conv = Notation::Kelvin::to_tensor<InpType>(mA);
+ const auto mA_conv = Notation::Kelvin::to_tensor<InpType, double>(mA);
Assert((mA_conv - A).norm() < 1e-12,
ExcMessage("Different result for matrix conversion"));
const FullMatrix<double> mA = Notation::Kelvin::to_matrix(A);
using InpType = typename std::decay<decltype(A)>::type;
- const auto mA_conv = Notation::Kelvin::to_tensor<InpType>(mA);
+ const auto mA_conv = Notation::Kelvin::to_tensor<InpType, double>(mA);
Assert((mA_conv - A).norm() < 1e-12,
ExcMessage("Different result for matrix conversion"));
const FullMatrix<double> mA = Notation::Kelvin::to_matrix(A);
using InpType = typename std::decay<decltype(A)>::type;
- const auto mA_conv = Notation::Kelvin::to_tensor<InpType>(mA);
+ const auto mA_conv = Notation::Kelvin::to_tensor<InpType, double>(mA);
Assert((mA_conv - A).norm() < 1e-12,
ExcMessage("Different result for matrix conversion"));
Vector<double> vB(mC.m());
mC.vmult(vB, vA);
- using InpVecType = typename std::decay<decltype(A)>::type;
- using ResVecType = typename std::decay<decltype(B)>::type;
- using InpMatType = typename std::decay<decltype(C)>::type;
- const auto A_conv = Notation::Kelvin::to_tensor<InpVecType>(vA);
- const auto B_conv = Notation::Kelvin::to_tensor<ResVecType>(vB);
- const auto C_conv = Notation::Kelvin::to_tensor<InpMatType>(mC);
+ using InpVecType = typename std::decay<decltype(A)>::type;
+ using ResVecType = typename std::decay<decltype(B)>::type;
+ using InpMatType = typename std::decay<decltype(C)>::type;
+ // Here and below we need both types to work around a problem present in GCC
+ // 5.4.0 in which the compiler does not correctly handle SFINAE with
+ // static_assert(). This was fixed by GCC 9.
+ const auto A_conv = Notation::Kelvin::to_tensor<InpVecType, double>(vA);
+ const auto B_conv = Notation::Kelvin::to_tensor<ResVecType, double>(vB);
+ const auto C_conv = Notation::Kelvin::to_tensor<InpMatType, double>(mC);
std::cout << "Scalar" << std::endl;
std::cout << "A: " << A << " A_conv: " << A_conv << std::endl;
using InpVecType = typename std::decay<decltype(A)>::type;
using ResVecType = typename std::decay<decltype(B)>::type;
using InpMatType = typename std::decay<decltype(C)>::type;
- const auto A_conv = Notation::Kelvin::to_tensor<InpVecType>(vA);
- const auto B_conv = Notation::Kelvin::to_tensor<ResVecType>(vB);
- const auto C_conv = Notation::Kelvin::to_tensor<InpMatType>(mC);
+ const auto A_conv = Notation::Kelvin::to_tensor<InpVecType, double>(vA);
+ const auto B_conv = Notation::Kelvin::to_tensor<ResVecType, double>(vB);
+ const auto C_conv = Notation::Kelvin::to_tensor<InpMatType, double>(mC);
std::cout << "Rank 0" << std::endl;
std::cout << "A: " << A << " A_conv: " << A_conv << std::endl;
using InpVecType = typename std::decay<decltype(A)>::type;
using ResVecType = typename std::decay<decltype(B)>::type;
using InpMatType = typename std::decay<decltype(C)>::type;
- const auto A_conv = Notation::Kelvin::to_tensor<InpVecType>(vA);
- const auto B_conv = Notation::Kelvin::to_tensor<ResVecType>(vB);
- const auto C_conv = Notation::Kelvin::to_tensor<InpMatType>(mC);
+ const auto A_conv = Notation::Kelvin::to_tensor<InpVecType, double>(vA);
+ const auto B_conv = Notation::Kelvin::to_tensor<ResVecType, double>(vB);
+ const auto C_conv = Notation::Kelvin::to_tensor<InpMatType, double>(mC);
std::cout << "Rank 1 (non-symm)" << std::endl;
std::cout << "A: " << A << " A_conv: " << A_conv << std::endl;
using InpVecType = typename std::decay<decltype(A)>::type;
using ResVecType = typename std::decay<decltype(B)>::type;
using InpMatType = typename std::decay<decltype(C)>::type;
- const auto A_conv = Notation::Kelvin::to_tensor<InpVecType>(vA);
- const auto B_conv = Notation::Kelvin::to_tensor<ResVecType>(vB);
- const auto C_conv = Notation::Kelvin::to_tensor<InpMatType>(mC);
+ const auto A_conv = Notation::Kelvin::to_tensor<InpVecType, double>(vA);
+ const auto B_conv = Notation::Kelvin::to_tensor<ResVecType, double>(vB);
+ const auto C_conv = Notation::Kelvin::to_tensor<InpMatType, double>(mC);
std::cout << "Rank 1 (symm)" << std::endl;
std::cout << "A: " << A << " A_conv: " << A_conv << std::endl;
using InpVecType = typename std::decay<decltype(A)>::type;
using ResVecType = typename std::decay<decltype(B)>::type;
using InpMatType = typename std::decay<decltype(C)>::type;
- const auto A_conv = Notation::Kelvin::to_tensor<InpVecType>(vA);
- const auto B_conv = Notation::Kelvin::to_tensor<ResVecType>(vB);
- const auto C_conv = Notation::Kelvin::to_tensor<InpMatType>(mC);
+ const auto A_conv = Notation::Kelvin::to_tensor<InpVecType, double>(vA);
+ const auto B_conv = Notation::Kelvin::to_tensor<ResVecType, double>(vB);
+ const auto C_conv = Notation::Kelvin::to_tensor<InpMatType, double>(mC);
std::cout << "Rank 2 (non-symm)" << std::endl;
std::cout << "A: " << A << " A_conv: " << A_conv << std::endl;
using InpVecType = typename std::decay<decltype(A)>::type;
using ResVecType = typename std::decay<decltype(B)>::type;
using InpMatType = typename std::decay<decltype(C)>::type;
- const auto A_conv = Notation::Kelvin::to_tensor<InpVecType>(vA);
- const auto B_conv = Notation::Kelvin::to_tensor<ResVecType>(vB);
- const auto C_conv = Notation::Kelvin::to_tensor<InpMatType>(mC);
+ const auto A_conv = Notation::Kelvin::to_tensor<InpVecType, double>(vA);
+ const auto B_conv = Notation::Kelvin::to_tensor<ResVecType, double>(vB);
+ const auto C_conv = Notation::Kelvin::to_tensor<InpMatType, double>(mC);
std::cout << "Rank 2 (symm)" << std::endl;
std::cout << "A: " << A << " A_conv: " << A_conv << std::endl;
using InpVecType = typename std::decay<decltype(A)>::type;
using ResVecType = typename std::decay<decltype(B)>::type;
using InpMatType = typename std::decay<decltype(C)>::type;
- const auto A_conv = Notation::Kelvin::to_tensor<InpVecType>(vA);
- const auto B_conv = Notation::Kelvin::to_tensor<ResVecType>(vB);
- const auto C_conv = Notation::Kelvin::to_tensor<InpMatType>(mC);
+ const auto A_conv = Notation::Kelvin::to_tensor<InpVecType, double>(vA);
+ const auto B_conv = Notation::Kelvin::to_tensor<ResVecType, double>(vB);
+ const auto C_conv = Notation::Kelvin::to_tensor<InpMatType, double>(mC);
std::cout << "Rank 2 (non-symm from symm)" << std::endl;
std::cout << "A: " << A << " A_conv: " << A_conv << std::endl;
using InpVecType = typename std::decay<decltype(A)>::type;
using ResVecType = typename std::decay<decltype(B)>::type;
using InpMatType = typename std::decay<decltype(C)>::type;
- const auto A_conv = Notation::Kelvin::to_tensor<InpVecType>(vA);
- const auto B_conv = Notation::Kelvin::to_tensor<ResVecType>(vB);
- const auto C_conv = Notation::Kelvin::to_tensor<InpMatType>(mC);
+ const auto A_conv = Notation::Kelvin::to_tensor<InpVecType, double>(vA);
+ const auto B_conv = Notation::Kelvin::to_tensor<ResVecType, double>(vB);
+ const auto C_conv = Notation::Kelvin::to_tensor<InpMatType, double>(mC);
std::cout << "Rank 3 (non-symm 1)" << std::endl;
std::cout << "A: " << A << " A_conv: " << A_conv << std::endl;
using InpVecType = typename std::decay<decltype(A)>::type;
using ResVecType = typename std::decay<decltype(B)>::type;
using InpMatType = typename std::decay<decltype(C)>::type;
- const auto A_conv = Notation::Kelvin::to_tensor<InpVecType>(vA);
- const auto B_conv = Notation::Kelvin::to_tensor<ResVecType>(vB);
- const auto C_conv = Notation::Kelvin::to_tensor<InpMatType>(mC);
+ const auto A_conv = Notation::Kelvin::to_tensor<InpVecType, double>(vA);
+ const auto B_conv = Notation::Kelvin::to_tensor<ResVecType, double>(vB);
+ const auto C_conv = Notation::Kelvin::to_tensor<InpMatType, double>(mC);
std::cout << "Rank 3 (non-symm 2)" << std::endl;
std::cout << "A: " << A << " A_conv: " << A_conv << std::endl;
using InpVecType = typename std::decay<decltype(A)>::type;
using ResVecType = typename std::decay<decltype(B)>::type;
using InpMatType = typename std::decay<decltype(C)>::type;
- const auto A_conv = Notation::Kelvin::to_tensor<InpVecType>(vA);
- const auto B_conv = Notation::Kelvin::to_tensor<ResVecType>(vB);
- const auto C_conv = Notation::Kelvin::to_tensor<InpMatType>(mC);
+ const auto A_conv = Notation::Kelvin::to_tensor<InpVecType, double>(vA);
+ const auto B_conv = Notation::Kelvin::to_tensor<ResVecType, double>(vB);
+ const auto C_conv = Notation::Kelvin::to_tensor<InpMatType, double>(mC);
std::cout << "Rank 3 (symm 1)" << std::endl;
std::cout << "A: " << A << " A_conv: " << A_conv << std::endl;
using InpVecType = typename std::decay<decltype(A)>::type;
using ResVecType = typename std::decay<decltype(B)>::type;
using InpMatType = typename std::decay<decltype(C)>::type;
- const auto A_conv = Notation::Kelvin::to_tensor<InpVecType>(vA);
- const auto B_conv = Notation::Kelvin::to_tensor<ResVecType>(vB);
- const auto C_conv = Notation::Kelvin::to_tensor<InpMatType>(mC);
+ const auto A_conv = Notation::Kelvin::to_tensor<InpVecType, double>(vA);
+ const auto B_conv = Notation::Kelvin::to_tensor<ResVecType, double>(vB);
+ const auto C_conv = Notation::Kelvin::to_tensor<InpMatType, double>(mC);
std::cout << "Rank 3 (symm 2)" << std::endl;
std::cout << "A: " << A << " A_conv: " << A_conv << std::endl;