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 35 of file AnisotropicElasticityTensor.h.

Constructor & Destructor Documentation

AnisotropicElasticityTensor::AnisotropicElasticityTensor ( )

Definition at line 9 of file AnisotropicElasticityTensor.C.

virtual AnisotropicElasticityTensor::~AnisotropicElasticityTensor ( )
inlinevirtual

Definition at line 40 of file AnisotropicElasticityTensor.h.

40 {}

Member Function Documentation

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 15 of file ElasticityTensor.C.

Referenced by ElasticityTensor::~ElasticityTensor().

16 {
17  if (!_constant || !_values_computed)
18  {
19  calculateEntries(qp);
20  _values_computed = true;
21  }
22 }
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.
ColumnMajorMatrix ElasticityTensor::calculateDerivative ( unsigned int  qp,
unsigned int  i 
)
virtualinherited

Definition at line 25 of file ElasticityTensor.C.

Referenced by ElasticityTensor::~ElasticityTensor().

26 {
27  ColumnMajorMatrix m(9, 9);
28  return m;
29 }
void AnisotropicElasticityTensor::calculateEntries ( unsigned int  qp)
protectedvirtual

Fill in the matrix.

Implements ElasticityTensor.

Definition at line 51 of file AnisotropicElasticityTensor.C.

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

Set the first euler angle.

Definition at line 15 of file AnisotropicElasticityTensor.C.

Referenced by ~AnisotropicElasticityTensor().

16 {
17  _euler_angle[0] = a1;
18 }
void AnisotropicElasticityTensor::setMaterialConstantc11 ( const Real  c11)

Set the material constant c11.

Definition at line 33 of file AnisotropicElasticityTensor.C.

Referenced by ~AnisotropicElasticityTensor().

34 {
35  _c11 = c11;
36 }
void AnisotropicElasticityTensor::setMaterialConstantc12 ( const Real  c12)

Set the material constant c22.

Definition at line 39 of file AnisotropicElasticityTensor.C.

Referenced by ~AnisotropicElasticityTensor().

40 {
41  _c12 = c12;
42 }
void AnisotropicElasticityTensor::setMaterialConstantc44 ( const Real  c44)

Set the material constant c44.

Definition at line 45 of file AnisotropicElasticityTensor.C.

Referenced by ~AnisotropicElasticityTensor().

46 {
47  _c44 = c44;
48 }
void AnisotropicElasticityTensor::setSecondEulerAngle ( const Real  a2)

Set the second euler angle.

Definition at line 21 of file AnisotropicElasticityTensor.C.

Referenced by ~AnisotropicElasticityTensor().

22 {
23  _euler_angle[1] = a2;
24 }
void AnisotropicElasticityTensor::setThirdEulerAngle ( const Real  a3)

Set the third euler angle.

Definition at line 27 of file AnisotropicElasticityTensor.C.

Referenced by ~AnisotropicElasticityTensor().

28 {
29  _euler_angle[2] = a3;
30 }

Member Data Documentation

Real AnisotropicElasticityTensor::_c11
protected

Definition at line 81 of file AnisotropicElasticityTensor.h.

Referenced by calculateEntries(), and setMaterialConstantc11().

Real AnisotropicElasticityTensor::_c12
protected

Definition at line 81 of file AnisotropicElasticityTensor.h.

Referenced by calculateEntries(), and setMaterialConstantc12().

Real AnisotropicElasticityTensor::_c44
protected

Definition at line 81 of file AnisotropicElasticityTensor.h.

Referenced by calculateEntries(), and setMaterialConstantc44().

bool ElasticityTensor::_constant
protectedinherited

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

Definition at line 46 of file ElasticityTensor.h.

Referenced by ElasticityTensor::calculate().

std::vector<Real> AnisotropicElasticityTensor::_euler_angle
protected
bool ElasticityTensor::_values_computed
protectedinherited

Whether or not the values have been computed once.

Definition at line 51 of file ElasticityTensor.h.

Referenced by ElasticityTensor::calculate().


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