www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
AnisotropicElasticityTensor Class Reference

Defines an Isotropic Elasticity Tensor. More...

#include <AnisotropicElasticityTensor.h>

Inheritance diagram for AnisotropicElasticityTensor:
[legend]

Public Member Functions

 AnisotropicElasticityTensor ()
 
virtual ~AnisotropicElasticityTensor ()
 
void setFirstEulerAngle (const Real a1)
 Set the first euler angle. More...
 
void setSecondEulerAngle (const Real a2)
 Set the second euler angle. More...
 
void setThirdEulerAngle (const Real a3)
 Set the third euler angle. More...
 
void setMaterialConstantc11 (const Real c11)
 Set the material constant c11. More...
 
void setMaterialConstantc12 (const Real c12)
 Set the material constant c22. More...
 
void setMaterialConstantc44 (const Real c44)
 Set the material constant c44. More...
 
void calculate (unsigned int qp)
 Public function that will be called whenever the values for this matrix need to be filled in. More...
 
virtual ColumnMajorMatrix calculateDerivative (unsigned int qp, unsigned int i)
 

Protected Member Functions

virtual void calculateEntries (unsigned int qp)
 Fill in the matrix. More...
 

Protected Attributes

std::vector< Real > _euler_angle
 
Real _c11
 
Real _c12
 
Real _c44
 
bool _constant
 Whether or not the matrix is constant for all of time and space. More...
 
bool _values_computed
 Whether or not the values have been computed once. More...
 

Detailed Description

Defines an Isotropic Elasticity Tensor.

The input is any two of the following:

Youngs Modulus Poissons Ration First and Second Lame Coefficients (lambda and mu) Bulk Modulus

Internally this class uses the Lame Coefficients. Everything is is transformed to these coefficients.

Note that by default this tensor is constant... meaning that it never changes after the first time it is computed.

If you want to modify this behavior you can pass in false to the constructor.

Definition at line 38 of file AnisotropicElasticityTensor.h.

Constructor & Destructor Documentation

◆ AnisotropicElasticityTensor()

AnisotropicElasticityTensor::AnisotropicElasticityTensor ( )

Definition at line 12 of file AnisotropicElasticityTensor.C.

◆ ~AnisotropicElasticityTensor()

virtual AnisotropicElasticityTensor::~AnisotropicElasticityTensor ( )
inlinevirtual

Definition at line 43 of file AnisotropicElasticityTensor.h.

43 {}

Member Function Documentation

◆ calculate()

void ElasticityTensor::calculate ( unsigned int  qp)
inherited

Public function that will be called whenever the values for this matrix need to be filled in.

Definition at line 18 of file ElasticityTensor.C.

19 {
20  if (!_constant || !_values_computed)
21  {
22  calculateEntries(qp);
23  _values_computed = true;
24  }
25 }
virtual void calculateEntries(unsigned int qp)=0
Pure virtual (must be overriden by derived class).
bool _values_computed
Whether or not the values have been computed once.
bool _constant
Whether or not the matrix is constant for all of time and space.

◆ calculateDerivative()

ColumnMajorMatrix ElasticityTensor::calculateDerivative ( unsigned int  qp,
unsigned int  i 
)
virtualinherited

Definition at line 28 of file ElasticityTensor.C.

29 {
30  ColumnMajorMatrix m(9, 9);
31  return m;
32 }

◆ calculateEntries()

void AnisotropicElasticityTensor::calculateEntries ( unsigned int  qp)
protectedvirtual

Fill in the matrix.

Implements ElasticityTensor.

Definition at line 54 of file AnisotropicElasticityTensor.C.

