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#include "neml2/tensors/DTensor.h"
29
30namespace neml2
31{
32class Scalar;
33class SR2;
34class R4;
35class Rot;
36
43class SSR4 : public PrimitiveTensor<SSR4, 6, 6>
44{
45public:
47
49 SSR4(const R4 & T);
50
52 [[nodiscard]] static SSR4 identity(const TensorOptions & options = default_tensor_options());
54 static SSR4 identity_sym(const TensorOptions & options = default_tensor_options());
56 static SSR4 identity_vol(const TensorOptions & options = default_tensor_options());
58 static SSR4 identity_dev(const TensorOptions & options = default_tensor_options());
59
61 static SSR4 identity_C1(const TensorOptions & options = default_tensor_options());
63 static SSR4 identity_C2(const TensorOptions & options = default_tensor_options());
65 static SSR4 identity_C3(const TensorOptions & options = default_tensor_options());
66
68 static SSR4 isotropic_E_nu(const Scalar & E, const Scalar & nu);
70 static SSR4 isotropic_E_nu(const double & E,
71 const double & nu,
72 const TensorOptions & options = default_tensor_options());
73
75 static SSR4 fill_C1_C2_C3(const Scalar & C1, const Scalar & C2, const Scalar & C3);
77 static SSR4 fill_C1_C2_C3(const double & C1,
78 const double & C2,
79 const double & C3,
80 const TensorOptions & options = default_tensor_options());
81
83 SSR4 rotate(const Rot & r) const;
84
87
90
92 Scalar operator()(Size i, Size j, Size k, Size l) const;
93
95 SSR4 transpose_minor() const;
96
98 SSR4 transpose_major() const;
99};
100
101SSR4 operator*(const SSR4 & a, const SSR4 & b);
102SR2 operator*(const SSR4 & a, const SR2 & b);
103} // namespace neml2
Abstract representation of the derivative of a primitive tensor with respect to another primitive ten...
Definition DTensor.h:67
PrimitiveTensor inherits from TensorBase and additionally templates on the base shape.
Definition PrimitiveTensor.h:51
Fourth order tensor without symmetry.
Definition R4.h:43
Rotation stored as modified Rodrigues parameters.
Definition Rot.h:49
The symmetric second order tensor.
Definition SR2.h:46
The symmetric fourth order tensor, with symmetry in the first two dimensionss as well as in the last ...
Definition SSR4.h:44
SSR4 transpose_minor() const
Transpose minor axes, no-op.
Definition SSR4.cxx:191
DTensor< SSR4, Rot, neml2::Tensor > drotate(const Rot &r) const
Derivative of the rotated tensor w.r.t. the Rodrigues vector.
Definition SSR4.cxx:163
Scalar operator()(Size i, Size j, Size k, Size l) const
Accessor.
Definition SSR4.cxx:183
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:139
static SSR4 identity_C3(const TensorOptions &options=default_tensor_options())
Building block for C3 constant.
Definition SSR4.cxx:88
SSR4(const R4 &T)
Initialize with the symmetrized fourth order tensor.
Definition SSR4.cxx:40
static SSR4 identity_vol(const TensorOptions &options=default_tensor_options())
Create the volumetric identity tensor .
Definition SSR4.cxx:107
static SSR4 identity(const TensorOptions &options=default_tensor_options())
Create the identity tensor .
Definition SSR4.cxx:49
DTensor< SSR4, SSR4, neml2::Tensor > drotate_self(const Rot &r) const
Derivative of the rotated tensor w.r.t. itself.
Definition SSR4.cxx:170
static SSR4 identity_C2(const TensorOptions &options=default_tensor_options())
Building block for C2 constant.
Definition SSR4.cxx:75
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:119
static SSR4 identity_C1(const TensorOptions &options=default_tensor_options())
Building block for C1 constant.
Definition SSR4.cxx:62
SSR4 rotate(const Rot &r) const
Rotate.
Definition SSR4.cxx:157
static SSR4 identity_sym(const TensorOptions &options=default_tensor_options())
Create the symmetric identity tensor .
Definition SSR4.cxx:101
SSR4 transpose_major() const
Transpose major axes.
Definition SSR4.cxx:197
static SSR4 identity_dev(const TensorOptions &options=default_tensor_options())
Create the deviatoric identity tensor .
Definition SSR4.cxx:113
Scalar.
Definition Scalar.h:38
Definition DiagnosticsInterface.cxx:30
TensorOptions default_tensor_options()
Default floating point tensor options.
Definition defaults.cxx:42
Tensor operator*(const Tensor &a, const Tensor &b)
Definition operators.cxx:171
int64_t Size
Definition types.h:65
c10::TensorOptions TensorOptions
Definition types.h:60