https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Enumerations | Functions
RankTwoScalarTools Namespace Reference

Enumerations

enum class  InvariantType {
  VonMisesStress , EffectiveStrain , Hydrostatic , L2norm ,
  VolumetricStrain , FirstInvariant , SecondInvariant , ThirdInvariant ,
  TriaxialityStress , MaxShear , StressIntensity , MaxPrincipal ,
  MidPrincipal , MinPrincipal
}
 
enum class  CylindricalComponent { AxialStress , HoopStress , RadialStress }
 
enum class  SphericalComponent { HoopStress , RadialStress }
 

Functions

MooseEnum scalarOptions ()
 This enum is left for legacy calls.
 
MooseEnum invariantOptions ()
 
MooseEnum cylindricalOptions ()
 
MooseEnum sphericalOptions ()
 
template<typename T >
T component (const RankTwoTensorTempl< T > &r2tensor, unsigned int i, unsigned int j)
 
template<typename T >
T component (const RankTwoTensorTempl< T > &r2tensor, unsigned int i, unsigned int j, Point &direction)
 
template<typename T >
T vonMisesStress (const RankTwoTensorTempl< T > &stress)
 
template<typename T >
T effectiveStrain (const RankTwoTensorTempl< T > &strain)
 
template<typename T >
T hydrostatic (const RankTwoTensorTempl< T > &r2tensor)
 
template<typename T >
T L2norm (const RankTwoTensorTempl< T > &r2tensor)
 
template<typename T >
T volumetricStrain (const RankTwoTensorTempl< T > &strain)
 
template<typename T >
T firstInvariant (const RankTwoTensorTempl< T > &r2tensor)
 
template<typename T >
T secondInvariant (const RankTwoTensorTempl< T > &r2tensor)
 
template<typename T >
T thirdInvariant (const RankTwoTensorTempl< T > &r2tensor)
 
template<typename T >
T calcEigenValuesEigenVectors (const RankTwoTensorTempl< T > &r2tensor, unsigned int index, libMesh::TypeVector< T > &eigenvec)
 
template<typename T >
T maxPrincipal (const RankTwoTensorTempl< T > &r2tensor, libMesh::TypeVector< T > &direction)
 
template<typename T >
T midPrincipal (const RankTwoTensorTempl< T > &r2tensor, libMesh::TypeVector< T > &direction)
 
template<typename T >
T minPrincipal (const RankTwoTensorTempl< T > &r2tensor, libMesh::TypeVector< T > &direction)
 
template<typename T >
T axialStress (const RankTwoTensorTempl< T > &stress, const Point &point1, const Point &point2, Point &direction)
 
void normalPositionVector (const Point &point1, const Point &point2, const Point &curr_point, Point &normalPosition)
 
template<typename T >
T hoopStress (const RankTwoTensorTempl< T > &stress, const Point &point1, const Point &point2, const Point &curr_point, Point &direction)
 
template<typename T >
T radialStress (const RankTwoTensorTempl< T > &stress, const Point &point1, const Point &point2, const Point &curr_point, Point &direction)
 
template<typename T >
T radialStress (const RankTwoTensorTempl< T > &stress, const Point &center, const Point &curr_point, Point &direction)
 
template<typename T >
T hoopStress (const RankTwoTensorTempl< T > &stress, const Point &center, const Point &curr_point, Point &direction)
 
template<typename T >
T directionValueTensor (const RankTwoTensorTempl< T > &r2tensor, const Point &direction)
 
template<typename T >
T triaxialityStress (const RankTwoTensorTempl< T > &stress)
 
template<typename T >
T maxShear (const RankTwoTensorTempl< T > &stress)
 
template<typename T >
T stressIntensity (const RankTwoTensorTempl< T > &stress)
 
template<typename T >
T getQuantity (const RankTwoTensorTempl< T > &tensor, const MooseEnum &scalar_type, const Point &point1, const Point &point2, const Point &curr_point, Point &direction)
 
template<typename T >
T getCylindricalComponent (const RankTwoTensorTempl< T > &tensor, const CylindricalComponent &scalar_type, const Point &point1, const Point &point2, const Point &curr_point, Point &direction)
 