55 {
56 
57  // form_r_matrix();
58  // Form rotation matrix from Euler angles
59  const Real phi1 = _euler_angle[0] * (M_PI / 180.0);
60  const Real phi = _euler_angle[1] * (M_PI / 180.0);
61  const Real phi2 = _euler_angle[2] * (M_PI / 180.0);
62 
63  Real cp1 = cos(phi1);
64  Real cp2 = cos(phi2);
65  Real cp = cos(phi);
66 
67  Real sp1 = sin(phi1);
68  Real sp2 = sin(phi2);
69  Real sp = sin(phi);
70 
71  DenseMatrix<Real> R; // Rotational Matrix
72  R(0, 0) = cp1 * cp2 - sp1 * sp2 * cp;
73  R(0, 1) = sp1 * cp2 + cp1 * sp2 * cp;
74  R(0, 2) = sp2 * sp;
75  R(1, 0) = -cp1 * sp2 - sp1 * cp2 * cp;
76  R(1, 1) = -sp1 * sp2 + cp1 * cp2 * cp;
77  R(1, 2) = cp2 * sp;
78  R(2, 0) = sp1 * sp;
79  R(2, 1) = -cp1 * sp;
80  R(2, 2) = cp;
81 
82  // Initialize material Dt matrix
83  DenseMatrix<Real> Dt; // 6 x 6 Material Matrix
84  Dt(0, 0) = Dt(1, 1) = Dt(2, 2) = _c11;
85  Dt(0, 1) = Dt(0, 2) = Dt(1, 0) = Dt(2, 0) = Dt(1, 2) = Dt(2, 1) = _c12;
86  Dt(3, 3) = Dt(4, 4) = Dt(5, 5) = 2 * _c44;
87 
88  // Form Q = R dyadic R and Q transpose
89  DenseMatrix<Real> Q, Qt; // Q = R (dyadic) R and Q transpose
90  for (unsigned int i = 0; i < 3; i++)
91  for (unsigned int j = 0; j < 3; j++)
92  for (unsigned int k = 0; k < 3; k++)
93  for (unsigned int l = 0; l < 3; l++)
94  Q(((i * 3) + k), ((j * 3) + l)) = R(i, j) * R(k, l);
95 
96  for (unsigned int p = 0; p < 9; p++)
97  for (unsigned int q = 0; q < 9; q++)
98  Qt(q, p) = Q(p, q);
99 
100  // Form two kinds of transformation matrix
101  // TransD6toD9 transfroms Dt[6][6] to Dmat[9][9]
102  // TransD9toD6 transforms Dmat[9][9] to Dt[6][6]
103  DenseMatrix<Real> trans_d6_to_d9, transpose_trans_d6_to_d9;
104  DenseMatrix<Real> trans_d9_to_d6, transpose_trans_d9_to_d6;
105  Real sqrt2 = std::sqrt(2.0);
106  Real a = 1 / sqrt2;
107 
108  trans_d6_to_d9(0, 0) = trans_d6_to_d9(4, 1) = trans_d6_to_d9(8, 2) = 1.0;
109  trans_d6_to_d9(1, 3) = trans_d6_to_d9(3, 3) = a;
110  trans_d6_to_d9(2, 4) = trans_d6_to_d9(6, 4) = a;
111  trans_d6_to_d9(5, 5) = trans_d6_to_d9(7, 5) = a;
112 
113  for (unsigned int i = 0; i < 9; i++)
114  for (unsigned int j = 0; j < 6; j++)
115  transpose_trans_d6_to_d9(j, i) = trans_d6_to_d9(i, j);
116 
117  trans_d9_to_d6(0, 0) = trans_d9_to_d6(1, 4) = trans_d9_to_d6(2, 8) = 1.0;
118  trans_d9_to_d6(3, 3) = trans_d9_to_d6(4, 6) = trans_d9_to_d6(5, 7) = sqrt2;
119 
120  for (unsigned int i = 0; i < 6; i++)
121  for (unsigned int j = 0; j < 9; j++)
122  transpose_trans_d9_to_d6(j, i) = trans_d9_to_d6(i, j);
123 
124  // The function makes use of TransD6toD9 matrix to transfrom Dt[6][6] to Dmat[9][9]
125  // Dmat = T * Dt * TT
126 
127  DenseMatrix<Real> outputMatrix(9, 6);
128 
129  outputMatrix = trans_d6_to_d9;
130  outputMatrix.right_multiply(Dt);
131 
132  DenseMatrix<Real> Dmat; // 9 x 9 Material Matrix
133  Dmat = outputMatrix;
134  Dmat.right_multiply(transpose_trans_d6_to_d9);
135 
136  // The function makes use of Q matrix to rotate Dmat[9][9] to QDmat[9][9]
137  // QDmat = QT * Dmat * Q
138 
139  DenseMatrix<Real> outputMatrix99(9, 9);
140 
141  outputMatrix99 = Qt;
142  outputMatrix99.right_multiply(Dmat);
143 
144  DenseMatrix<Real> QDmat; // Rotated Material Matrix
145  QDmat = outputMatrix99;
146  QDmat.right_multiply(Q);
147 
148  // Convert 9X9 matrix QDmat to 81 vector
149 
150  unsigned int count = 0;
151 
152  for (unsigned int j = 0; j < 9; j++)
153  for (unsigned int i = 0; i < 9; i++)
154  {
155  _values[count] = QDmat(i, j);
156  count = count + 1;
157  }
158 }

