https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ElasticityTensorTools.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
13
14namespace libMesh
15{
16template <typename>
17class VectorValue;
19}
21
23{
24
29Real elasticJacobian(const RankFourTensor & r4t,
30 unsigned int i,
31 unsigned int k,
32 const RealGradient & grad_test,
33 const RealGradient & grad_phi);
34
40Real elasticJacobianWC(const RankFourTensor & r4t,
41 unsigned int i,
42 unsigned int k,
43 const RealGradient & grad_test,
44 Real phi);
45
50Real momentJacobian(const RankFourTensor & r4t,
51 unsigned int i,
52 unsigned int k,
53 Real test,
54 const RealGradient & grad_phi);
55
61Real
62momentJacobianWC(const RankFourTensor & r4t, unsigned int i, unsigned int k, Real test, Real phi);
63
68template <typename T>
69T
71{
72 return elasticity_tensor(0, 1, 0, 1);
73}
74
79template <typename T>
80T
82{
83 const T shear_modulus = getIsotropicShearModulus(elasticity_tensor);
84 // dilatational modulus is defined as lambda plus two mu
85 const T dilatational_modulus = elasticity_tensor(0, 0, 0, 0);
86 const T lambda = dilatational_modulus - 2.0 * shear_modulus;
87 const T bulk_modulus = lambda + 2.0 * shear_modulus / 3.0;
88 return bulk_modulus;
89}
90
95template <typename T>
96T
98{
99 const T shear_modulus = getIsotropicShearModulus(elasticity_tensor);
100 // dilatational modulus is defined as lambda plus two mu
101 const T dilatational_modulus = elasticity_tensor(0, 0, 0, 0);
102 const T lambda = dilatational_modulus - 2.0 * shear_modulus;
103 const T youngs_modulus =
104 shear_modulus * (3.0 * lambda + 2.0 * shear_modulus) / (lambda + shear_modulus);
105 return youngs_modulus;
106}
107
112template <typename T>
113T
115{
116 const T poissons_ratio = elasticity_tensor(1, 1, 0, 0) /
117 (elasticity_tensor(1, 1, 1, 1) + elasticity_tensor(1, 1, 0, 0));
118 return poissons_ratio;
119}
120
121void toVoigtNotationIndexConversion(int, int &, int &);
122
123template <bool is_ad>
124void
126 const GenericRankFourTensor<is_ad> & tensor)
127{
128 std::vector<int> index_vector = {0, 1, 2, 3, 4, 5};
129 int a = 0;
130 int b = 0;
131 int c = 0;
132 int d = 0;
133 for (int i : index_vector)
134 for (int j : index_vector)
135 {
138 voigt_matrix(i, j) = tensor(a, b, c, d);
139 }
140}
141
142void toMooseVoigtNotationIndexConversion(int, int &, int &);
143
144template <bool is_ad>
145void
147 const GenericRankFourTensor<is_ad> & tensor)
148{
149 static std::vector<int> index_vector = {0, 1, 2, 3, 4, 5};
150 int a = 0;
151 int b = 0;
152 int c = 0;
153 int d = 0;
154 for (int i : index_vector)
155 for (int j : index_vector)
156 {
159 voigt_matrix(i, j) = tensor(a, b, c, d);
160 }
161}
162}
const double T
Moose::GenericType< RankFourTensor, is_ad > GenericRankFourTensor
Moose::GenericType< DenseMatrix< Real >, is_ad > GenericDenseMatrix
void toVoigtNotationIndexConversion(int, int &, int &)
Real momentJacobian(const RankFourTensor &r4t, unsigned int i, unsigned int k, Real test, const RealGradient &grad_phi)
This is used for the moment-balancing kernel eps_ijk*stress_jk*test, when varied wrt u_k Jacobian ent...
T getIsotropicYoungsModulus(const RankFourTensorTempl< T > &elasticity_tensor)
Get the Young's modulus for an isotropic elasticity tensor param elasticity_tensor the tensor (must b...
Real elasticJacobianWC(const RankFourTensor &r4t, unsigned int i, unsigned int k, const RealGradient &grad_test, Real phi)
This is used for the standard kernel stress_ij*d(test)/dx_j, when varied wrt w_k (the cosserat rotati...
Real elasticJacobian(const RankFourTensor &r4t, unsigned int i, unsigned int k, const RealGradient &grad_test, const RealGradient &grad_phi)
This is used for the standard kernel stress_ij*d(test)/dx_j, when varied wrt u_k Jacobian entry: d(st...
T getIsotropicPoissonsRatio(const RankFourTensorTempl< T > &elasticity_tensor)
Get the Poisson's modulus for an isotropic elasticity tensor param elasticity_tensor the tensor (must...
Real momentJacobianWC(const RankFourTensor &r4t, unsigned int i, unsigned int k, Real test, Real phi)
This is used for the moment-balancing kernel eps_ijk*stress_jk*test, when varied wrt w_k (the cossera...
T getIsotropicBulkModulus(const RankFourTensorTempl< T > &elasticity_tensor)
Get the bulk modulus for an isotropic elasticity tensor param elasticity_tensor the tensor (must be i...
void toVoigtNotation(GenericDenseMatrix< is_ad > &voigt_matrix, const GenericRankFourTensor< is_ad > &tensor)
void toMooseVoigtNotationIndexConversion(int, int &, int &)
void toMooseVoigtNotation(GenericDenseMatrix< is_ad > &voigt_matrix, const GenericRankFourTensor< is_ad > &tensor)
T getIsotropicShearModulus(const RankFourTensorTempl< T > &elasticity_tensor)
Get the shear modulus for an isotropic elasticity tensor param elasticity_tensor the tensor (must be ...
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
RealVectorValue RealGradient
Real elasticity_tensor(unsigned int i, unsigned int j, unsigned int k, unsigned int l)