https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Functions
ElasticityTensorTools Namespace Reference

Functions

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(stress_ij*d(test)/dx_j)/du_k = d(C_ijmn*du_m/dx_n*dtest/dx_j)/du_k.
 
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 rotation) Jacobian entry: d(stress_ij*d(test)/dx_j)/dw_k = d(C_ijmn*eps_mnp*w_p*dtest/dx_j)/dw_k.
 
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 entry: d(eps_ijm*stress_jm*test)/du_k = d(eps_ijm*C_jmln*du_l/dx_n*test)/du_k.
 
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 cosserat rotation) Jacobian entry: d(eps_ijm*stress_jm*test)/dw_k = d(eps_ijm*C_jmln*eps_lnp*w_p*test)/dw_k.
 
template<typename T >
T getIsotropicShearModulus (const RankFourTensorTempl< T > &elasticity_tensor)
 Get the shear modulus for an isotropic elasticity tensor param elasticity_tensor the tensor (must be isotropic, but not checked for efficiency)
 
template<typename T >
T getIsotropicBulkModulus (const RankFourTensorTempl< T > &elasticity_tensor)
 Get the bulk modulus for an isotropic elasticity tensor param elasticity_tensor the tensor (must be isotropic, but not checked for efficiency)
 
template<typename T >
T getIsotropicYoungsModulus (const RankFourTensorTempl< T > &elasticity_tensor)
 Get the Young's modulus for an isotropic elasticity tensor param elasticity_tensor the tensor (must be isotropic, but not checked for efficiency)
 
template<typename T >
T getIsotropicPoissonsRatio (const RankFourTensorTempl< T > &elasticity_tensor)
 Get the Poisson's modulus for an isotropic elasticity tensor param elasticity_tensor the tensor (must be isotropic, but not checked for efficiency)
 
void toVoigtNotationIndexConversion (int, int &, int &)
 
template<bool is_ad>
void toVoigtNotation (GenericDenseMatrix< is_ad > &voigt_matrix, const GenericRankFourTensor< is_ad > &tensor)
 
void toMooseVoigtNotationIndexConversion (int, int &, int &)
 
template<bool is_ad>
void toMooseVoigtNotation (GenericDenseMatrix< is_ad > &voigt_matrix, const GenericRankFourTensor< is_ad > &tensor)
 

Function Documentation

◆ elasticJacobian()

Real ElasticityTensorTools::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(stress_ij*d(test)/dx_j)/du_k = d(C_ijmn*du_m/dx_n*dtest/dx_j)/du_k.

Definition at line 21 of file ElasticityTensorTools.C.

26{
27 // d(stress_ij*d(test)/dx_j)/du_k = d(C_ijmn*du_m/dx_n dtest/dx_j)/du_k (which is nonzero for m ==
28 // k)
29
30 const Real gt0 = grad_test(0);
31 const Real gt1 = grad_test(1);
32 const Real gt2 = grad_test(2);
33 const Real gp0 = grad_phi(0);
34 const Real gp1 = grad_phi(1);
35 const Real gp2 = grad_phi(2);
36
37 // clang-format off
38 // This is the algorithm that is unrolled below:
39 //
40 // Real sum = 0.0;
41 // for (const auto j: make_range(Moose::dim))
42 // for (const auto l: make_range(Moose::dim))
43 // sum += r4t(i, j, k, l) * grad_phi(l) * grad_test(j);
44 // return sum;
45
46 return
47 (
48 r4t(i,0,k,0) * gp0
49 + r4t(i,0,k,1) * gp1
50 + r4t(i,0,k,2) * gp2
51 ) * gt0
52 +
53 (
54 r4t(i,1,k,0) * gp0
55 + r4t(i,1,k,1) * gp1
56 + r4t(i,1,k,2) * gp2
57 ) * gt1
58 +
59 (
60 r4t(i,2,k,0) * gp0
61 + r4t(i,2,k,1) * gp1
62 + r4t(i,2,k,2) * gp2
63 ) * gt2;
64 // clang-format on
65}

Referenced by StressDivergenceRZTensors::calculateJacobian(), StressDivergenceTensors::computeQpJacobian(), CrackTipEnrichmentStressDivergenceTensors::computeQpJacobian(), StressDivergenceTensors::computeQpOffDiagJacobian(), and CrackTipEnrichmentStressDivergenceTensors::computeQpOffDiagJacobian().

