OGS
LinearElasticIsotropicPhaseField.cpp
Go to the documentation of this file.
1
9
11
13{
15 int const i, int const j,
16 Eigen::Matrix<double, 3, 1> const& principal_strain)
17{
18 if (i == j)
19 {
20 return 0.0;
21 }
22 if (std::fabs(principal_strain[i] - principal_strain[j]) <
23 std::numeric_limits<double>::epsilon())
24 {
25 return 2 * heaviside(principal_strain[i]);
26 }
27 return 2 *
28 (macaulayTensile(principal_strain[i]) -
29 macaulayTensile(principal_strain[j])) /
30 (principal_strain[i] - principal_strain[j]);
31}
32
34 int const i, int const j,
35 Eigen::Matrix<double, 3, 1> const& principal_strain)
36{
37 if (i == j)
38 {
39 return 0.0;
40 }
41 double num_zero = 1.e-14;
42
43 if (std::fabs(principal_strain[i] - principal_strain[j]) < num_zero)
44 {
45 return 2 * (1 - heaviside(principal_strain[i]));
46 }
47 return 2 *
48 (macaulayCompressive(principal_strain[i]) -
49 macaulayCompressive(principal_strain[j])) /
50 (principal_strain[i] - principal_strain[j]);
51}
52
69
70template <>
74{
76
77 result(0, 0) = A(0) * B(0);
78 result(0, 1) = result(1, 0) = A(3) * B(3) / 2.;
79 result(0, 2) = result(2, 0) = A(5) * B(5) / 2.;
80 result(0, 3) = result(3, 0) = (A(0) * B(3) + A(3) * B(0)) / 2;
81 result(0, 4) = result(4, 0) =
82 (A(3) * B(5) + A(5) * B(3)) / (2. * std::sqrt(2.));
83 result(0, 5) = result(5, 0) = (A(0) * B(5) + A(5) * B(0)) / 2;
84
85 result(1, 1) = A(1) * B(1);
86 result(1, 2) = result(2, 1) = A(4) * B(4) / 2.;
87 result(1, 3) = result(3, 1) = (A(1) * B(3) + A(3) * B(1)) / 2.;
88 result(1, 4) = result(4, 1) = (A(1) * B(4) + A(4) * B(1)) / 2.;
89 result(1, 5) = result(5, 1) =
90 (A(3) * B(4) + A(4) * B(3)) / (2. * std::sqrt(2.));
91
92 result(2, 2) = A(2) * B(2);
93 result(2, 3) = result(3, 2) =
94 (A(4) * B(5) + A(5) * B(4)) / (2. * std::sqrt(2.));
95 result(2, 4) = result(4, 2) = (A(2) * B(4) + A(4) * B(2)) / 2.;
96 result(2, 5) = result(5, 2) = (A(2) * B(5) + A(5) * B(2)) / 2.;
97
98 result(3, 3) = (A(0) * B(1) + A(1) * B(0) + A(3) * B(3)) / 2.;
99 result(3, 4) = result(4, 3) =
100 (A(3) * B(4) + A(4) * B(3)) / 4. +
101 (A(1) * B(5) + A(5) * B(1)) / (2. * std::sqrt(2.));
102 result(3, 5) = result(5, 3) =
103 (A(3) * B(5) + A(5) * B(3)) / 4. +
104 (A(0) * B(4) + A(4) * B(0)) / (2. * std::sqrt(2.));
105
106 result(4, 4) = (A(1) * B(2) + A(2) * B(1) + A(4) * B(4)) / 2.;
107 result(4, 5) = result(5, 4) =
108 (A(4) * B(5) + A(5) * B(4)) / 4. +
109 (A(2) * B(3) + A(3) * B(2)) / (2. * std::sqrt(2.));
110
111 result(5, 5) = (A(0) * B(2) + A(2) * B(0) + A(5) * B(5)) / 2.;
112 return result;
113}
114
115template <>
119{
121
122 result(0, 0) = A(0) * B(0);
123 result(0, 1) = result(1, 0) = A(3) * B(3) / 2.;
124 result(0, 2) = result(2, 0) = 0;
125 result(0, 3) = result(3, 0) = (A(0) * B(3) + A(3) * B(0)) / 2;
126
127 result(1, 1) = A(1) * B(1);
128 result(1, 2) = result(2, 1) = 0;
129 result(1, 3) = result(3, 1) = (A(1) * B(3) + A(3) * B(1)) / 2.;
130
131 result(2, 2) = A(2) * B(2);
132 result(2, 3) = result(3, 2) = 0;
133
134 result(3, 3) = (A(0) * B(1) + A(1) * B(0) + A(3) * B(3)) / 2.;
135
136 return result;
137}
138
139} // namespace MaterialLib::Solids::Phasefield
MathLib::KelvinVector::KelvinMatrixType< 3 > aOdotB< 3 >(MathLib::KelvinVector::KelvinVectorType< 3 > const &A, MathLib::KelvinVector::KelvinVectorType< 3 > const &B)
double evaluateHCompSpectral(int const i, int const j, Eigen::Matrix< double, 3, 1 > const &principal_strain)
MathLib::KelvinVector::KelvinMatrixType< 2 > aOdotB< 2 >(MathLib::KelvinVector::KelvinVectorType< 2 > const &A, MathLib::KelvinVector::KelvinVectorType< 2 > const &B)
double evaluateHTensSpectral(int const i, int const j, Eigen::Matrix< double, 3, 1 > const &principal_strain)
H terms in the Spectral decomposition:
Eigen::Matrix< double, kelvin_vector_dimensions(DisplacementDim), 1, Eigen::ColMajor > KelvinVectorType
Eigen::Matrix< double, kelvin_vector_dimensions(DisplacementDim), kelvin_vector_dimensions(DisplacementDim), Eigen::RowMajor > KelvinMatrixType