https://mooseframework.inl.gov
Loading...
Searching...
No Matches
SymmetricRankTwoTensor.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12#include "Moose.h"
16#include "MooseUtils.h"
17#include "MathUtils.h"
18
19#include "libmesh/libmesh.h"
20#include "libmesh/tensor_value.h"
21
22#include "metaphysicl/raw_type.h"
23
24#include <petscsys.h>
25#include <vector>
26
27// Forward declarations
28class MooseEnum;
29template <typename T>
30class MooseArray;
32template <typename>
34namespace libMesh
35{
36template <typename>
37class VectorValue;
38template <typename>
39class TypeVector;
40template <typename>
41class TypeTensor;
42template <typename>
43class TensorValue;
44}
45
46namespace MathUtils
47{
48template <typename T>
49void mooseSetToZero(T & v);
50
55template <>
57
62template <>
64}
65
72template <typename T>
74{
75public:
77 typedef T value_type;
78
80 static constexpr unsigned int Ndim = Moose::dim;
81 static constexpr unsigned int N = Ndim + (Ndim * (Ndim - 1)) / 2;
83
84 // Full tensor indices in the Mandel/Voigt representation
85 static constexpr unsigned int full_index[6][2] = {{0, 0}, {1, 1}, {2, 2}, {1, 2}, {0, 2}, {0, 1}};
86
87 // Reverse tensor indices in the Mandel/Voigt representation
88 static constexpr unsigned int reverse_index[3][3] = {{0, 5, 4}, {5, 1, 3}, {4, 3, 2}};
89
91 static constexpr Real mandelFactor(unsigned int i) { return i < Ndim ? 1.0 : MathUtils::sqrt2; }
92
93 // Select initialization
99
102
105
118
120 SymmetricRankTwoTensorTempl(const std::vector<T> & input) { this->fillFromInputVector(input); };
121
124 const T & S11, const T & S22, const T & S33, const T & S23, const T & S13, const T & S12);
125
126 // explicit cast to a full tensor
127 explicit operator RankTwoTensorTempl<T>();
128
129private:
131 SymmetricRankTwoTensorTempl(const T & S11,
132 const T & S21,
133 const T & S31,
134 const T & S12,
135 const T & S22,
136 const T & S32,
137 const T & S13,
138 const T & S23,
139 const T & S33);
140
141 // internal use named constructor that does not apply the sqrt(2) factors
143 const T & S11, const T & S22, const T & S33, const T & S23, const T & S13, const T & S12);
144
145public:
147 explicit SymmetricRankTwoTensorTempl(const TensorValue<T> & a);
148
150 explicit SymmetricRankTwoTensorTempl(const TypeTensor<T> & a);
151
153 template <typename T2>
155 {
156 for (const auto i : make_range(N))
157 _vals[i] = a(i);
158 }
159
160 // Named constructors
165
168 initializeSymmetric(const TypeVector<T> & v0, const TypeVector<T> & v1, const TypeVector<T> & v2);
169
171 static MooseEnum fillMethodEnum();
172
174 void fillFromInputVector(const std::vector<T> & input, FillMethod fill_method = autodetect);
175
180 void fillFromScalarVariable(const VariableValue & scalar_variable);
181
183 inline T & operator()(unsigned int i) { return _vals[i]; }
184
189 inline T operator()(unsigned int i) const { return _vals[i]; }
190
194 inline T operator()(unsigned int i, unsigned int j) const
195 {
196 const auto a = reverse_index[i][j];
197 return _vals[a] / mandelFactor(a);
198 }
199
201 libMesh::VectorValue<T> row(const unsigned int n) const;
202
204 libMesh::VectorValue<T> column(const unsigned int n) const { return row(n); }
205
208 [[nodiscard]] static SymmetricRankTwoTensorTempl<T>
210
213 [[nodiscard]] static SymmetricRankTwoTensorTempl<T>
215
218 [[nodiscard]] static SymmetricRankTwoTensorTempl<T>
220
223
225 T tr() const { return _vals[0] + _vals[1] + _vals[2]; }
226
228 void zero();
229
235 void rotate(const TypeTensor<T> & R);
236
242
244 template <typename T2>
246
250 template <typename Scalar>
251 typename std::enable_if<libMesh::ScalarTraits<Scalar>::value, SymmetricRankTwoTensorTempl &>::type
252 operator=(const Scalar & libmesh_dbg_var(p))
253 {
254 libmesh_assert_equal_to(p, Scalar(0));
255 this->zero();
256 return *this;
257 }
258
261
263 template <typename T2>
266
269
271 template <typename T2>
274
277
280
282 template <typename T2>
283 auto operator*(const T2 & a) const ->
284 typename std::enable_if<libMesh::ScalarTraits<T2>::value,
285 SymmetricRankTwoTensorTempl<decltype(T() * T2())>>::type;
286
289
291 template <typename T2>
292 auto operator/(const T2 & a) const ->
293 typename std::enable_if<libMesh::ScalarTraits<T2>::value,
294 SymmetricRankTwoTensorTempl<decltype(T() / T2())>>::type;
295
297 template <typename T2>
298 TypeVector<typename libMesh::CompareTypes<T, T2>::supertype>
299 operator*(const TypeVector<T2> & a) const;
300
302 template <typename T2>
304
306 bool isSymmetric() const { return true; }
307
309 template <typename T2>
311
314
317
320
324
327
329 T trace() const;
330
333
339
343 T generalSecondInvariant() const;
344
351 T secondInvariant() const;
352
358
364
371 T sin3Lode(const T & r0, const T & r0_value) const;
372
380
387 T thirdInvariant() const;
388
394
400
401 // determinant of the tensor
402 T det() const;
403
409
411 void print(std::ostream & stm = Moose::out) const;
412
414 void printReal(std::ostream & stm = Moose::out) const;
415
417 void printADReal(unsigned int nDual, std::ostream & stm = Moose::out) const;
418
419 friend std::ostream & operator<<(std::ostream & os, const SymmetricRankTwoTensorTempl<T> & t)
420 {
421 t.print(os);
422 return os;
423 }
424
426 void addIa(const T & a);
427
429 T L2norm() const;
430
435 void surfaceFillFromInputVector(const std::vector<T> & input);
436
441 void symmetricEigenvalues(std::vector<T> & eigvals) const;
442
448 void symmetricEigenvaluesEigenvectors(std::vector<T> & eigvals,
449 RankTwoTensorTempl<T> & eigvecs) const;
450
454 static void initRandom(unsigned int);
455
461 [[nodiscard]] static SymmetricRankTwoTensorTempl<T> genRandomSymmTensor(T, T);
462
464 [[nodiscard]] static SymmetricRankTwoTensorTempl<T> selfOuterProduct(const TypeVector<T> &);
465
469
471 void setToIdentity();
472
473protected:
483 void syev(const char * calculation_type, std::vector<T> & eigvals, std::vector<T> & a) const;
484
485private:
486 static constexpr std::array<Real, N> identityCoords = {{1, 1, 1, 0, 0, 0}};
487
488 // tensor components
489 std::array<T, N> _vals;
490
491 template <class T2>
492 friend void dataStore(std::ostream &, SymmetricRankTwoTensorTempl<T2> &, void *);
493
494 template <class T2>
495 friend void dataLoad(std::istream &, SymmetricRankTwoTensorTempl<T2> &, void *);
496 template <class T2>
498};
499
500namespace MetaPhysicL
501{
502template <typename T>
504{
506
508 {
509 value_type ret;
510 for (unsigned int i = 0; i < SymmetricRankTwoTensorTempl<T>::N; ++i)
511 ret(i) = raw_value(in(i));
512
513 return ret;
514 }
515};
516}
517
518template <typename T>
519template <typename T2>
520auto
522 typename std::enable_if<libMesh::ScalarTraits<T2>::value,
523 SymmetricRankTwoTensorTempl<decltype(T() * T2())>>::type
524{
525 SymmetricRankTwoTensorTempl<decltype(T() * T2())> result;
526 for (const auto i : make_range(N))
527 result._vals[i] = _vals[i] * a;
528 return result;
529}
530
531template <typename T>
532template <typename T2>
533auto
535 typename std::enable_if<libMesh::ScalarTraits<T2>::value,
536 SymmetricRankTwoTensorTempl<decltype(T() / T2())>>::type
537{
538 SymmetricRankTwoTensorTempl<decltype(T() / T2())> result;
539 for (const auto i : make_range(N))
540 result._vals[i] = _vals[i] / a;
541 return result;
542}
543
545template <typename T>
546template <typename T2>
547TypeVector<typename libMesh::CompareTypes<T, T2>::supertype>
548SymmetricRankTwoTensorTempl<T>::operator*(const TypeVector<T2> & a) const
549{
550 TypeVector<typename libMesh::CompareTypes<T, T2>::supertype> ret;
551 ret(0) = a(0) * _vals[0] + a(1) * _vals[5] + a(2) * _vals[4];
552 ret(1) = a(0) * _vals[5] + a(1) * _vals[1] + a(2) * _vals[3];
553 ret(2) = a(0) * _vals[4] + a(1) * _vals[3] + a(2) * _vals[2];
554}
555
556template <typename T>
557template <typename T2>
558bool
560{
561 for (std::size_t i = 0; i < N; ++i)
562 if (_vals[i] != a._vals[i])
563 return false;
564 return true;
565}
566
567template <typename T>
568template <typename T2>
569bool
571{
572 for (std::size_t i = 0; i < N; ++i)
573 if (_vals[i] != a._vals[i])
574 return true;
575 return false;
576}
577
578template <typename T>
581 std::vector<T> & eigval, RankTwoTensorTempl<T> & eigvec) const
582{
583 using std::abs;
584
585 // The calculate of projection tensor follows
586 // C. Miehe and M. Lambrecht, Commun. Numer. Meth. Engng 2001; 17:337~353
587
588 // Compute eigenvectors and eigenvalues of this tensor
589 if (MooseUtils::IsLikeReal<T>::value)
590 {
591 this->symmetricEigenvaluesEigenvectors(eigval, eigvec);
592
593 // Separate out positive and negative eigen values
594 std::array<T, N> epos;
595 std::array<T, N> d;
596 for (unsigned int i = 0; i < Ndim; ++i)
597 {
598 epos[i] = (abs(eigval[i]) + eigval[i]) / 2.0;
599 d[i] = 0 < eigval[i] ? 1.0 : 0.0;
600 }
601
602 // projection tensor
604
605 for (unsigned int a = 0; a < Ndim; ++a)
606 {
608 proj_pos += d[a] * Ma.outerProduct(Ma);
609 }
610
611 for (const auto a : make_range(Ndim))
612 for (const auto b : make_range(a))
613 {
616
618 for (const auto aa : make_range(N))
619 for (const auto bb : make_range(N))
620 {
621 const auto i = SymmetricRankFourTensorTempl<T>::full_index[aa][bb][0];
622 const auto j = SymmetricRankFourTensorTempl<T>::full_index[aa][bb][1];
623 const auto k = SymmetricRankFourTensorTempl<T>::full_index[aa][bb][2];
624 const auto l = SymmetricRankFourTensorTempl<T>::full_index[aa][bb][3];
625
626 Gabba(aa, bb) = (Ma(i, k) * Mb(j, l) + Ma(i, l) * Mb(j, k) + Ma(j, l) * Mb(i, k) +
627 Ma(j, k) * Mb(i, l)) *
629 }
630
631 T theta_ab;
632 if (!MooseUtils::relativeFuzzyEqual(eigval[a], eigval[b]))
633 theta_ab = 0.5 * (epos[a] - epos[b]) / (eigval[a] - eigval[b]);
634 else
635 theta_ab = 0.25 * (d[a] + d[b]);
636
637 proj_pos += theta_ab * Gabba;
638 }
639 return proj_pos;
640 }
641 else
642 mooseError("positiveProjectionEigenDecomposition is only available for ordered tensor "
643 "component types");
644}
645
646template <typename T>
647T
648SymmetricRankTwoTensorTempl<T>::sin3Lode(const T & r0, const T & r0_value) const
649{
650 using std::max, std::min, std::sqrt, std::pow;
651 if (MooseUtils::IsLikeReal<T>::value)
652 {
653 T bar = secondInvariant();
654 if (bar <= r0)
655 // in this case the Lode angle is not defined
656 return r0_value;
657 else
658 // the min and max here gaurd against precision-loss when bar is tiny but nonzero.
659 return max(min(thirdInvariant() * -1.5 * sqrt(3.0) / pow(bar, 1.5), 1.0), -1.0);
660 }
661 else
662 mooseError("sin3Lode is only available for ordered tensor component types");
663}
664
665template <typename T>
668{
669 using std::sqrt, std::pow;
670 if (MooseUtils::IsLikeReal<T>::value)
671 {
672 T bar = secondInvariant();
673 if (bar <= r0)
675 else
676 return -1.5 * sqrt(3.0) *
677 (dthirdInvariant() / pow(bar, 1.5) -
678 1.5 * dsecondInvariant() * thirdInvariant() / pow(bar, 2.5));
679 }
680 else
681 mooseError("dsin3Lode is only available for ordered tensor component types");
682}
683
684template <typename T>
685template <typename T2>
688{
689 for (const auto i : make_range(N))
690 (*this)(i) = a(i);
691 return *this;
692}
693
694// non-member operators
695
696template <typename T, typename Scalar>
697inline typename std::enable_if_t<
700operator*(const Scalar & factor, const SymmetricRankTwoTensorTempl<T> & t)
701{
702 return t * factor;
703}
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
OutputTools< Real >::VariableValue VariableValue
Definition MooseTypes.h:348
MooseArray< Real > VariableValue
std::enable_if_t< libMesh::ScalarTraits< Scalar >::value, SymmetricRankTwoTensorTempl< typename libMesh::CompareTypes< T, Scalar >::supertype > > operator*(const Scalar &factor, const SymmetricRankTwoTensorTempl< T > &t)
This class defines a Tensor that can change its shape.
forward declarations
Definition MooseArray.h:18
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition MooseEnum.h:55
RankTwoTensorTempl is designed to handle the Stress or Strain Tensor for a fully anisotropic material...
libMesh::VectorValue< T > column(const unsigned int i) const
Get the i-th column of the second order tensor.
SymmetricRankFourTensorTempl is designed to handle an N-dimensional fourth order tensor with minor sy...
FillMethod
To fill up the 6 entries in the 2nd-order tensor, fillFromInputVector is called with one of the follo...
static SymmetricRankTwoTensorTempl identity()
static constexpr unsigned int reverse_index[3][3]
libMesh::VectorValue< T > column(const unsigned int n) const
get the specified column of the tensor
T generalSecondInvariant() const
Calculates the second invariant (I2) of a tensor.
static constexpr std::array< Real, N > identityCoords
void printADReal(unsigned int nDual, std::ostream &stm=Moose::out) const
Print the Real part of the ADReal rank two tensor along with its first nDual dual numbers.
T operator()(unsigned int i, unsigned int j) const
Gets the value for the index specified.
libMesh::VectorValue< T > row(const unsigned int n) const
get the specified row of the tensor
SymmetricRankTwoTensorTempl(const std::vector< T > &input)
Constructor that proxies the fillFromInputVector method.
void rotate(const TypeTensor< T > &R)
rotates the tensor data given a rank two tensor rotation tensor _vals[i][j] = R_ij * R_jl * _vals[k][...
static constexpr Real mandelFactor(unsigned int i)
returns the 1 or sqrt(2) prefactor in the Mandel notation for the index i ranging from 0-5.
SymmetricRankTwoTensorTempl< T > deviatoric() const
returns A_ij - de_ij*tr(A)/3, where A are the _vals
SymmetricRankTwoTensorTempl< T > dsecondInvariant() const
Denote the _vals[i][j] by A_ij, then this returns d(secondInvariant)/dA_ij.
bool isSymmetric() const
Test for symmetry. Surprisingly this is always true.
T tr() const
Returns the trace.
friend void dataLoad(std::istream &, SymmetricRankTwoTensorTempl< T2 > &, void *)
friend std::ostream & operator<<(std::ostream &os, const SymmetricRankTwoTensorTempl< T > &t)
bool operator==(const SymmetricRankTwoTensorTempl< T2 > &a) const
Defines logical equality with another SymmetricRankTwoTensorTempl<T2>
void syev(const char *calculation_type, std::vector< T > &eigvals, std::vector< T > &a) const
Uses the petscblaslapack.h LAPACKsyev_ routine to find, for symmetric _vals: (1) the eigenvalues (if ...
SymmetricRankTwoTensorTempl< T > dsin3Lode(const T &r0) const
d(sin3Lode)/dA_ij If secondInvariant() <= r0 then return zero This is to gaurd against precision-loss...
void symmetricEigenvaluesEigenvectors(std::vector< T > &eigvals, RankTwoTensorTempl< T > &eigvecs) const
computes eigenvalues and eigenvectors, assuming tens is symmetric, and places them in ascending order...
SymmetricRankTwoTensorTempl< T > & operator=(const SymmetricRankTwoTensorTempl< T2 > &a)
sets _vals to a, and returns _vals
SymmetricRankFourTensorTempl< T > d2secondInvariant() const
Denote the _vals[i][j] by A_ij, then this returns d^2(secondInvariant)/dA_ij/dA_kl.
T L2norm() const
Sqrt(_vals[i][j]*_vals[i][j])
SymmetricRankTwoTensorTempl(const SymmetricRankTwoTensorTempl< T2 > &a)
Construct from other template.
void fillFromScalarVariable(const VariableValue &scalar_variable)
fillFromScalarVariable takes FIRST/THIRD/SIXTH order scalar variable to fill in the Rank-2 tensor.
SymmetricRankTwoTensorTempl< T > initialContraction(const SymmetricRankFourTensorTempl< T > &b) const
returns this_ij * b_ijkl
SymmetricRankTwoTensorTempl< T > transpose() const
Returns a matrix that is the transpose of the matrix this was called on.
T value_type
For generic programming.
SymmetricRankFourTensorTempl< T > d2thirdInvariant() const
Denote the _vals[i][j] by A_ij, then this returns d^2(thirdInvariant)/dA_ij/dA_kl.
TypeVector< typename libMesh::CompareTypes< T, T2 >::supertype > operator*(const TypeVector< T2 > &a) const
Defines multiplication with a vector to get a vector.
SymmetricRankTwoTensorTempl< T > operator-() const
returns -_vals
std::enable_if< libMesh::ScalarTraits< Scalar >::value, SymmetricRankTwoTensorTempl & >::type operator=(const Scalar &libmesh_dbg_var(p))
Assignment-from-scalar operator.
SymmetricRankTwoTensorTempl< T > dthirdInvariant() const
Denote the _vals[i][j] by A_ij, then this returns d(thirdInvariant()/dA_ij.
static void initRandom(unsigned int)
This function initializes random seed based on a user-defined number.
static SymmetricRankTwoTensorTempl< T > selfOuterProduct(const TypeVector< T > &)
SymmetricRankTwoTensorTempl<T> from outer product of a vector with itself.
SymmetricRankTwoTensorTempl< T > & operator/=(const T &a)
performs _vals /= a
SymmetricRankTwoTensorTempl< T > & operator*=(const T &a)
performs _vals *= a
static SymmetricRankTwoTensorTempl< T > timesTranspose(const RankTwoTensorTempl< T > &)
return the matrix multiplied with its transpose A*A^T (guaranteed symmetric)
SymmetricRankTwoTensorTempl< typename libMesh::CompareTypes< T, T2 >::supertype > operator+(const SymmetricRankTwoTensorTempl< T2 > &a) const
returns _vals + a
T doubleContraction(const SymmetricRankTwoTensorTempl< T > &a) const
returns _vals_ij * a_ij (sum on i, j)
SymmetricRankTwoTensorTempl< T > inverse() const
retuns the inverse of the tensor
static constexpr unsigned int Ndim
tensor dimension and Mandel vector length
void addIa(const T &a)
Add identity times a to _vals.
T & operator()(unsigned int i)
Gets the raw value for the index specified. Takes index = 0,1,2,3,4,5.
static SymmetricRankTwoTensorTempl< T > genRandomSymmTensor(T, T)
This function generates a random symmetric rank two tensor.
SymmetricRankFourTensorTempl< T > outerProduct(const SymmetricRankTwoTensorTempl< T > &a) const
returns C_ijkl = a_ij * b_kl
SymmetricRankTwoTensorTempl< T > & operator=(const ColumnMajorMatrixTempl< T > &a)
Sets _vals to the values in a ColumnMajorMatrix (must be 3x3)
T operator()(unsigned int i) const
Gets the raw value for the index specified.
SymmetricRankTwoTensorTempl< T > dtrace() const
Denote the _vals[i][j] by A_ij, then this returns d(trace)/dA_ij.
void print(std::ostream &stm=Moose::out) const
Print the rank two tensor.
static MooseEnum fillMethodEnum()
Static method for use in validParams for getting the "fill_method".
void fillFromInputVector(const std::vector< T > &input, FillMethod fill_method=autodetect)
fillFromInputVector takes 1, 3, or 6 inputs to fill in the symmmetric Rank-2 tensor.
static constexpr unsigned int full_index[6][2]
auto operator/(const T2 &a) const -> typename std::enable_if< libMesh::ScalarTraits< T2 >::value, SymmetricRankTwoTensorTempl< decltype(T()/T2())> >::type
returns _vals/a
void surfaceFillFromInputVector(const std::vector< T > &input)
sets _vals[0][0], _vals[0][1], _vals[1][0], _vals[1][1] to input, and the remainder to zero
bool operator!=(const SymmetricRankTwoTensorTempl< T2 > &a) const
Defines logical inequality with another SymmetricRankTwoTensorTempl<T2>
SymmetricRankTwoTensorTempl< T > square() const
Returns the matrix squared.
SymmetricRankTwoTensorTempl< T > ddet() const
Denote the _vals[i][j] by A_ij, then this returns d(det)/dA_ij.
SymmetricRankTwoTensorTempl< T > & operator+=(const SymmetricRankTwoTensorTempl< T > &a)
adds a to _vals
T thirdInvariant() const
Denote the _vals[i][j] by A_ij, then S_ij = A_ij - de_ij*tr(A)/3 Then this returns det(S + S....
friend void dataStore(std::ostream &, SymmetricRankTwoTensorTempl< T2 > &, void *)
void printReal(std::ostream &stm=Moose::out) const
Print the Real part of the ADReal rank two tensor.
static SymmetricRankTwoTensorTempl< T > plusTranspose(const RankTwoTensorTempl< T > &)
return the matrix plus its transpose A-A^T (guaranteed symmetric)
T secondInvariant() const
Denote the _vals[i][j] by A_ij, then S_ij = A_ij - de_ij*tr(A)/3 Then this returns (S_ij + S_ji)*(S_i...
T sin3Lode(const T &r0, const T &r0_value) const
Sin(3*Lode_angle) If secondInvariant() <= r0 then return r0_value This is to gaurd against precision-...
SymmetricRankFourTensorTempl< T > positiveProjectionEigenDecomposition(std::vector< T > &, RankTwoTensorTempl< T > &) const
return positive projection tensor of eigen-decomposition
SymmetricRankTwoTensorTempl< T > & operator-=(const SymmetricRankTwoTensorTempl< T > &a)
sets _vals -= a and returns vals
T trace() const
returns the trace of the tensor, ie _vals[i][i] (sum i = 0, 1, 2)
static SymmetricRankTwoTensorTempl fromRawComponents(const T &S11, const T &S22, const T &S33, const T &S23, const T &S13, const T &S12)
static constexpr unsigned int N
static SymmetricRankTwoTensorTempl< T > transposeTimes(const RankTwoTensorTempl< T > &)
return the matrix multiplied with its transpose A^T*A (guaranteed symmetric)
void setToIdentity()
set the tensor to the identity matrix
SymmetricRankTwoTensorTempl()
Default constructor; fills to zero.
void symmetricEigenvalues(std::vector< T > &eigvals) const
computes eigenvalues, assuming tens is symmetric, and places them in ascending order in eigvals
auto operator*(const T2 &a) const -> typename std::enable_if< libMesh::ScalarTraits< T2 >::value, SymmetricRankTwoTensorTempl< decltype(T() *T2())> >::type
returns _vals*a
static SymmetricRankTwoTensorTempl initializeSymmetric(const TypeVector< T > &v0, const TypeVector< T > &v1, const TypeVector< T > &v2)
named constructor for initializing symmetrically
void mooseSetToZero(T &v)
Helper function templates to set a variable to zero.
Definition MathUtils.h:373
void mooseSetToZero< SymmetricRankTwoTensor >(SymmetricRankTwoTensor &v)
Helper function template specialization to set an object to zero.
void mooseSetToZero< ADSymmetricRankTwoTensor >(ADSymmetricRankTwoTensor &v)
Helper function template specialization to set an object to zero.
static constexpr Real sqrt2
std::sqrt is not constexpr, so we add sqrt(2) as a constant (used in Mandel notation)
Definition MathUtils.h:25
We need to instantiate the following CompareTypes to tell the compiler that ADReal is a subtype of Ch...
auto raw_value(const Eigen::Map< T > &in)
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition Moose.h:165
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
MooseUnits pow(const MooseUnits &, int)
Definition Units.C:537
SymmetricRankTwoTensorTempl< typename RawType< T >::value_type > value_type
static value_type value(const SymmetricRankTwoTensorTempl< T > &in)