◆ elasticJacobianWC()

Real ElasticityTensorTools::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 rotation) Jacobian entry: d(stress_ij*d(test)/dx_j)/dw_k = d(C_ijmn*eps_mnp*w_p*dtest/dx_j)/dw_k.

Definition at line 68 of file ElasticityTensorTools.C.

73{
74 // d(stress_ij*d(test)/dx_j)/dw_k = d(C_ijmn*eps_mnp*w_p*dtest/dx_j)/dw_k (only nonzero for p ==
75 // k)
76 Real sum = 0.0;
77 for (const auto j : make_range(Moose::dim))
78 for (const auto m : make_range(Moose::dim))
79 for (const auto n : make_range(Moose::dim))
80 sum += r4t(i, j, m, n) * PermutationTensor::eps(m, n, k) * grad_test(j);
81 return sum * phi;
82}
for(PetscInt i=0;i< nvars;++i)
unsigned int dim

Referenced by CosseratStressDivergenceTensors::computeQpOffDiagJacobian().

◆ getIsotropicBulkModulus()

template<typename T >
T ElasticityTensorTools::getIsotropicBulkModulus ( const RankFourTensorTempl< T > &  elasticity_tensor)

Get the bulk modulus for an isotropic elasticity tensor param elasticity_tensor the tensor (must be isotropic, but not checked for efficiency)

Definition at line 81 of file ElasticityTensorTools.h.

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}
const double T
T getIsotropicShearModulus(const RankFourTensorTempl< T > &elasticity_tensor)
Get the shear modulus for an isotropic elasticity tensor param elasticity_tensor the tensor (must be ...
Real elasticity_tensor(unsigned int i, unsigned int j, unsigned int k, unsigned int l)

Referenced by ComputeSimoHughesJ2PlasticityStress::computeQpPK1Stress(), and ConstantsFromElasticityTensorTempl< is_ad >::computeQpProperties().

◆ getIsotropicPoissonsRatio()

template<typename T >
T ElasticityTensorTools::getIsotropicPoissonsRatio ( const RankFourTensorTempl< T > &  elasticity_tensor)

Get the Poisson's modulus for an isotropic elasticity tensor param elasticity_tensor the tensor (must be isotropic, but not checked for efficiency)

Definition at line 114 of file ElasticityTensorTools.h.

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}

Referenced by ComputeStrainBaseNOSPD::computeBondStretch(), ParametricMaterialBasePD::computeMaterialConstants(), ConstantsFromElasticityTensorTempl< is_ad >::computeQpProperties(), CappedMohrCoulombStressUpdate::preReturnMapV(), ComputePlaneStressIsotropicElasticityTensor::residualSetup(), ADComputeSmearedCrackingStress::updateCrackingStateAndStress(), and ComputeSmearedCrackingStress::updateCrackingStateAndStress().

◆ getIsotropicShearModulus()

template<typename T >
T ElasticityTensorTools::getIsotropicShearModulus ( const RankFourTensorTempl< T > &  elasticity_tensor)

◆ getIsotropicYoungsModulus()

template<typename T >
T ElasticityTensorTools::getIsotropicYoungsModulus ( const RankFourTensorTempl< T > &  elasticity_tensor)

Get the Young's modulus for an isotropic elasticity tensor param elasticity_tensor the tensor (must be isotropic, but not checked for efficiency)

Definition at line 97 of file ElasticityTensorTools.h.

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}

Referenced by ParametricMaterialBasePD::computeMaterialConstants(), ComputeStrainBaseNOSPD::computeQpDeformationGradient(), ConstantsFromElasticityTensorTempl< is_ad >::computeQpProperties(), ComputePlaneStressIsotropicElasticityTensor::residualSetup(), ADComputeSmearedCrackingStress::updateCrackingStateAndStress(), ComputeSmearedCrackingStress::updateCrackingStateAndStress(), ADComputeSmearedCrackingStress::updateLocalElasticityTensor(), and ComputeSmearedCrackingStress::updateLocalElasticityTensor().

◆ momentJacobian()

Real ElasticityTensorTools::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 entry: d(eps_ijm*stress_jm*test)/du_k = d(eps_ijm*C_jmln*du_l/dx_n*test)/du_k.

Definition at line 85 of file ElasticityTensorTools.C.