template<typename T >
T getSphericalComponent (const RankTwoTensorTempl< T > &tensor, const SphericalComponent &scalar_type, const Point &center, const Point &curr_point, Point &direction)
 
template<typename T >
T getPrincipalComponent (const RankTwoTensorTempl< T > &tensor, const InvariantType &scalar_type, libMesh::TypeVector< T > &direction)
 
template<typename T >
T getDirectionalComponent (const RankTwoTensorTempl< T > &tensor, const Point &direction)
 
template<typename T >
T getInvariant (const RankTwoTensorTempl< T > &tensor, const InvariantType &scalar_type)
 
void setRotationMatrix (const RealVectorValue &outwardnormal, const RealVectorValue &axialVector, RankTwoTensor &rotationMatrix, const bool transpose)
 
template<bool is_ad>
void RankTwoTensorToVoigtVector (const GenericRankTwoTensor< is_ad > &tensor, GenericDenseVector< is_ad > &voigt_vector)
 
template<bool is_ad>
void VoigtVectorToRankTwoTensor (const GenericDenseVector< is_ad > &voigt_vector, GenericRankTwoTensor< is_ad > &tensor)
 

Enumeration Type Documentation

◆ CylindricalComponent

Enumerator
AxialStress 
HoopStress 
RadialStress 

Definition at line 49 of file RankTwoScalarTools.h.

◆ InvariantType

Enumerator
VonMisesStress 
EffectiveStrain 
Hydrostatic 
L2norm 
VolumetricStrain 
FirstInvariant 
SecondInvariant 
ThirdInvariant 
TriaxialityStress 
MaxShear 
StressIntensity 
MaxPrincipal 
MidPrincipal 
MinPrincipal 

Definition at line 31 of file RankTwoScalarTools.h.

◆ SphericalComponent

Enumerator
HoopStress 
RadialStress 

Definition at line 56 of file RankTwoScalarTools.h.

57{
60};

Function Documentation

◆ axialStress()

template<typename T >
T RankTwoScalarTools::axialStress ( const RankTwoTensorTempl< T > &  stress,
const Point &  point1,
const Point &  point2,
Point &  direction 
)

Definition at line 304 of file RankTwoScalarTools.h.

308{
309 Point axis = point2 - point1;
310 axis /= axis.norm();
311
312 // Calculate the stress in the direction of the axis specifed by the user
313 T axial_stress = axis * (stress * axis);
314
315 direction = axis;
316
317 return axial_stress;
318}
const double T

Referenced by RankTwoBasedFailureCriteriaNOSPD::computeFailureCriterionValue(), getCylindricalComponent(), and getQuantity().

◆ calcEigenValuesEigenVectors()

template<typename T >
T RankTwoScalarTools::calcEigenValuesEigenVectors ( const RankTwoTensorTempl< T > &  r2tensor,
unsigned int  index,
libMesh::TypeVector< T > &  eigenvec 
)

Definition at line 241 of file RankTwoScalarTools.h.

244{
245 std::vector<T> eigenval(LIBMESH_DIM);
246 RankTwoTensorTempl<T> eigvecs;
247 r2tensor.symmetricEigenvaluesEigenvectors(eigenval, eigvecs);
248
249 T val = eigenval[index];
250 eigenvec = eigvecs.column(index);
251
252 return val;
253}
libMesh::VectorValue< T > column(const unsigned int i) const
void symmetricEigenvaluesEigenvectors(std::vector< T > &eigvals, RankTwoTensorTempl< T > &eigvecs) const

Referenced by maxPrincipal(), midPrincipal(), minPrincipal(), and TEST().

◆ component() [1/2]

template<typename T >
T RankTwoScalarTools::component ( const RankTwoTensorTempl< T > &  r2tensor,
unsigned int  i,
unsigned int  j 
)

◆ component() [2/2]

template<typename T >
T RankTwoScalarTools::component ( const RankTwoTensorTempl< T > &  r2tensor,
unsigned int  i,
unsigned int  j,
Point &  direction 
)

Definition at line 78 of file RankTwoScalarTools.h.

