NEML2 1.4.0
Loading...
Searching...
No Matches
Rot.h
1// Copyright 2023, UChicago Argonne, LLC
2// All Rights Reserved
3// Software Name: NEML2 -- the New Engineering material Model Library, version 2
4// By: Argonne National Laboratory
5// OPEN SOURCE LICENSE (MIT)
6//
7// Permission is hereby granted, free of charge, to any person obtaining a copy
8// of this software and associated documentation files (the "Software"), to deal
9// in the Software without restriction, including without limitation the rights
10// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11// copies of the Software, and to permit persons to whom the Software is
12// furnished to do so, subject to the following conditions:
13//
14// The above copyright notice and this permission notice shall be included in
15// all copies or substantial portions of the Software.
16//
17// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23// THE SOFTWARE.
24
25#pragma once
26
27#include "neml2/tensors/VecBase.h"
28
29namespace neml2
30{
31// Forward declarations
32class Scalar;
33class Vec;
34class R2;
35class R3;
36
48class Rot : public VecBase<Rot>
49{
50public:
51 using VecBase<Rot>::VecBase;
52
53 Rot(const Vec & v);
54
56 [[nodiscard]] static Rot
57 identity(const torch::TensorOptions & options = default_tensor_options());
58
60 Rot inverse() const;
61
63 R2 euler_rodrigues() const;
64
66 R3 deuler_rodrigues() const;
67
69 Rot rotate(const Rot & r) const;
70
72 R2 drotate(const Rot & r) const;
73
75 R2 drotate_self(const Rot & r) const;
76
78 Rot shadow() const;
79
81 R2 dshadow() const;
82};
83
85// So this follows the "matrix" convention where it's exactly the same
86// as the standard matrix product R1 * R2 where R1 and R2 are the
87// matrix representations of r1 and r2
88Rot operator*(const Rot & r1, const Rot & r2);
89
90} // namespace neml2
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
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
Base class for the (logical) vector.
Definition VecBase.h:43
The (logical) vector.
Definition Vec.h:42
Definition CrossRef.cxx:32
BatchTensor operator*(const BatchTensor &a, const BatchTensor &b)
Definition BatchTensor.cxx:153
const torch::TensorOptions default_tensor_options()
Definition types.cxx:30