13 #include "MooseEnum.h"
14 #include "MooseTypes.h"
15 #include "libmesh/point.h"
16 #include "RankTwoTensor.h"
17 #include "MooseError.h"
33 return r2tensor(i, j);
49 direction(i) = std::sqrt(0.5);
50 direction(j) = std::sqrt(0.5);
53 return r2tensor(i, j);
68 return std::sqrt(1.5 * dev_stress.doubleContraction(dev_stress));
79 return std::sqrt(2.0 / 3.0 * strain.doubleContraction(strain));
90 return r2tensor.trace() / 3.0;
100 return r2tensor.L2norm();
126 template <
typename T>
130 return std::exp(strain(0, 0)) * std::exp(strain(1, 1)) * std::exp(strain(2, 2)) - 1.0;
137 template <
typename T>
141 return r2tensor.trace();
151 template <
typename T>
156 for (
unsigned int i = 0; i < 2; ++i)
157 for (
unsigned int j = i + 1; j < 3; ++j)
159 val += r2tensor(i, i) * r2tensor(j, j);
160 val -= (r2tensor(i, j) * r2tensor(i, j) + r2tensor(j, i) * r2tensor(j, i)) * 0.5;
170 template <
typename T>
175 val = r2tensor(0, 0) * r2tensor(1, 1) * r2tensor(2, 2) -
176 r2tensor(0, 0) * r2tensor(1, 2) * r2tensor(2, 1) +
177 r2tensor(0, 1) * r2tensor(1, 2) * r2tensor(2, 0) -
178 r2tensor(0, 1) * r2tensor(1, 0) * r2tensor(2, 2) +
179 r2tensor(0, 2) * r2tensor(1, 0) * r2tensor(2, 1) -
180 r2tensor(0, 2) * r2tensor(1, 1) * r2tensor(2, 0);
193 template <
typename T>
199 std::vector<T> eigenval(LIBMESH_DIM);
201 r2tensor.symmetricEigenvaluesEigenvectors(eigenval, eigvecs);
203 T val = eigenval[index];
204 eigenvec = eigvecs.column(index);
215 template <
typename T>
228 template <
typename T>
241 template <
typename T>
256 template <
typename T>
259 const Point & point1,
260 const Point & point2,
263 Point axis = point2 - point1;
267 T axial_stress = 0.0;
268 for (
unsigned int i = 0; i < 3; ++i)
269 for (
unsigned int j = 0; j < 3; ++j)
270 axial_stress += axis(j) * stress(j, i) * axis(i);
287 const Point & point2,
288 const Point & curr_point,
289 Point & normalPosition);
301 template <
typename T>
304 const Point & point1,
305 const Point & point2,
306 const Point & curr_point,
313 Point axis_rotation = point2 - point1;
314 Point yp = axis_rotation / axis_rotation.norm();
315 Point zp = xp.cross(yp);
319 for (
unsigned int i = 0; i < 3; ++i)
320 for (
unsigned int j = 0; j < 3; ++j)
321 hoop_stress += zp(j) * stress(j, i) * zp(i);
337 template <
typename T>
340 const Point & point1,
341 const Point & point2,
342 const Point & curr_point,
350 T radial_stress = 0.0;
351 for (
unsigned int i = 0; i < 3; ++i)
352 for (
unsigned int j = 0; j < 3; ++j)
353 radial_stress += radial_norm(j) * stress(j, i) * radial_norm(i);
355 direction = radial_norm;
357 return radial_stress;
364 template <
typename T>
368 T tensor_value_in_direction = 0.0;
369 for (
unsigned int i = 0; i < 3; ++i)
370 for (
unsigned int j = 0; j < 3; ++j)
371 tensor_value_in_direction += direction(j) * r2tensor(j, i) * direction(i);
373 return tensor_value_in_direction;
379 template <
typename T>
390 template <
typename T>
400 template <
typename T>
418 template <
typename T>
421 const MooseEnum & scalar_type,
422 const Point & point1,
423 const Point & point2,
424 const Point & curr_point,
452 return axialStress(tensor, point1, point2, direction);
454 return hoopStress(tensor, point1, point2, curr_point, direction);
456 return radialStress(tensor, point1, point2, curr_point, direction);
466 mooseError(
"RankTwoScalarAux Error: Pass valid scalar type - " +