25#include "neml2/tensors/Rot.h"
26#include "neml2/tensors/Scalar.h"
27#include "neml2/tensors/Vec.h"
28#include "neml2/tensors/R2.h"
29#include "neml2/tensors/SR2.h"
30#include "neml2/tensors/R3.h"
31#include "neml2/tensors/R4.h"
32#include "neml2/tensors/SSR4.h"
33#include "neml2/tensors/WR2.h"
73 return 8.0 * (
rr - 3.0) /
math::pow(1.0 +
rr, 3.0) *
R3(torch::einsum(
"...ij,...k", {W, *
this})) -
74 32.0 /
math::pow(1 +
rr, 3.0) *
R3(torch::einsum(
"...ij,...k", {(W * W), *
this})) -
75 4.0 * (1 -
rr) /
math::pow(1.0 +
rr, 2.0) *
R3(torch::einsum(
"...kij->...ijk", {
E})) -
77 R3(torch::einsum(
"...kim,...mj", {
E, W}) + torch::einsum(
"...im,...kmj", {W,
E}));
92 auto rr1 =
r1.norm_sq();
93 auto rr2 =
r2.norm_sq();
108 auto rr1 =
r1.norm_sq();
109 auto rr2 =
r2.norm_sq();
121 return -*
this / this->
norm_sq();
135 auto rr1 =
r1.norm_sq();
136 auto rr2 =
r2.norm_sq();
Definition BatchTensor.h:32
The wrapper (decorator) for cross-referencing unresolved values at parse time.
Definition CrossRef.h:52
static Derived zeros(const torch::TensorOptions &options=default_tensor_options())
Unbatched zero tensor.
Definition FixedDimTensor.h:145
static R2 identity(const torch::TensorOptions &options=default_tensor_options())
Identity.
Definition R2Base.cxx:170
static R2 skew(const Vec &v)
Skew matrix from Vec.
Definition R2Base.cxx:158
A basic R2.
Definition R2.h:42
The (logical) full third order tensor.
Definition R3.h:41
static R3 levi_civita(const torch::TensorOptions &options=default_tensor_options())
Alternating symbol.
Definition R3.cxx:33
Rotation stored as modified Rodrigues parameters.
Definition Rot.h:49
Rot rotate(const Rot &r) const
Rotate.
Definition Rot.cxx:81
R3 deuler_rodrigues() const
d(R2)/d(r) – useful in constructing other derivatives
Definition Rot.cxx:66
Rot shadow() const
Return the shadow parameter set (a set of MRPs that define the same orientation)
Definition Rot.cxx:119
R2 dshadow() const
Return the derivative of the shadow map.
Definition Rot.cxx:125
static Rot identity(const torch::TensorOptions &options=default_tensor_options())
The identity rotation, helpfully the zero vector.
Definition Rot.cxx:43
R2 euler_rodrigues() const
Generate a rotation matrix using the Euler-Rodrigues formula.
Definition Rot.cxx:55
R2 drotate_self(const Rot &r) const
Derivative of the rotated Rodrigues vector w.r.t. this vector.
Definition Rot.cxx:103
Rot inverse() const
Inversion.
Definition Rot.cxx:49
Rot(const Vec &v)
Definition Rot.cxx:37
R2 drotate(const Rot &r) const
Derivative of the rotated Rodrigues vector w.r.t. the other Rodrigues vector.
Definition Rot.cxx:87
R2 outer(const VecBase< Derived2 > &v) const
outer product
Definition VecBase.h:119
Scalar norm_sq() const
Norm squared.
Definition VecBase.cxx:64
The (logical) vector.
Definition Vec.h:42
Derived pow(const Derived &a, const Real &n)
Definition BatchTensorBase.h:332
Definition CrossRef.cxx:32
BatchTensor operator*(const BatchTensor &a, const BatchTensor &b)
Definition BatchTensor.cxx:153