79{
80 direction.zero();
81 if (i == j)
82 direction(i) = 1.0;
83 else
84 {
85 direction(i) = std::sqrt(0.5);
86 direction(j) = std::sqrt(0.5);
87 }
88
89 return r2tensor(i, j);
90}

◆ cylindricalOptions()

MooseEnum RankTwoScalarTools::cylindricalOptions ( )

Definition at line 34 of file RankTwoScalarTools.C.

35{
36 return MooseEnum("AxialStress HoopStress RadialStress");
37}

◆ directionValueTensor()

template<typename T >
T RankTwoScalarTools::directionValueTensor ( const RankTwoTensorTempl< T > &  r2tensor,
const Point &  direction 
)

Definition at line 486 of file RankTwoScalarTools.h.

487{
488 T tensor_value_in_direction = direction * (r2tensor * direction);
489
490 return tensor_value_in_direction;
491}

Referenced by getDirectionalComponent(), CrackFrontNonlocalStress::getQPCrackFrontScalar(), and getQuantity().

◆ effectiveStrain()

template<typename T >
T RankTwoScalarTools::effectiveStrain ( const RankTwoTensorTempl< T > &  strain)

Definition at line 117 of file RankTwoScalarTools.h.

118{
119 const T strain_squared = strain.doubleContraction(strain);
120
121 // The derivative of sqrt is infinite at zero, which a vanishing strain increment reaches, so
122 // return zero with zero derivatives there
123 using std::sqrt;
124 return strain_squared == 0.0 ? 0.0 : sqrt(2.0 / 3.0 * strain_squared);
125}
T doubleContraction(const RankTwoTensorTempl< T > &a) const

Referenced by RankTwoBasedFailureCriteriaNOSPD::computeFailureCriterionValue(), and RankTwoInvariantTempl< is_ad >::computeQpProperties().

◆ firstInvariant()

template<typename T >
T RankTwoScalarTools::firstInvariant ( const RankTwoTensorTempl< T > &  r2tensor)

Definition at line 185 of file RankTwoScalarTools.h.

186{
187 return r2tensor.trace();
188}

Referenced by getInvariant(), and getQuantity().

◆ getCylindricalComponent()

template<typename T >
T RankTwoScalarTools::getCylindricalComponent ( const RankTwoTensorTempl< T > &  tensor,
const CylindricalComponent &  scalar_type,
const Point &  point1,
const Point &  point2,
const Point &  curr_point,
Point &  direction 
)

Definition at line 590 of file RankTwoScalarTools.h.

596{
597 switch (scalar_type)
598 {
599 case CylindricalComponent::AxialStress:
600 return axialStress(tensor, point1, point2, direction);
601 case CylindricalComponent::HoopStress:
602 return hoopStress(tensor, point1, point2, curr_point, direction);
603 case CylindricalComponent::RadialStress:
604 return radialStress(tensor, point1, point2, curr_point, direction);
605 default:
606 mooseError("RankTwoCylindricalComponent Error: scalar type invalid");
607 }
608}
void mooseError(Args &&... args)
T axialStress(const RankTwoTensorTempl< T > &stress, const Point &point1, const Point &point2, Point &direction)
T radialStress(const RankTwoTensorTempl< T > &stress, const Point &point1, const Point &point2, const Point &curr_point, Point &direction)
T hoopStress(const RankTwoTensorTempl< T > &stress, const Point &point1, const Point &point2, const Point &curr_point, Point &direction)

Referenced by RankTwoCylindricalComponentTempl< is_ad >::computeQpProperties().

◆ getDirectionalComponent()

template<typename T >
T RankTwoScalarTools::getDirectionalComponent ( const RankTwoTensorTempl< T > &  tensor,
const Point &  direction 
)

Definition at line 650 of file RankTwoScalarTools.h.

651{
652 return directionValueTensor(tensor, direction);
653}
T directionValueTensor(const RankTwoTensorTempl< T > &r2tensor, const Point &direction)

Referenced by RankTwoDirectionalComponentTempl< is_ad >::computeQpProperties().

◆ getInvariant()

template<typename T >
T RankTwoScalarTools::getInvariant ( const RankTwoTensorTempl< T > &  tensor,
const InvariantType &  scalar_type 
)

