29#include "neml2/misc/types.h"
30#include "neml2/misc/defaults.h"
37 std::array<Size, 3>{0, 5, 4}, std::array<Size, 3>{5, 1, 3}, std::array<Size, 3>{4, 3, 2}};
38constexpr std::array<std::array<Size, 2>, 6>
mandel_index{std::array<Size, 2>{0, 0},
39 std::array<Size, 2>{1, 1},
40 std::array<Size, 2>{2, 2},
41 std::array<Size, 2>{1, 2},
42 std::array<Size, 2>{0, 2},
43 std::array<Size, 2>{0, 1}};
46 std::array<Size, 3>{0, 2, 1}, std::array<Size, 3>{2, 0, 0}, std::array<Size, 3>{1, 0, 0}};
47constexpr std::array<std::array<double, 3>, 3>
skew_factor{std::array<double, 3>{0.0, -1.0, 1.0},
48 std::array<double, 3>{1.0, 0.0, -1.0},
49 std::array<double, 3>{-1.0, 1.0, 0.0}};
51inline constexpr double
54 return i < 3 ? 1.0 :
sqrt2;
88full_to_reduced(
const Tensor & full,
const Tensor & rmap,
const Tensor & rfactors,
Size dim = 0);
102reduced_to_full(
const Tensor & reduced,
const Tensor & rmap,
const Tensor & rfactors,
Size dim = 0);
Definition DiagnosticsInterface.cxx:30
Tensor full_to_reduced(const Tensor &full, const Tensor &rmap, const Tensor &rfactors, Size dim)
Generic function to reduce two axes to one with some map.
Definition mandel_notation.cxx:106
const Tensor & skew_to_full_map(const TensorOptions &opt)
Definition mandel_notation.cxx:79
TensorOptions default_tensor_options()
Default floating point tensor options.
Definition defaults.cxx:42
const Tensor & skew_to_full_factor(const TensorOptions &opt)
Definition mandel_notation.cxx:97
Tensor full_to_skew(const Tensor &full, Size dim)
Convert a Tensor from full notation to skew vector notation.
Definition mandel_notation.cxx:170
Tensor mandel_to_full(const Tensor &mandel, Size dim)
Convert a Tensor from Mandel notation to full notation.
Definition mandel_notation.cxx:161
constexpr std::array< std::array< double, 3 >, 3 > skew_factor
Definition mandel_notation.h:47
const Tensor & full_to_mandel_map(const TensorOptions &opt)
Definition mandel_notation.cxx:32
Tensor reduced_to_full(const Tensor &reduced, const Tensor &rmap, const Tensor &rfactors, Size dim)
Convert a Tensor from reduced notation to full notation.
Definition mandel_notation.cxx:130
constexpr std::array< std::array< Size, 3 >, 3 > mandel_reverse_index
Definition mandel_notation.h:36
int64_t Size
Definition types.h:65
constexpr std::array< std::array< Size, 2 >, 6 > mandel_index
Definition mandel_notation.h:38
TensorOptions default_integer_tensor_options()
Default integral tensor options.
Definition defaults.cxx:60
const Tensor & mandel_to_full_factor(const TensorOptions &opt)
Definition mandel_notation.cxx:59
const Tensor & full_to_mandel_factor(const TensorOptions &opt)
Definition mandel_notation.cxx:50
c10::TensorOptions TensorOptions
Definition types.h:60
constexpr double mandel_factor(Size i)
Definition mandel_notation.h:52
const Tensor & full_to_skew_map(const TensorOptions &opt)
Definition mandel_notation.cxx:71
const Tensor & full_to_skew_factor(const TensorOptions &opt)
Definition mandel_notation.cxx:88
Tensor skew_to_full(const Tensor &skew, Size dim)
Convert a Tensor from skew vector notation to full notation.
Definition mandel_notation.cxx:179
constexpr std::array< std::array< Size, 3 >, 3 > skew_reverse_index
Definition mandel_notation.h:45
constexpr double sqrt2
Definition types.h:93
const Tensor & mandel_to_full_map(const TensorOptions &opt)
Definition mandel_notation.cxx:41
Tensor full_to_mandel(const Tensor &full, Size dim)
Convert a Tensor from full notation to Mandel notation.
Definition mandel_notation.cxx:152