8template <
typename T>
struct TensorTraits;
11 static constexpr size_t rank = Rank;
16 static constexpr size_t rank = 0;
21 static constexpr size_t rank = 1;
30template <
typename T,
typename ScalarFunc>
38template <
typename T,
typename ScalarFunc>
45template <
typename T,
typename ScalarFunc>
55 throw std::invalid_argument(
"autodiff_rank0: PARTIAL ou COV uniquement. Utiliser "
56 "`autodiff_scalar_second` pour COV2.");
60template <
typename T,
typename VectorFunc>
70 throw std::invalid_argument(
71 "autodiff_rank1: uniquement PARTIAL ou COV autorisés pour un champ vectoriel");
75template <
typename T,
typename TensorFunc>
88 throw std::invalid_argument(
89 "autodiff_rank2_first: uniquement PARTIAL ou COV autorisés pour un tenseur d'ordre 2");
93template <
typename T,
typename FieldFunc>
101 if constexpr (rank == 0) {
107 }
else if constexpr (
rank == 1) {
109 }
else if constexpr (
rank == 2) {
115 "autodiff: seuls les rangs 0 (scalaire), 1 (vecteur) et 2 (tenseur2) sont supportés.");
static FrontendPluginRegistry::Add< TensoriumPluginAction > X("tensorium-dispatch", "Handle #pragma tensorium directives")
Register the plugin under the name "tensorium-dispatch".
Multi-dimensional tensor class with fixed rank and SIMD support.
Definition Tensor.hpp:25
Aligned, SIMD-optimized mathematical vector class for scientific computing.
Definition Vector.hpp:26
int rank()
Definition MPI_init.hpp:71
Definition BSSNAtildeTensor.hpp:10
tensorium::Tensor< T, 3 > autodiff_rank2_first(const tensorium::Vector< T > &X, T dx, T dy, T dz, TensorFunc &&func, DiffMode mode, const tensorium::Tensor< T, 3 > &christoffel)
Definition BSSNAutoDiff.hpp:76
tensorium::Tensor< T, 2 > autodiff_scalar_second(const tensorium::Vector< T > &X, T dx, T dy, T dz, ScalarFunc &&func, const tensorium::Tensor< T, 3 > &christoffel)
Definition BSSNAutoDiff.hpp:39
tensorium::Tensor< T, 2 > partial_vector(const tensorium::Vector< T > &X, T dx, T dy, T dz, VectorFunc &&func)
Definition BSSNDerivatives.hpp:169
DiffMode
Definition BSSNAutoDiff.hpp:28
tensorium::Tensor< T, 2 > covariant_vector(const tensorium::Vector< T > &X, T dx, T dy, T dz, VectorFunc &&func, const tensorium::Tensor< T, 3 > &Gamma)
Definition BSSNDerivatives.hpp:628
auto autodiff(const tensorium::Vector< T > &X, T dx, T dy, T dz, FieldFunc &&func, DiffMode mode, const tensorium::Tensor< T, 3 > &christoffel={})
Definition BSSNAutoDiff.hpp:94
tensorium::Vector< T > covariant_scalar(const tensorium::Vector< T > &X, T dx, T dy, T dz, ScalarFunc &&func, const tensorium::Tensor< T, 3 > &christoffel)
Definition BSSNAutoDiff.hpp:31
tensorium::Tensor< T, 2 > covariant_scalar_second(const tensorium::Vector< T > &X, T dx, T dy, T dz, ScalarFunc &&func, const tensorium::Tensor< T, 3 > &christoffel)
Definition BSSNDerivatives.hpp:513
tensorium::Tensor< T, 3 > partial_tensor2(const tensorium::Vector< T > &X, T dx, T dy, T dz, TensorFunc &&func)
Definition BSSNDerivatives.hpp:663
tensorium::Vector< T > partial_scalar(const tensorium::Vector< T > &X, T dx, T dy, T dz, ScalarFunc &&func)
Definition BSSNDerivatives.hpp:119
tensorium::Tensor< T, 2 > autodiff_rank1(const tensorium::Vector< T > &X, T dx, T dy, T dz, VectorFunc &&func, DiffMode mode, const tensorium::Tensor< T, 3 > &christoffel)
Definition BSSNAutoDiff.hpp:61
tensorium::Tensor< T, 3 > covariant_tensor2(const tensorium::Vector< T > &X, T dx, T dy, T dz, TensorFunc &&func, const tensorium::Tensor< T, 3 > &Gamma)
Definition BSSNDerivatives.hpp:645
tensorium::Vector< T > autodiff_rank0(const tensorium::Vector< T > &X, T dx, T dy, T dz, ScalarFunc &&func, DiffMode mode, const tensorium::Tensor< T, 3 > &christoffel)
Definition BSSNAutoDiff.hpp:46
Definition Derivate.hpp:24
Definition BSSNAutoDiff.hpp:15
static constexpr size_t rank
Definition BSSNAutoDiff.hpp:16