29#include "neml2/misc/types.h"
30#include "neml2/misc/defaults.h"
31#include "neml2/misc/errors.h"
38 std::array<Size, 3>{0, 5, 4}, std::array<Size, 3>{5, 1, 3}, std::array<Size, 3>{4, 3, 2}};
39constexpr std::array<std::array<Size, 2>, 6>
mandel_index{std::array<Size, 2>{0, 0},
40 std::array<Size, 2>{1, 1},
41 std::array<Size, 2>{2, 2},
42 std::array<Size, 2>{1, 2},
43 std::array<Size, 2>{0, 2},
44 std::array<Size, 2>{0, 1}};
47 std::array<Size, 3>{0, 2, 1}, std::array<Size, 3>{2, 0, 0}, std::array<Size, 3>{1, 0, 0}};
48constexpr std::array<std::array<double, 3>, 3>
skew_factor{std::array<double, 3>{0.0, -1.0, 1.0},
49 std::array<double, 3>{1.0, 0.0, -1.0},
50 std::array<double, 3>{-1.0, 1.0, 0.0}};
52inline constexpr double
56 throw NEMLException(
"Mandel factor index out of range: " + std::to_string(i));
57 return i < 3 ? 1.0 :
sqrt2;
143full_to_reduced(
const Tensor & full,
const Tensor & rmap,
const Tensor & rfactors,
Size dim = 0);
157reduced_to_full(
const Tensor & reduced,
const Tensor & rmap,
const Tensor & rfactors,
Size dim = 0);
Definition DiagnosticsInterface.cxx:30
TensorOptions default_tensor_options()
Default floating point tensor options.
Definition defaults.cxx:42
Tensor full_to_skew(const Tensor &full, Size dim)
Convert a Tensor from full notation to skew vector notation.
Definition symmetrization.cxx:52
Tensor mandel_to_full(const Tensor &mandel, Size dim)
Convert a Tensor from Mandel notation to full notation.
Definition symmetrization.cxx:42
constexpr std::array< std::array< double, 3 >, 3 > skew_factor
Definition symmetrization.h:48
constexpr std::array< std::array< Size, 3 >, 3 > mandel_reverse_index
Definition symmetrization.h:37
int64_t Size
Definition types.h:65
constexpr std::array< std::array< Size, 2 >, 6 > mandel_index
Definition symmetrization.h:39
TensorOptions default_integer_tensor_options()
Default integral tensor options.
Definition defaults.cxx:60
c10::TensorOptions TensorOptions
Definition types.h:60
constexpr double mandel_factor(Size i)
Definition symmetrization.h:53
Tensor skew_to_full(const Tensor &skew, Size dim)
Convert a Tensor from skew vector notation to full notation.
Definition symmetrization.cxx:62
constexpr std::array< std::array< Size, 3 >, 3 > skew_reverse_index
Definition symmetrization.h:46
constexpr double sqrt2
Definition types.h:93
Tensor full_to_mandel(const Tensor &full, Size dim)
Convert a Tensor from full notation to Mandel notation.
Definition symmetrization.cxx:32