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);
126 return r2tensor.
trace() / 3.0;
166 return std::exp(strain(0, 0)) * std::exp(strain(1, 1)) * std::exp(strain(2, 2)) - 1.0;
177 return r2tensor.
trace();
192 for (
unsigned int i = 0; i < 2; ++i)
193 for (
unsigned int j = i + 1; j < 3; ++j)
195 val += r2tensor(i, i) * r2tensor(j, j);
196 val -= (r2tensor(i, j) * r2tensor(i, j) + r2tensor(j, i) * r2tensor(j, i)) * 0.5;
211 val = r2tensor(0, 0) * r2tensor(1, 1) * r2tensor(2, 2) -
212 r2tensor(0, 0) * r2tensor(1, 2) * r2tensor(2, 1) +
213 r2tensor(0, 1) * r2tensor(1, 2) * r2tensor(2, 0) -
214 r2tensor(0, 1) * r2tensor(1, 0) * r2tensor(2, 2) +
215 r2tensor(0, 2) * r2tensor(1, 0) * r2tensor(2, 1) -
216 r2tensor(0, 2) * r2tensor(1, 1) * r2tensor(2, 0);
235 std::vector<T> eigenval(LIBMESH_DIM);
239 T val = eigenval[index];
240 eigenvec = eigvecs.
column(index);
295 const Point & point1,
296 const Point & point2,
299 Point axis = point2 - point1;
303 T axial_stress = axis * (stress * axis);
320 const Point & point2,
321 const Point & curr_point,
322 Point & normalPosition);
337 const Point & point1,
338 const Point & point2,
339 const Point & curr_point,
346 Point axis_rotation = point2 - point1;
347 Point yp = axis_rotation / axis_rotation.norm();
348 Point zp = xp.cross(yp);
351 T hoop_stress = zp * (stress * zp);
370 const Point & point1,
371 const Point & point2,
372 const Point & curr_point,
380 T radial_stress = radial_norm * (stress * radial_norm);
382 direction = radial_norm;
384 return radial_stress;
398 const Point & center,
399 const Point & curr_point,
402 Point radial = curr_point -
center;
403 radial /= radial.norm();
406 T radial_stress = radial * (stress * radial);
410 return radial_stress;
423 const Point & center,
424 const Point & curr_point,
427 Point radial = curr_point -
center;
428 Real r = radial.norm();
438 if (!MooseUtils::absoluteFuzzyEqual(radial(0), 0.0))
440 Real
x = curr_point(0) - (radial(1) + radial(2)) * r / radial(0);
441 tangential = Point(
x, curr_point(1) + r, curr_point(2) + r) - curr_point;
443 else if (!MooseUtils::absoluteFuzzyEqual(radial(1), 0.0))
445 Real
y = curr_point(1) - (radial(0) + radial(2)) * r / radial(1);
446 tangential = Point(curr_point(0) + r,
y, curr_point(2) + r) - curr_point;
448 else if (!MooseUtils::absoluteFuzzyEqual(radial(1), 0.0))
450 Real z = curr_point(2) - (radial(0) + radial(1)) * r / radial(2);
451 tangential = Point(curr_point(0) + r, curr_point(1) + r, z) - curr_point;
454 mooseError(
"In Hoop stress calculation for spherical geometry, the current (quadracture) point "
455 "is likely to be at the center. ");
457 tangential /= tangential.norm();
461 for (
unsigned int i = 0; i < 3; ++i)
462 for (
unsigned int j = 0; j < 3; ++j)
463 hoop_stress += tangential(j) * stress(j, i) * tangential(i);
465 direction = tangential;
478 T tensor_value_in_direction = direction * (r2tensor * direction);
480 return tensor_value_in_direction;
529 const Point & point1,
530 const Point & point2,
531 const Point & curr_point,
539 mooseError(
"To compute an effective inelastic strain use "
540 "RankTwoScalarTools::effectiveStrain()");
560 return axialStress(tensor, point1, point2, direction);
562 return hoopStress(tensor, point1, point2, curr_point, direction);
564 return radialStress(tensor, point1, point2, curr_point, direction);
574 mooseError(
"RankTwoScalarTools Error: invalid scalar type");
582 const Point & point1,
583 const Point & point2,
584 const Point & curr_point,
590 return axialStress(tensor, point1, point2, direction);
592 return hoopStress(tensor, point1, point2, curr_point, direction);
594 return radialStress(tensor, point1, point2, curr_point, direction);
596 mooseError(
"RankTwoCylindricalComponent Error: scalar type invalid");
604 const Point & center,
605 const Point & curr_point,
615 mooseError(
"RankTwoSphericalComponent Error: scalar type invalid");
634 mooseError(
"RankTwoInvariant Error: valid invariant");
654 mooseError(
"To compute an effective inelastic strain use "
655 "RankTwoScalarTools::effectiveStrain()");
675 mooseError(
"RankTwoCartesianComponent Error: Pass valid invariant - " +
681 const RealVectorValue & axialVector,
683 const bool transpose);
690 voigt_vector(0) = tensor(0, 0);
691 voigt_vector(1) = tensor(1, 1);
692 voigt_vector(2) = tensor(2, 2);
693 voigt_vector(3) = tensor(0, 1);
694 voigt_vector(4) = tensor(1, 2);
695 voigt_vector(5) = tensor(0, 2);
703 tensor(0, 0) = voigt_vector(0);
704 tensor(1, 1) = voigt_vector(1);
705 tensor(2, 2) = voigt_vector(2);
706 tensor(0, 1) = tensor(1, 0) = voigt_vector(3);
707 tensor(1, 2) = tensor(2, 1) = voigt_vector(4);
708 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