www.mooseframework.org
IsotropicElasticityTensor.C
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 
11 
13  : ElasticityTensor(constant),
14  _lambda_set(false),
15  _mu_set(false),
16  _nu_set(false),
17  _k_set(false),
18  _lambda(0),
19  _mu(0),
20  _nu(0),
21  _k(0)
22 {
23 }
24 
25 void
27 {
28  _lambda = lambda;
29  _lambda_set = true;
30 }
31 
32 void
34 {
35  _mu = mu;
36  _mu_set = true;
37 }
38 
39 void
41 {
42  _E = E;
43  _E_set = true;
44 }
45 
46 void
48 {
49  _nu = nu;
50  _nu_set = true;
51 }
52 
53 void
55 {
56  _k = k;
57  _k_set = true;
58 }
59 
60 void
62 {
63  setMu(k);
64 }
65 
66 void
68 {
69  if (_lambda_set && _mu_set) // First and second Lame
70  return;
71  else if (_lambda_set && _nu_set)
72  _mu = (_lambda * (1.0 - 2.0 * _nu)) / (2.0 * _nu);
73  else if (_lambda_set && _k_set)
74  _mu = (3.0 * (_k - _lambda)) / 2.0;
75  else if (_lambda_set && _E_set)
76  _mu = ((_E - 3.0 * _lambda) / 4.0) +
77  (std::sqrt((_E - 3.0 * _lambda) * (_E - 3.0 * _lambda) + 8.0 * _lambda * _E) / 4.0);
78  else if (_mu_set && _nu_set)
79  _lambda = (2.0 * _mu * _nu) / (1.0 - 2.0 * _nu);
80  else if (_mu_set && _k_set)
81  _lambda = (3.0 * _k - 2.0 * _mu) / 3.0;
82  else if (_mu_set && _E_set)
83  _lambda = ((2.0 * _mu - _E) * _mu) / (_E - 3.0 * _mu);
84  else if (_nu_set && _k_set)
85  {
86  _lambda = (3.0 * _k * _nu) / (1.0 + _nu);
87  _mu = (3.0 * _k * (1.0 - 2.0 * _nu)) / (2.0 * (1.0 + _nu));
88  }
89  else if (_E_set && _nu_set) // Young's Modulus and Poisson's Ratio
90  {
91  _lambda = (_nu * _E) / ((1.0 + _nu) * (1 - 2.0 * _nu));
92  _mu = _E / (2.0 * (1.0 + _nu));
93  }
94  else if (_E_set && _k_set)
95  {
96  _lambda = (3.0 * _k * (3.0 * _k - _E)) / (9.0 * _k - _E);
97  _mu = (3.0 * _E * _k) / (9.0 * _k - _E);
98  }
99  _lambda_set = true;
100  _mu_set = true;
101 }
102 
103 Real
105  const unsigned j,
106  const unsigned k,
107  const unsigned l)
108 {
109  return _lambda * (i == j) * (k == l) + _mu * ((i == k) * (j == l) + (i == l) * (j == k));
110 }
111 
112 void
114 {
116 
117  unsigned int i, j, k, l;
118  i = j = k = l = 0;
119 
120  // Walk down the columns of the 9x9 matrix
121  for (unsigned int q = 0; q < 81; ++q)
122  {
123  // This algorithm was developed by Derek Gaston and Cody Permann
124  // it's based on page 29 of Michael Tonk's notes
125  j += i / 3;
126  k += j / 3;
127  l += k / 3;
128 
129  i %= 3;
130  j %= 3;
131  k %= 3;
132  l %= 3;
133 
134  _values[q] = isotropicEntry(i, j, k, l);
135 
136  ++i;
137  }
138 }
IsotropicElasticityTensor::calculateEntries
virtual void calculateEntries(unsigned int qp)
Fill in the matrix.
Definition: IsotropicElasticityTensor.C:113
IsotropicElasticityTensor::_nu_set
bool _nu_set
Definition: IsotropicElasticityTensor.h:71
IsotropicElasticityTensor::_lambda_set
bool _lambda_set
Definition: IsotropicElasticityTensor.h:71
IsotropicElasticityTensor::_lambda
Real _lambda
Definition: IsotropicElasticityTensor.h:73
IsotropicElasticityTensor::setPoissonsRatio
void setPoissonsRatio(const Real nu)
Set Poissons Ratio.
Definition: IsotropicElasticityTensor.C:47
IsotropicElasticityTensor::setShearModulus
void setShearModulus(const Real k)
Set the shear modulus...
Definition: IsotropicElasticityTensor.C:61
IsotropicElasticityTensor::setYoungsModulus
void setYoungsModulus(const Real E)
Set the Young's Modulus.
Definition: IsotropicElasticityTensor.C:40
IsotropicElasticityTensor::IsotropicElasticityTensor
IsotropicElasticityTensor(const bool constant=true)
Definition: IsotropicElasticityTensor.C:12
IsotropicElasticityTensor.h
ElasticityTensor
This class defines a basic set of capabilities any elasticity tensor should have.
Definition: ElasticityTensor.h:23
IsotropicElasticityTensor::_nu
Real _nu
Definition: IsotropicElasticityTensor.h:73
IsotropicElasticityTensor::setLambda
void setLambda(const Real lambda)
Set the first Lame Coefficient.
Definition: IsotropicElasticityTensor.C:26
IsotropicElasticityTensor::_k
Real _k
Definition: IsotropicElasticityTensor.h:73
IsotropicElasticityTensor::setMu
void setMu(const Real mu)
Set the second Lame Coefficient.
Definition: IsotropicElasticityTensor.C:33
IsotropicElasticityTensor::_mu_set
bool _mu_set
Definition: IsotropicElasticityTensor.h:71
IsotropicElasticityTensor::_E
Real _E
Definition: IsotropicElasticityTensor.h:73
IsotropicElasticityTensor::calculateLameCoefficients
void calculateLameCoefficients()
Calculates lambda and mu based on what has been set.
Definition: IsotropicElasticityTensor.C:67
IsotropicElasticityTensor::setBulkModulus
void setBulkModulus(const Real k)
Set the Bulk Modulus.
Definition: IsotropicElasticityTensor.C:54
IsotropicElasticityTensor::_k_set
bool _k_set
Definition: IsotropicElasticityTensor.h:71
IsotropicElasticityTensor::_mu
Real _mu
Definition: IsotropicElasticityTensor.h:73
IsotropicElasticityTensor::_E_set
bool _E_set
Definition: IsotropicElasticityTensor.h:71
IsotropicElasticityTensor::isotropicEntry
Real isotropicEntry(const unsigned int i, const unsigned j, const unsigned k, const unsigned l)
Computes a single entry of C_ijkl.
Definition: IsotropicElasticityTensor.C:104