Definition at line 657 of file RankTwoScalarTools.h.

658{
659 switch (scalar_type)
660 {
661 case InvariantType::VonMisesStress:
662 return vonMisesStress(tensor);
663 case InvariantType::EffectiveStrain:
664 mooseError("To compute an effective inelastic strain use "
665 "RankTwoScalarTools::effectiveStrain()");
666 case InvariantType::Hydrostatic:
667 return hydrostatic(tensor);
668 case InvariantType::L2norm:
669 return L2norm(tensor);
670 case InvariantType::VolumetricStrain:
671 return volumetricStrain(tensor);
672 case InvariantType::FirstInvariant:
673 return firstInvariant(tensor);
674 case InvariantType::SecondInvariant:
675 return secondInvariant(tensor);
676 case InvariantType::ThirdInvariant:
677 return thirdInvariant(tensor);
678 case InvariantType::TriaxialityStress:
679 return triaxialityStress(tensor);
680 case InvariantType::MaxShear:
681 return maxShear(tensor);
682 case InvariantType::StressIntensity:
683 return stressIntensity(tensor);
684 default:
685 mooseError("RankTwoCartesianComponent Error: Pass valid invariant - " +
686 invariantOptions().getRawNames());
687 }
688}
T secondInvariant(const RankTwoTensorTempl< T > &r2tensor)
T triaxialityStress(const RankTwoTensorTempl< T > &stress)
T maxShear(const RankTwoTensorTempl< T > &stress)
T stressIntensity(const RankTwoTensorTempl< T > &stress)
T vonMisesStress(const RankTwoTensorTempl< T > &stress)
T thirdInvariant(const RankTwoTensorTempl< T > &r2tensor)
T firstInvariant(const RankTwoTensorTempl< T > &r2tensor)
T hydrostatic(const RankTwoTensorTempl< T > &r2tensor)
T volumetricStrain(const RankTwoTensorTempl< T > &strain)

Referenced by RankTwoInvariantTempl< is_ad >::computeQpProperties().

◆ getPrincipalComponent()

template<typename T >
T RankTwoScalarTools::getPrincipalComponent ( const RankTwoTensorTempl< T > &  tensor,
const InvariantType &  scalar_type,
libMesh::TypeVector< T > &  direction 
)

Definition at line 631 of file RankTwoScalarTools.h.

634{
635 switch (scalar_type)
636 {
637 case InvariantType::MaxPrincipal:
638 return maxPrincipal(tensor, direction);
639 case InvariantType::MidPrincipal:
640 return midPrincipal(tensor, direction);
641 case InvariantType::MinPrincipal:
642 return minPrincipal(tensor, direction);
643 default:
644 mooseError("RankTwoInvariant Error: valid invariant");
645 }
646}
T midPrincipal(const RankTwoTensorTempl< T > &r2tensor, libMesh::TypeVector< T > &direction)
T minPrincipal(const RankTwoTensorTempl< T > &r2tensor, libMesh::TypeVector< T > &direction)
T maxPrincipal(const RankTwoTensorTempl< T > &r2tensor, libMesh::TypeVector< T > &direction)

Referenced by RankTwoInvariantTempl< is_ad >::computeQpProperties().

◆ getQuantity()

template<typename T >
T RankTwoScalarTools::getQuantity ( const RankTwoTensorTempl< T > &  tensor,
const MooseEnum &  scalar_type,
const Point &  point1,
const Point &  point2,
const Point &  curr_point,
Point &  direction 
)

Definition at line 537 of file RankTwoScalarTools.h.

