NEML2 2.0.0
Loading...
Searching...
No Matches
SSR4.h
1// Copyright 2024, 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/PrimitiveTensor.h"
28
29namespace neml2
30{
31class Scalar;
32class SR2;
33class R4;
34class SSFR5;
35class Rot;
36class SSSSR8;
37
44class SSR4 : public PrimitiveTensor<SSR4, 6, 6>
45{
46public:
48
50 SSR4(const R4 & T);
51
53 [[nodiscard]] static SSR4
54 identity(const torch::TensorOptions & options = default_tensor_options());
56 static SSR4 identity_sym(const torch::TensorOptions & options = default_tensor_options());
58 static SSR4 identity_vol(const torch::TensorOptions & options = default_tensor_options());
60 static SSR4 identity_dev(const torch::TensorOptions & options = default_tensor_options());
61
63 static SSR4 identity_C1(const torch::TensorOptions & options = default_tensor_options());
65 static SSR4 identity_C2(const torch::TensorOptions & options = default_tensor_options());
67 static SSR4 identity_C3(const torch::TensorOptions & options = default_tensor_options());
68
70 static SSR4 isotropic_E_nu(const Scalar & E, const Scalar & nu);
72 static SSR4 isotropic_E_nu(const Real & E,
73 const Real & nu,
74 const torch::TensorOptions & options = default_tensor_options());
75
77 static SSR4 fill_C1_C2_C3(const Scalar & C1, const Scalar & C2, const Scalar & C3);
79 static SSR4 fill_C1_C2_C3(const Real & C1,
80 const Real & C2,
81 const Real & C3,
82 const torch::TensorOptions & options = default_tensor_options());
83
85 [[nodiscard]] static SSSSR8
86 identity_map(const torch::TensorOptions & options = default_tensor_options());
87
89 SSR4 rotate(const Rot & r) const;
90
92 SSFR5 drotate(const Rot & r) const;
93
95 SSSSR8 drotate_self(const Rot & r) const;
96
98 Scalar operator()(Size i, Size j, Size k, Size l) const;
99
101 SSR4 inverse() const;
102
104 SSSSR8 dinverse() const;
105
107 SSR4 transpose_minor() const;
108
110 SSR4 transpose_major() const;
111};
112
113SR2 operator*(const SSR4 & a, const SR2 & b);
114SR2 operator*(const SR2 & a, const SSR4 & b);
115SSR4 operator*(const SSR4 & a, const SSR4 & b);
116} // namespace neml2
The wrapper (decorator) for cross-referencing unresolved values at parse time.
Definition CrossRef.h:54
PrimitiveTensor inherits from TensorBase and additionally templates on the base shape.
Definition PrimitiveTensor.h:38
PrimitiveTensor()=default
Default constructor.
Fourth order tensor without symmetry.
Definition R4.h:44
Rotation stored as modified Rodrigues parameters.
Definition Rot.h:49
The symmetric second order tensor.
Definition SR2.h:46
The fifth order tensor with minor symmetry in the 1st and 2nd dimensions as well as in the 3rd and 4t...
Definition SSFR5.h:38
The symmetric fourth order tensor, with symmetry in the first two dimensionss as well as in the last ...
Definition SSR4.h:45
static SSSSR8 identity_map(const torch::TensorOptions &options=default_tensor_options())
The derivative of a SSR4 with respect to itself.
Definition SSR4.cxx:156
SSFR5 drotate(const Rot &r) const
Derivative of the rotated tensor w.r.t. the Rodrigues vector.
Definition SSR4.cxx:169
static SSR4 identity_C1(const torch::TensorOptions &options=default_tensor_options())
Building block for C1 constant.
Definition SSR4.cxx:61
static SSR4 identity_C2(const torch::TensorOptions &options=default_tensor_options())
Building block for C2 constant.
Definition SSR4.cxx:74
SSR4 transpose_minor() const
Transpose minor axes, no-op.
Definition SSR4.cxx:211
static SSR4 identity_dev(const torch::TensorOptions &options=default_tensor_options())
Create the deviatoric identity tensor .
Definition SSR4.cxx:112
static SSR4 identity(const torch::TensorOptions &options=default_tensor_options())
Create the identity tensor .
Definition SSR4.cxx:48
static SSR4 identity_C3(const torch::TensorOptions &options=default_tensor_options())
Building block for C3 constant.
Definition SSR4.cxx:87
Scalar operator()(Size i, Size j, Size k, Size l) const
Accessor.
Definition SSR4.cxx:190
SSSSR8 drotate_self(const Rot &r) const
Derivative of the rotated tensor w.r.t. itself.
Definition SSR4.cxx:176
static SSR4 fill_C1_C2_C3(const Scalar &C1, const Scalar &C2, const Scalar &C3)
Create the fourth order elasticity tensor given the three non-zero coefficients.
Definition SSR4.cxx:138
static SSR4 identity_sym(const torch::TensorOptions &options=default_tensor_options())
Create the symmetric identity tensor .
Definition SSR4.cxx:100
SSR4(const R4 &T)
Initialize with the symmetrized fourth order tensor.
Definition SSR4.cxx:39
static SSR4 identity_vol(const torch::TensorOptions &options=default_tensor_options())
Create the volumetric identity tensor .
Definition SSR4.cxx:106
SSSSR8 dinverse() const
Derivative of inverse with respect to self.
Definition SSR4.cxx:204
static SSR4 isotropic_E_nu(const Scalar &E, const Scalar &nu)
Create the fourth order elasticity tensor given the Young's modulus and the Poisson's ratio.
Definition SSR4.cxx:118
SSR4 rotate(const Rot &r) const
Rotate.
Definition SSR4.cxx:163
SSR4 transpose_major() const
Transpose major axes.
Definition SSR4.cxx:217
SSR4 inverse() const
Inversion.
Definition SSR4.cxx:198
The logical eigth order tensor with minor symmetry in the 1st and 2nd dimensions, the 3rd and 4th dim...
Definition SSSSR8.h:38
Scalar.
Definition Scalar.h:38
Definition CrossRef.cxx:31
Vec operator*(const Derived1 &A, const Derived2 &b)
matrix-vector product
Definition R2Base.cxx:233
torch::TensorOptions & default_tensor_options()
Definition types.cxx:157
double Real
Definition types.h:31
int64_t Size
Definition types.h:33