www.mooseframework.org
ElasticityTensorTools.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
12 #include "RankFourTensorForward.h"
13 
14 namespace libMesh
15 {
16 template <typename>
17 class VectorValue;
19 }
21 
23 {
24 
30  unsigned int i,
31  unsigned int k,
32  const RealGradient & grad_test,
33  const RealGradient & grad_phi);
34 
41  unsigned int i,
42  unsigned int k,
43  const RealGradient & grad_test,
44  Real phi);
45 
51  unsigned int i,
52  unsigned int k,
53  Real test,
54  const RealGradient & grad_phi);
55 
61 Real
62 momentJacobianWC(const RankFourTensor & r4t, unsigned int i, unsigned int k, Real test, Real phi);
63 
68 template <typename T>
69 T
71 {
72  return elasticity_tensor(0, 1, 0, 1);
73 }
74 
79 template <typename T>
80 T
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 
95 template <typename T>
96 T
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 
112 template <typename T>
113 T
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 
121 void toVoigtNotationIndexConversion(int, int &, int &);
122 
123 template <bool is_ad>
124 void
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 }
typename std::conditional< is_ad, DenseMatrix< ADReal >, DenseMatrix< Real > >::type GenericDenseMatrix
RealVectorValue RealGradient
typename Moose::GenericType< RankFourTensor, is_ad > GenericRankFourTensor
T getIsotropicShearModulus(const RankFourTensorTempl< T > &elasticity_tensor)
Get the shear modulus for an isotropic elasticity tensor param elasticity_tensor the tensor (must be ...
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 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...
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
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...
Real elasticity_tensor(unsigned int i, unsigned int j, unsigned int k, unsigned int l)
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 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...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
T getIsotropicPoissonsRatio(const RankFourTensorTempl< T > &elasticity_tensor)
Get the Poisson&#39;s modulus for an isotropic elasticity tensor param elasticity_tensor the tensor (must...
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
void toVoigtNotation(GenericDenseMatrix< is_ad > &voigt_matrix, const GenericRankFourTensor< is_ad > &tensor)
T getIsotropicYoungsModulus(const RankFourTensorTempl< T > &elasticity_tensor)
Get the Young&#39;s modulus for an isotropic elasticity tensor param elasticity_tensor the tensor (must b...
static const std::string k
Definition: NS.h:124