◆ setFirstEulerAngle()

void AnisotropicElasticityTensor::setFirstEulerAngle ( const Real  a1)

Set the first euler angle.

Definition at line 18 of file AnisotropicElasticityTensor.C.

19 {
20  _euler_angle[0] = a1;
21 }

◆ setMaterialConstantc11()

void AnisotropicElasticityTensor::setMaterialConstantc11 ( const Real  c11)

Set the material constant c11.

Definition at line 36 of file AnisotropicElasticityTensor.C.

37 {
38  _c11 = c11;
39 }

◆ setMaterialConstantc12()

void AnisotropicElasticityTensor::setMaterialConstantc12 ( const Real  c12)

Set the material constant c22.

Definition at line 42 of file AnisotropicElasticityTensor.C.

43 {
44  _c12 = c12;
45 }

◆ setMaterialConstantc44()

void AnisotropicElasticityTensor::setMaterialConstantc44 ( const Real  c44)

Set the material constant c44.

Definition at line 48 of file AnisotropicElasticityTensor.C.

49 {
50  _c44 = c44;
51 }

◆ setSecondEulerAngle()

void AnisotropicElasticityTensor::setSecondEulerAngle ( const Real  a2)

Set the second euler angle.

Definition at line 24 of file AnisotropicElasticityTensor.C.

25 {
26  _euler_angle[1] = a2;
27 }

◆ setThirdEulerAngle()

void AnisotropicElasticityTensor::setThirdEulerAngle ( const Real  a3)

Set the third euler angle.

Definition at line 30 of file AnisotropicElasticityTensor.C.

31 {
32  _euler_angle[2] = a3;
33 }

Member Data Documentation

◆ _c11

Real AnisotropicElasticityTensor::_c11
protected

Definition at line 84 of file AnisotropicElasticityTensor.h.

Referenced by calculateEntries(), and setMaterialConstantc11().

◆ _c12

Real AnisotropicElasticityTensor::_c12
protected

Definition at line 84 of file AnisotropicElasticityTensor.h.

Referenced by calculateEntries(), and setMaterialConstantc12().

◆ _c44

Real AnisotropicElasticityTensor::_c44
protected

Definition at line 84 of file AnisotropicElasticityTensor.h.

Referenced by calculateEntries(), and setMaterialConstantc44().

◆ _constant

bool ElasticityTensor::_constant
protectedinherited

Whether or not the matrix is constant for all of time and space.

Definition at line 49 of file ElasticityTensor.h.

Referenced by ElasticityTensor::calculate().

◆ _euler_angle

std::vector<Real> AnisotropicElasticityTensor::_euler_angle
protected

◆ _values_computed

bool ElasticityTensor::_values_computed
protectedinherited

Whether or not the values have been computed once.

Definition at line 54 of file ElasticityTensor.h.

Referenced by ElasticityTensor::calculate().


The documentation for this class was generated from the following files: