25#include "neml2/misc/math.h"
26#include "neml2/tensors/R4.h"
27#include "neml2/tensors/Scalar.h"
28#include "neml2/tensors/R2.h"
29#include "neml2/tensors/R3.h"
30#include "neml2/tensors/SSR4.h"
31#include "neml2/tensors/R5.h"
32#include "neml2/tensors/Rot.h"
33#include "neml2/tensors/WWR4.h"
38 :
R4(math::mandel_to_full(math::mandel_to_full(T, 1)))
43 :
R4(math::skew_to_full(math::skew_to_full(T, 1)))
50 R2 R =
r.euler_rodrigues();
53 auto res = torch::einsum(
"...im,...jn,...ko,...lp,...mnop", {
R,
R,
R,
R, *
this});
60 R2 R =
r.euler_rodrigues();
61 R3 F =
r.deuler_rodrigues();
64 auto res1 = torch::einsum(
"...jn,...ko,...lp,...mnop,...imt->...ijklt", {
R,
R,
R, *
this,
F});
65 auto res2 = torch::einsum(
"...im,...ko,...lp,...mnop,...jnt->...ijklt", {
R,
R,
R, *
this,
F});
66 auto res3 = torch::einsum(
"...im,...jn,...lp,...mnop,...kot->...ijklt", {
R,
R,
R, *
this,
F});
67 auto res4 = torch::einsum(
"...im,...jn,...ko,...mnop,...lpt->...ijklt", {
R,
R,
R, *
this,
F});
BatchTensor base_transpose(TorchSize d1, TorchSize d2) const
Transpose two base dimensions.
Definition BatchTensorBase.cxx:299
BatchTensor base_index(const TorchSlice &indices) const
Return an index sliced on the base dimensions.
Definition BatchTensorBase.cxx:193
The wrapper (decorator) for cross-referencing unresolved values at parse time.
Definition CrossRef.h:52
A basic R2.
Definition R2.h:42
The (logical) full third order tensor.
Definition R3.h:41
The (logical) full fourth order tensor.
Definition R4.h:43
R4 rotate(const Rot &r) const
Rotate.
Definition R4.cxx:48
R4(const SSR4 &T)
Definition R4.cxx:37
R4 transpose(TorchSize d1, TorchSize d2) const
Arbitrary transpose two dimensions.
Definition R4.cxx:80
R4 transpose_major() const
Transpose major axes.
Definition R4.cxx:92
Scalar operator()(TorchSize i, TorchSize j, TorchSize k, TorchSize l) const
Accessor.
Definition R4.cxx:74
R4 transpose_minor() const
Transpose minor axes.
Definition R4.cxx:86
R5 drotate(const Rot &r) const
Derivative of the rotated tensor w.r.t. the Rodrigues vector.
Definition R4.cxx:58
The (logical) full fifth order tensor.
Definition R5.h:37
Rotation stored as modified Rodrigues parameters.
Definition Rot.h:49
The (logical) symmetric fourth order tensor, with symmetry in the first two dimensionss as well as in...
Definition SSR4.h:44
The (logical) scalar.
Definition Scalar.h:38
The (logical) symmetric fourth order tensor, with skew symmetry in the first two dimensions and last ...
Definition WWR4.h:40
Definition CrossRef.cxx:32
int64_t TorchSize
Definition types.h:35
void neml_assert_batch_broadcastable_dbg(T &&...)
A helper function to assert that (in Debug mode) all tensors are batch-broadcastable.
TorchSize broadcast_batch_dim(T &&...)
The batch dimension after broadcasting.