543{
544 switch (scalar_type)
545 {
546 case 0:
547 return vonMisesStress(tensor);
548 case 1:
549 mooseError("To compute an effective inelastic strain use "
550 "RankTwoScalarTools::effectiveStrain()");
551 case 2:
552 return hydrostatic(tensor);
553 case 3:
554 return L2norm(tensor);
555 case 4:
556 return maxPrincipal(tensor, direction);
557 case 5:
558 return midPrincipal(tensor, direction);
559 case 6:
560 return minPrincipal(tensor, direction);
561 case 7:
562 return volumetricStrain(tensor);
563 case 8:
564 return firstInvariant(tensor);
565 case 9:
566 return secondInvariant(tensor);
567 case 10:
568 return thirdInvariant(tensor);
569 case 11:
570 return axialStress(tensor, point1, point2, direction);
571 case 12:
572 return hoopStress(tensor, point1, point2, curr_point, direction);
573 case 13:
574 return radialStress(tensor, point1, point2, curr_point, direction);
575 case 14:
576 return triaxialityStress(tensor);
577 case 15:
578 return directionValueTensor(tensor, direction);
579 case 16:
580 return maxShear(tensor);
581 case 17:
582 return stressIntensity(tensor);
583 default:
584 mooseError("RankTwoScalarTools Error: invalid scalar type");
585 }
586}

Referenced by RankTwoScalarAuxTempl< is_ad >::computeValue(), NodalRankTwoPD::computeValue(), XFEMRankTwoTensorMarkerUserObject::doesElementCrack(), MeshCut2DRankTwoTensorNucleation::doesElementCrack(), NodalRankTwoScalarPD::gatherWeightedValue(), and LineMaterialRankTwoScalarSampler::getScalarFromProperty().

◆ getSphericalComponent()

template<typename T >
T RankTwoScalarTools::getSphericalComponent ( const RankTwoTensorTempl< T > &  tensor,
const SphericalComponent &  scalar_type,
const Point &  center,
const Point &  curr_point,
Point &  direction 
)

Definition at line 612 of file RankTwoScalarTools.h.

617{
618 switch (scalar_type)
619 {
620 case SphericalComponent::HoopStress:
621 return hoopStress(tensor, center, curr_point, direction);
622 case SphericalComponent::RadialStress:
623 return radialStress(tensor, center, curr_point, direction);
624 default:
625 mooseError("RankTwoSphericalComponent Error: scalar type invalid");
626 }
627}

Referenced by RankTwoSphericalComponentTempl< is_ad >::computeQpProperties().

◆ hoopStress() [1/2]

template<typename T >
T RankTwoScalarTools::hoopStress ( const RankTwoTensorTempl< T > &  stress,
const Point &  center,
const Point &  curr_point,
Point &  direction 
)

Definition at line 432 of file RankTwoScalarTools.h.

436{
437 Point radial = curr_point - center;
438 Real r = radial.norm();
439 radial /= r;
440
441 // Given normal vector N=(n1,n2,n3) and current point C(c1,c2,c3), the tangential plane is then
442 // defined as n1(x-c1) + n2(y-c2) + n3(z-c3)=0. Let us assume n1!=0, the arbitrary point P on this
443 // plane can be taken as P(x,c2+r,c3+r) where r is the radius. The x can be solved as x =
444 // -r(n2+n3)/n1 + c1. The tangential vector PC is given as P-C.
445
446 Point tangential;
447
448 if (!MooseUtils::absoluteFuzzyEqual(radial(0), 0.0))
449 {
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;
452 }
453 else if (!MooseUtils::absoluteFuzzyEqual(radial(1), 0.0))
454 {
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;
457 }
458 else if (!MooseUtils::absoluteFuzzyEqual(radial(1), 0.0))
459 {
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;
462 }
463 else
464 mooseError("In Hoop stress calculation for spherical geometry, the current (quadracture) point "
465 "is likely to be at the center. ");
466
467 tangential /= tangential.norm();
468
469 // Compute the scalar stress component in the hoop direction
470 T hoop_stress = 0.0;
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);
474
475 direction = tangential;
476
477 return hoop_stress;
478}
const std::vector< double > y
const std::vector< double > x
Point center
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ hoopStress() [2/2]

template<typename T >
T RankTwoScalarTools::hoopStress ( const RankTwoTensorTempl< T > &  stress,
const Point &  point1,
const Point &  point2,
const Point &  curr_point,
Point &  direction 
)

Definition at line 346 of file RankTwoScalarTools.h.

