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}};
38constexpr std::array<std::array<Size, 2>, 6>
mandel_index{std::array<Size, 2>{0, 0}, {
…};
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<Real, 3>, 3>
skew_factor{std::array<Real, 3>{0.0, -1.0, 1.0},
48 std::array<Real, 3>{1.0, 0.0, -1.0},
49 std::array<Real, 3>{-1.0, 1.0, 0.0}};
47constexpr std::array<std::array<Real, 3>, 3>
skew_factor{std::array<Real, 3>{0.0, -1.0, 1.0}, {
…};
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:105
const Tensor & skew_to_full_map(const TensorOptions &opt)
Definition mandel_notation.cxx:78
TensorOptions default_tensor_options()
Default floating point tensor options.
Definition defaults.cxx:44
const Tensor & skew_to_full_factor(const TensorOptions &opt)
Definition mandel_notation.cxx:96
Tensor full_to_skew(const Tensor &full, Size dim)
Convert a Tensor from full notation to skew vector notation.
Definition mandel_notation.cxx:169
double Real
Definition types.h:68
Tensor mandel_to_full(const Tensor &mandel, Size dim)
Convert a Tensor from Mandel notation to full notation.
Definition mandel_notation.cxx:160
constexpr std::array< std::array< Real, 3 >, 3 > skew_factor
Definition mandel_notation.h:47
const Tensor & full_to_mandel_map(const TensorOptions &opt)
Definition mandel_notation.cxx:31
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:129
constexpr std::array< std::array< Size, 3 >, 3 > mandel_reverse_index
Definition mandel_notation.h:36
int64_t Size
Definition types.h:69
constexpr Real mandel_factor(Size i)
Definition mandel_notation.h:52
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:50
const Tensor & mandel_to_full_factor(const TensorOptions &opt)
Definition mandel_notation.cxx:58
const Tensor & full_to_mandel_factor(const TensorOptions &opt)
Definition mandel_notation.cxx:49
c10::TensorOptions TensorOptions
Definition types.h:63
const Tensor & full_to_skew_map(const TensorOptions &opt)
Definition mandel_notation.cxx:70
const Tensor & full_to_skew_factor(const TensorOptions &opt)
Definition mandel_notation.cxx:87
Tensor skew_to_full(const Tensor &skew, Size dim)
Convert a Tensor from skew vector notation to full notation.
Definition mandel_notation.cxx:178
constexpr std::array< std::array< Size, 3 >, 3 > skew_reverse_index
Definition mandel_notation.h:45
const Tensor & mandel_to_full_map(const TensorOptions &opt)
Definition mandel_notation.cxx:40
Tensor full_to_mandel(const Tensor &full, Size dim)
Convert a Tensor from full notation to Mandel notation.
Definition mandel_notation.cxx:151
constexpr Real sqrt2
Definition types.h:102