90{
91 // Jacobian entry: d(eps_ijm*stress_jm*test)/du_k = d(eps_ijm*C_jmln*du_l/dx_n*test)/du_k (only
92 // nonzero for l == k)
93 Real sum = 0.0;
94 for (const auto j : make_range(Moose::dim))
95 for (const auto m : make_range(Moose::dim))
96 for (const auto n : make_range(Moose::dim))
97 sum += PermutationTensor::eps(i, j, m) * r4t(j, m, k, n) * grad_phi(n);
98 return test * sum;
99}

Referenced by MomentBalancing::computeQpOffDiagJacobian().

◆ momentJacobianWC()

Real ElasticityTensorTools::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 cosserat rotation) Jacobian entry: d(eps_ijm*stress_jm*test)/dw_k = d(eps_ijm*C_jmln*eps_lnp*w_p*test)/dw_k.

Definition at line 102 of file ElasticityTensorTools.C.

103{
104 // Jacobian entry: d(eps_ijm*stress_jm*test)/dw_k = d(eps_ijm*C_jmln*eps_lnp*w_p*test)/dw_k (only
105 // nonzero for p ==k)
106 Real sum = 0.0;
107 for (const auto j : make_range(Moose::dim))
108 for (const auto l : make_range(Moose::dim))
109 for (const auto m : make_range(Moose::dim))
110 for (const auto n : make_range(Moose::dim))
111 sum +=
112 PermutationTensor::eps(i, j, m) * r4t(j, m, l, n) * PermutationTensor::eps(l, n, k);
113
114 return test * phi * sum;
115}

Referenced by MomentBalancing::computeQpJacobian(), and MomentBalancing::computeQpOffDiagJacobian().

◆ toMooseVoigtNotation()

template<bool is_ad>
void ElasticityTensorTools::toMooseVoigtNotation ( GenericDenseMatrix< is_ad > &  voigt_matrix,
const GenericRankFourTensor< is_ad > &  tensor 
)

Definition at line 146 of file ElasticityTensorTools.h.

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 {
157 toMooseVoigtNotationIndexConversion(i, a, b);
158 toMooseVoigtNotationIndexConversion(j, c, d);
159 voigt_matrix(i, j) = tensor(a, b, c, d);
160 }
161}
void ErrorVector unsigned int

◆ toMooseVoigtNotationIndexConversion()

void ElasticityTensorTools::toMooseVoigtNotationIndexConversion ( int  k,
int a,
int b 
)

Definition at line 150 of file ElasticityTensorTools.C.

151{
152 if (k < 3 && k >= 0)
153 a = b = k;
154 else if (k == 3)
155 {
156 a = 0;
157 b = 1;
158 }
159 else if (k == 4)
160 {
161 a = 1;
162 b = 2;
163 }
164 else if (k == 5)
165 {
166 a = 0;
167 b = 2;
168 }
169 else
170 mooseError("\nIndex out of bound while converting from tensor to MOOSE voigt notation in "
171 "toMooseVoigtNotationIndexConversion");
172}
void mooseError(Args &&... args)

Referenced by toMooseVoigtNotation().

◆ toVoigtNotation()

template<bool is_ad>
void ElasticityTensorTools::toVoigtNotation ( GenericDenseMatrix< is_ad > &  voigt_matrix,
const GenericRankFourTensor< is_ad > &  tensor 
)

Definition at line 125 of file ElasticityTensorTools.h.

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 {
136 toVoigtNotationIndexConversion(i, a, b);
137 toVoigtNotationIndexConversion(j, c, d);
138 voigt_matrix(i, j) = tensor(a, b, c, d);
139 }
140}

◆ toVoigtNotationIndexConversion()

void ElasticityTensorTools::toVoigtNotationIndexConversion ( int  k,
int a,
int b 
)

Definition at line 118 of file ElasticityTensorTools.C.

119{
120 if (k < 3 && k >= 0)
121 a = b = k;
122 else if (k == 3)
123 {
124 a = 1;
125 b = 2;
126 }
127 else if (k == 4)
128 {
129 a = 0;
130 b = 2;
131 }
132 else if (k == 5)
133 {
134 a = 0;
135 b = 1;
136 }
137 else
138 mooseError("\nIndex out of bound while converting from tensor to voigt notation in "
139 "toVoigtNotationIndexConversion");
140}

Referenced by toVoigtNotation().