351{
352 // Calculate the cross of the normal to the axis of rotation from the current
353 // location and the axis of rotation
354 Point xp;
355 normalPositionVector(point1, point2, curr_point, xp);
356 Point axis_rotation = point2 - point1;
357 Point yp = axis_rotation / axis_rotation.norm();
358 Point zp = xp.cross(yp);
359
360 // Calculate the scalar value of the hoop stress
361 T hoop_stress = zp * (stress * zp);
362
363 direction = zp;
364
365 return hoop_stress;
366}
void normalPositionVector(const Point &point1, const Point &point2, const Point &curr_point, Point &normalPosition)

Referenced by getCylindricalComponent(), getQuantity(), and getSphericalComponent().

◆ hydrostatic()

template<typename T >
T RankTwoScalarTools::hydrostatic ( const RankTwoTensorTempl< T > &  r2tensor)

Definition at line 133 of file RankTwoScalarTools.h.

134{
135 return r2tensor.trace() / 3.0;
136}

Referenced by getInvariant(), getQuantity(), and triaxialityStress().

◆ invariantOptions()

MooseEnum RankTwoScalarTools::invariantOptions ( )

Definition at line 26 of file RankTwoScalarTools.C.

27{
28 return MooseEnum("VonMisesStress EffectiveStrain Hydrostatic L2norm VolumetricStrain "
29 "FirstInvariant SecondInvariant "
30 "ThirdInvariant TriaxialityStress MaxShear StressIntensity EffectiveStrain");
31}

Referenced by getInvariant().

◆ L2norm()

template<typename T >
T RankTwoScalarTools::L2norm ( const RankTwoTensorTempl< T > &  r2tensor)

Definition at line 143 of file RankTwoScalarTools.h.

144{
145 return r2tensor.L2norm();
146}

◆ maxPrincipal()

template<typename T >
T RankTwoScalarTools::maxPrincipal ( const RankTwoTensorTempl< T > &  r2tensor,
libMesh::TypeVector< T > &  direction 
)

Definition at line 263 of file RankTwoScalarTools.h.

264{
265 return calcEigenValuesEigenVectors(r2tensor, (LIBMESH_DIM - 1), direction);
266}
T calcEigenValuesEigenVectors(const RankTwoTensorTempl< T > &r2tensor, unsigned int index, libMesh::TypeVector< T > &eigenvec)

Referenced by RankTwoBasedFailureCriteriaNOSPD::computeFailureCriterionValue(), getPrincipalComponent(), getQuantity(), and maxShear().

◆ maxShear()

template<typename T >
T RankTwoScalarTools::maxShear ( const RankTwoTensorTempl< T > &  stress)

Definition at line 509 of file RankTwoScalarTools.h.

510{
512 return (maxPrincipal(stress, dummy) - minPrincipal(stress, dummy)) / 2.;
513}

Referenced by RankTwoBasedFailureCriteriaNOSPD::computeFailureCriterionValue(), getInvariant(), getQuantity(), and stressIntensity().

◆ midPrincipal()

template<typename T >
T RankTwoScalarTools::midPrincipal ( const RankTwoTensorTempl< T > &  r2tensor,
libMesh::TypeVector< T > &  direction 
)

Definition at line 276 of file RankTwoScalarTools.h.

277{
278 return calcEigenValuesEigenVectors(r2tensor, 1, direction);
279}

Referenced by getPrincipalComponent(), and getQuantity().

◆ minPrincipal()

template<typename T >
T RankTwoScalarTools::minPrincipal ( const RankTwoTensorTempl< T > &  r2tensor,
libMesh::TypeVector< T > &  direction 
)

Definition at line 289 of file RankTwoScalarTools.h.

290{
291 return calcEigenValuesEigenVectors(r2tensor, 0, direction);
292}

Referenced by getPrincipalComponent(), getQuantity(), and maxShear().

◆ normalPositionVector()

void RankTwoScalarTools::normalPositionVector ( const Point &  point1,
const Point &  point2,
const Point &  curr_point,
Point &  normalPosition 
)

Definition at line 46 of file RankTwoScalarTools.C.

50{
51 // Find the nearest point on the axis of rotation (defined by point2 - point1)
52 // to the current position, e.g. the normal to the axis of rotation at the
53 // current position
54 Point axis_rotation = point2 - point1;
55 Point positionWRTpoint1 = point1 - curr_point;
56 Real projection = (axis_rotation * positionWRTpoint1) / axis_rotation.norm_sq();
57 Point normal = point1 - projection * axis_rotation;
58
59 // Calculate the direction normal to the plane formed by the axis of rotation
60 // and the normal to the axis of rotation from the current position.
61 normalPosition = curr_point - normal;
62 normalPosition /= normalPosition.norm();
63}

Referenced by hoopStress(), and radialStress().

◆ radialStress() [1/2]

template<typename T >
T RankTwoScalarTools::radialStress ( const RankTwoTensorTempl< T > &  stress,
const Point &  center,
const Point &  curr_point,
Point &  direction 
)

Definition at line 407 of file RankTwoScalarTools.h.

411{
412 Point radial = curr_point - center;
413 radial /= radial.norm();
414
415 // Compute the scalar stress component in the radial direction
416 T radial_stress = radial * (stress * radial);
417
418 direction = radial;
419
420 return radial_stress;
421}

◆ radialStress() [2/2]

template<typename T >
T RankTwoScalarTools::radialStress ( const RankTwoTensorTempl< T > &  stress,
const Point &  point1,
const Point &  point2,
const Point &  curr_point,
Point &  direction 
)

Definition at line 379 of file RankTwoScalarTools.h.

384{
385 Point radial_norm;
386 normalPositionVector(point1, point2, curr_point, radial_norm);
387
388 // Compute the scalar stress component in the direction of the normal vector from the
389 // user-defined axis of rotation.
390 T radial_stress = radial_norm * (stress * radial_norm);
391
392 direction = radial_norm;
393
394 return radial_stress;
395}

Referenced by getCylindricalComponent(), getQuantity(), and getSphericalComponent().

◆ RankTwoTensorToVoigtVector()

template<bool is_ad>
void RankTwoScalarTools::RankTwoTensorToVoigtVector ( const GenericRankTwoTensor< is_ad > &  tensor,
GenericDenseVector< is_ad > &  voigt_vector 
)

Definition at line 697 of file RankTwoScalarTools.h.

699{
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);
706}

◆ scalarOptions()

MooseEnum RankTwoScalarTools::scalarOptions ( )

This enum is left for legacy calls.

Definition at line 17 of file RankTwoScalarTools.C.

18{
19 return MooseEnum("VonMisesStress EffectiveStrain Hydrostatic L2norm MaxPrincipal "
20 "MidPrincipal MinPrincipal VolumetricStrain FirstInvariant SecondInvariant "
21 "ThirdInvariant AxialStress HoopStress RadialStress TriaxialityStress "
22 "Direction MaxShear StressIntensity");
23}

Referenced by NodalRankTwoPD::validParams(), NodalRankTwoScalarPD::validParams(), RankTwoScalarAuxTempl< is_ad >::validParams(), LineMaterialRankTwoScalarSampler::validParams(), MeshCut2DRankTwoTensorNucleation::validParams(), and XFEMRankTwoTensorMarkerUserObject::validParams().

◆ secondInvariant()

template<typename T >
T RankTwoScalarTools::secondInvariant ( const RankTwoTensorTempl< T > &  r2tensor)

Definition at line 199 of file RankTwoScalarTools.h.

200{
201 T val = 0.0;
202 for (unsigned int i = 0; i < 2; ++i)
203 for (unsigned int j = i + 1; j < 3; ++j)
204 {
205 val += r2tensor(i, i) * r2tensor(j, j);
206 val -= (r2tensor(i, j) * r2tensor(i, j) + r2tensor(j, i) * r2tensor(j, i)) * 0.5;
207 }
208
209 return val;
210}

Referenced by getInvariant(), and getQuantity().

◆ setRotationMatrix()

void RankTwoScalarTools::setRotationMatrix ( const RealVectorValue &  outwardnormal,
const RealVectorValue &  axialVector,
RankTwoTensor &  rotationMatrix,
const bool  transpose 
)

Definition at line 66 of file RankTwoScalarTools.C.

70{
71 RealVectorValue radial_vector(outwardnormal);
72 RealVectorValue azimuthal_vector(0, 0, 0);
73 RealVectorValue polar_vector(axialVector);
74
75 Real rv_norm = radial_vector.norm();
76 if (rv_norm)
77 radial_vector /= rv_norm;
78 else
79 mooseError("The outward normal vector cannot be a zero vector");
80
81 azimuthal_vector = polar_vector.cross(radial_vector);
82 azimuthal_vector /= azimuthal_vector.norm();
83
84 if (!transpose)
85 {
86 // Considering that Moose uses convention [T'] = [Q][T][Q_transpose], the
87 // basis vectors of old coordinate system should be arranged column wise
88 // to construct the rotation matrix Q.
89
90 rotationMatrix.fillColumn(0, radial_vector);
91 rotationMatrix.fillColumn(1, azimuthal_vector);
92 rotationMatrix.fillColumn(2, polar_vector);
93 }
94 else
95 {
96 rotationMatrix.fillRow(0, radial_vector);
97 rotationMatrix.fillRow(1, azimuthal_vector);
98 rotationMatrix.fillRow(2, polar_vector);
99 }
100}
void fillRow(unsigned int r, const libMesh::TypeVector< T > &v)
void fillColumn(unsigned int c, const libMesh::TypeVector< T > &v)

Referenced by HillElastoPlasticityStressUpdateTempl< is_ad >::initQpStatefulProperties().

◆ sphericalOptions()

MooseEnum RankTwoScalarTools::sphericalOptions ( )

Definition at line 40 of file RankTwoScalarTools.C.

41{
42 return MooseEnum("HoopStress RadialStress");
43}

◆ stressIntensity()

template<typename T >
T RankTwoScalarTools::stressIntensity ( const RankTwoTensorTempl< T > &  stress)

Definition at line 519 of file RankTwoScalarTools.h.

520{
521 return 2. * maxShear(stress);
522}

Referenced by getInvariant(), and getQuantity().

◆ thirdInvariant()

template<typename T >
T RankTwoScalarTools::thirdInvariant ( const RankTwoTensorTempl< T > &  r2tensor)

Definition at line 218 of file RankTwoScalarTools.h.

219{
220 T val = 0.0;
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);
227
228 return val;
229}

Referenced by getInvariant(), and getQuantity().

◆ triaxialityStress()

template<typename T >
T RankTwoScalarTools::triaxialityStress ( const RankTwoTensorTempl< T > &  stress)

Definition at line 498 of file RankTwoScalarTools.h.

499{
500 return hydrostatic(stress) / vonMisesStress(stress);
501}

Referenced by getInvariant(), and getQuantity().

◆ VoigtVectorToRankTwoTensor()

template<bool is_ad>
void RankTwoScalarTools::VoigtVectorToRankTwoTensor ( const GenericDenseVector< is_ad > &  voigt_vector,
GenericRankTwoTensor< is_ad > &  tensor 
)

Definition at line 710 of file RankTwoScalarTools.h.

712{
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);
719}

◆ volumetricStrain()

template<typename T >
T RankTwoScalarTools::volumetricStrain ( const RankTwoTensorTempl< T > &  strain)

Definition at line 173 of file RankTwoScalarTools.h.

174{
175 using std::exp;
176 return exp(strain(0, 0)) * exp(strain(1, 1)) * exp(strain(2, 2)) - 1.0;
177}

Referenced by getInvariant(), and getQuantity().

◆ vonMisesStress()

template<typename T >
T RankTwoScalarTools::vonMisesStress ( const RankTwoTensorTempl< T > &  stress)

Definition at line 100 of file RankTwoScalarTools.h.

101{
102 RankTwoTensorTempl<T> dev_stress = stress.deviatoric();
103 const T dev_stress_squared = dev_stress.doubleContraction(dev_stress);
104
105 // The derivative of sqrt is infinite at zero, which a hydrostatic or vanishing stress reaches,
106 // so return zero with zero derivatives there
107 using std::sqrt;
108 return dev_stress_squared == 0.0 ? 0.0 : sqrt(1.5 * dev_stress_squared);
109}
RankTwoTensorTempl< T > deviatoric() const

Referenced by RankTwoBasedFailureCriteriaNOSPD::computeFailureCriterionValue(), getInvariant(), getQuantity(), and triaxialityStress().