www.mooseframework.org
AnisotropicElasticityTensor.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(false), _euler_angle(3), _c11(0), _c12(0), _c44(0)
14 {
15 }
16 
17 void
19 {
20  _euler_angle[0] = a1;
21 }
22 
23 void
25 {
26  _euler_angle[1] = a2;
27 }
28 
29 void
31 {
32  _euler_angle[2] = a3;
33 }
34 
35 void
37 {
38  _c11 = c11;
39 }
40 
41 void
43 {
44  _c12 = c12;
45 }
46 
47 void
49 {
50  _c44 = c44;
51 }
52 
53 void
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 }
AnisotropicElasticityTensor::calculateEntries
virtual void calculateEntries(unsigned int qp)
Fill in the matrix.
Definition: AnisotropicElasticityTensor.C:54
AnisotropicElasticityTensor::setFirstEulerAngle
void setFirstEulerAngle(const Real a1)
Set the first euler angle.
Definition: AnisotropicElasticityTensor.C:18
AnisotropicElasticityTensor::setMaterialConstantc44
void setMaterialConstantc44(const Real c44)
Set the material constant c44.
Definition: AnisotropicElasticityTensor.C:48
AnisotropicElasticityTensor::_euler_angle
std::vector< Real > _euler_angle
Definition: AnisotropicElasticityTensor.h:81
AnisotropicElasticityTensor::setSecondEulerAngle
void setSecondEulerAngle(const Real a2)
Set the second euler angle.
Definition: AnisotropicElasticityTensor.C:24
ElasticityTensor
This class defines a basic set of capabilities any elasticity tensor should have.
Definition: ElasticityTensor.h:23
AnisotropicElasticityTensor::AnisotropicElasticityTensor
AnisotropicElasticityTensor()
Definition: AnisotropicElasticityTensor.C:12
AnisotropicElasticityTensor::setMaterialConstantc11
void setMaterialConstantc11(const Real c11)
Set the material constant c11.
Definition: AnisotropicElasticityTensor.C:36
AnisotropicElasticityTensor::_c12
Real _c12
Definition: AnisotropicElasticityTensor.h:83
AnisotropicElasticityTensor::setMaterialConstantc12
void setMaterialConstantc12(const Real c12)
Set the material constant c22.
Definition: AnisotropicElasticityTensor.C:42
AnisotropicElasticityTensor::_c44
Real _c44
Definition: AnisotropicElasticityTensor.h:83
AnisotropicElasticityTensor::_c11
Real _c11
Definition: AnisotropicElasticityTensor.h:83
AnisotropicElasticityTensor.h
AnisotropicElasticityTensor::setThirdEulerAngle
void setThirdEulerAngle(const Real a3)
Set the third euler angle.
Definition: AnisotropicElasticityTensor.C:30