15#include "libmesh/point.h"
69 return r2tensor(i, j);
85 direction(i) = std::sqrt(0.5);
86 direction(j) = std::sqrt(0.5);
89 return r2tensor(i, j);
108 return dev_stress_squared == 0.0 ? 0.0 : sqrt(1.5 * dev_stress_squared);
124 return strain_squared == 0.0 ? 0.0 : sqrt(2.0 / 3.0 * strain_squared);
135 return r2tensor.
trace() / 3.0;
176 return exp(strain(0, 0)) * exp(strain(1, 1)) * exp(strain(2, 2)) - 1.0;
187 return r2tensor.
trace();
202 for (
unsigned int i = 0; i < 2; ++i)
203 for (
unsigned int j = i + 1; j < 3; ++j)
205 val += r2tensor(i, i) * r2tensor(j, j);
206 val -= (r2tensor(i, j) * r2tensor(i, j) + r2tensor(j, i) * r2tensor(j, i)) * 0.5;
221 val = r2tensor(0, 0) * r2tensor(1, 1) * r2tensor(2, 2) -
222 r2tensor(0, 0) * r2tensor(1, 2) * r2tensor(2, 1) +
223 r2tensor(0, 1) * r2tensor(1, 2) * r2tensor(2, 0) -
224 r2tensor(0, 1) * r2tensor(1, 0) * r2tensor(2, 2) +
225 r2tensor(0, 2) * r2tensor(1, 0) * r2tensor(2, 1) -
226 r2tensor(0, 2) * r2tensor(1, 1) * r2tensor(2, 0);
245 std::vector<T> eigenval(LIBMESH_DIM);
249 T val = eigenval[index];
250 eigenvec = eigvecs.
column(index);
305 const Point & point1,
306 const Point & point2,
309 Point axis = point2 - point1;
313 T axial_stress = axis * (stress * axis);
330 const Point & point2,
331 const Point & curr_point,
332 Point & normalPosition);
347 const Point & point1,
348 const Point & point2,
349 const Point & curr_point,
356 Point axis_rotation = point2 - point1;
357 Point yp = axis_rotation / axis_rotation.norm();
358 Point zp = xp.cross(yp);
361 T hoop_stress = zp * (stress * zp);
380 const Point & point1,
381 const Point & point2,
382 const Point & curr_point,
390 T radial_stress = radial_norm * (stress * radial_norm);
392 direction = radial_norm;
394 return radial_stress;
408 const Point & center,
409 const Point & curr_point,
412 Point radial = curr_point -
center;
413 radial /= radial.norm();
416 T radial_stress = radial * (stress * radial);
420 return radial_stress;
433 const Point & center,
434 const Point & curr_point,
437 Point radial = curr_point -
center;
438 Real r = radial.norm();
448 if (!MooseUtils::absoluteFuzzyEqual(radial(0), 0.0))
450 Real
x = curr_point(0) - (radial(1) + radial(2)) * r / radial(0);
451 tangential = Point(
x, curr_point(1) + r, curr_point(2) + r) - curr_point;
453 else if (!MooseUtils::absoluteFuzzyEqual(radial(1), 0.0))
455 Real
y = curr_point(1) - (radial(0) + radial(2)) * r / radial(1);
456 tangential = Point(curr_point(0) + r,
y, curr_point(2) + r) - curr_point;
458 else if (!MooseUtils::absoluteFuzzyEqual(radial(1), 0.0))
460 Real z = curr_point(2) - (radial(0) + radial(1)) * r / radial(2);
461 tangential = Point(curr_point(0) + r, curr_point(1) + r, z) - curr_point;
464 mooseError(
"In Hoop stress calculation for spherical geometry, the current (quadracture) point "
465 "is likely to be at the center. ");
467 tangential /= tangential.norm();
471 for (
unsigned int i = 0; i < 3; ++i)
472 for (
unsigned int j = 0; j < 3; ++j)
473 hoop_stress += tangential(j) * stress(j, i) * tangential(i);
475 direction = tangential;
488 T tensor_value_in_direction = direction * (r2tensor * direction);
490 return tensor_value_in_direction;
539 const Point & point1,
540 const Point & point2,
541 const Point & curr_point,
549 mooseError(
"To compute an effective inelastic strain use "
550 "RankTwoScalarTools::effectiveStrain()");
570 return axialStress(tensor, point1, point2, direction);
572 return hoopStress(tensor, point1, point2, curr_point, direction);
574 return radialStress(tensor, point1, point2, curr_point, direction);
584 mooseError(
"RankTwoScalarTools Error: invalid scalar type");
592 const Point & point1,
593 const Point & point2,
594 const Point & curr_point,
600 return axialStress(tensor, point1, point2, direction);
602 return hoopStress(tensor, point1, point2, curr_point, direction);
604 return radialStress(tensor, point1, point2, curr_point, direction);
606 mooseError(
"RankTwoCylindricalComponent Error: scalar type invalid");
614 const Point & center,
615 const Point & curr_point,
625 mooseError(
"RankTwoSphericalComponent Error: scalar type invalid");
644 mooseError(
"RankTwoInvariant Error: valid invariant");
664 mooseError(
"To compute an effective inelastic strain use "
665 "RankTwoScalarTools::effectiveStrain()");
685 mooseError(
"RankTwoCartesianComponent Error: Pass valid invariant - " +
691 const RealVectorValue & axialVector,
693 const bool transpose);
700 voigt_vector(0) = tensor(0, 0);
701 voigt_vector(1) = tensor(1, 1);
702 voigt_vector(2) = tensor(2, 2);
703 voigt_vector(3) = tensor(0, 1);
704 voigt_vector(4) = tensor(1, 2);
705 voigt_vector(5) = tensor(0, 2);
713 tensor(0, 0) = voigt_vector(0);
714 tensor(1, 1) = voigt_vector(1);
715 tensor(2, 2) = voigt_vector(2);
716 tensor(0, 1) = tensor(1, 0) = voigt_vector(3);
717 tensor(1, 2) = tensor(2, 1) = voigt_vector(4);
718 tensor(0, 2) = tensor(2, 0) = voigt_vector(5);
const std::vector< double > y
const std::vector< double > x
void mooseError(Args &&... args)
Moose::GenericType< DenseVector< Real >, is_ad > GenericDenseVector
Moose::GenericType< RankTwoTensor, is_ad > GenericRankTwoTensor
T doubleContraction(const RankTwoTensorTempl< T > &a) const
libMesh::VectorValue< T > column(const unsigned int i) const
RankTwoTensorTempl< T > deviatoric() const
void symmetricEigenvaluesEigenvectors(std::vector< T > &eigvals, RankTwoTensorTempl< T > &eigvecs) const