23#include "libmesh/libmesh.h"
24#include "libmesh/tensor_value.h"
25#include "libmesh/vector_value.h"
26#include "libmesh/utility.h"
29#include <petscblaslapack.h>
39#include <Eigen/Eigenvalues>
68 return MooseEnum(
"autodetect=0 isotropic1=1 diagonal3=3 symmetric6=6 general=9",
"autodetect");
74 mooseAssert(N == 3,
"RankTwoTensorTempl is currently only tested for 3 dimensions.");
76 for (
unsigned int i = 0; i < N2; i++)
90 for (
const auto i : make_range(N))
95 mooseError(
"Unknown RankTwoTensorTempl initialization pattern.");
105 "This constructor is deprecated in favor of RankTwoTensorTempl<T>::initializeFromRows");
108 for (
const auto i : make_range(N))
109 _coords[i] = row1(i);
111 for (
const auto i : make_range(N))
112 _coords[N + i] = row2(i);
114 for (
const auto i : make_range(N))
115 _coords[2 * N + i] = row3(i);
125 (v1(0) + v0(1)) / 2.0,
126 (v2(0) + v0(2)) / 2.0,
127 (v1(0) + v0(1)) / 2.0,
129 (v2(1) + v1(2)) / 2.0,
130 (v2(0) + v0(2)) / 2.0,
131 (v2(1) + v1(2)) / 2.0,
142 row0(0), row1(0), row2(0), row0(1), row1(1), row2(1), row0(2), row1(2), row2(2));
152 col0(0), col0(1), col0(2), col1(0), col1(1), col1(2), col2(0), col2(1), col2(2));
157 const T & S11,
const T & S22,
const T & S33,
const T & S23,
const T & S13,
const T & S12)
162 (*this)(1, 2) = (*
this)(2, 1) = S23;
163 (*this)(0, 2) = (*
this)(2, 0) = S13;
164 (*this)(0, 1) = (*
this)(1, 0) = S12;
193 if (fill_method != autodetect && fill_method != input.size())
194 mooseError(
"Expected an input vector size of ", fill_method,
" to fill the RankTwoTensorTempl");
196 switch (input.size())
200 (*this)(0, 0) = input[0];
201 (*this)(1, 1) = input[0];
202 (*this)(2, 2) = input[0];
207 (*this)(0, 0) = input[0];
208 (*this)(1, 1) = input[1];
209 (*this)(2, 2) = input[2];
213 (*this)(0, 0) = input[0];
214 (*this)(1, 1) = input[1];
215 (*this)(2, 2) = input[2];
216 (*this)(1, 2) = (*
this)(2, 1) = input[3];
217 (*this)(0, 2) = (*
this)(2, 0) = input[4];
218 (*this)(0, 1) = (*
this)(1, 0) = input[5];
222 (*this)(0, 0) = input[0];
223 (*this)(1, 0) = input[1];
224 (*this)(2, 0) = input[2];
225 (*this)(0, 1) = input[3];
226 (*this)(1, 1) = input[4];
227 (*this)(2, 1) = input[5];
228 (*this)(0, 2) = input[6];
229 (*this)(1, 2) = input[7];
230 (*this)(2, 2) = input[8];
234 mooseError(
"Please check the number of entries in the input vector for building "
235 "a RankTwoTensorTempl. It must be 1, 3, 6, or 9");
243 switch (scalar_variable.
size())
247 (*this)(0, 0) = scalar_variable[0];
252 (*this)(0, 0) = scalar_variable[0];
253 (*this)(1, 1) = scalar_variable[1];
254 (*this)(0, 1) = (*
this)(1, 0) = scalar_variable[2];
258 (*this)(0, 0) = scalar_variable[0];
259 (*this)(1, 1) = scalar_variable[1];
260 (*this)(2, 2) = scalar_variable[2];
261 (*this)(1, 2) = (*
this)(2, 1) = scalar_variable[3];
262 (*this)(0, 2) = (*
this)(2, 0) = scalar_variable[4];
263 (*this)(0, 1) = (*
this)(1, 0) = scalar_variable[5];
267 mooseError(
"Only FIRST, THIRD, or SIXTH order scalar variable can be used to build "
268 "a RankTwoTensorTempl.");
304 return *
this * *
this;
321 for (
const auto i : make_range(N))
323 const auto i1 = i * N;
324 for (
const auto j : make_range(N))
328 const auto j1 = j * N;
342 for (
unsigned int i = 0; i < N2; i++)
350 using std::cos, std::sin;
353 T x = (*this)(0, 0) * c * c + (*
this)(1, 1) * s * s + 2.0 * (*
this)(0, 1) * c * s;
354 T y = (*this)(0, 0) * s * s + (*
this)(1, 1) * c * c - 2.0 * (*
this)(0, 1) * c * s;
355 T xy = ((*this)(1, 1) - (*
this)(0, 0)) * c * s + (*this)(0, 1) * (c * c - s * s);
361 b(1, 0) = b(0, 1) = xy;
424 for (
const auto i : make_range(N))
425 for (
const auto j : make_range(N))
426 if (!MooseUtils::absoluteFuzzyEqual((*
this)(i, j), a(i, j)))
437 return MooseUtils::absoluteFuzzyEqual(test.norm_sq(), 0);
444 if (a.
n() != N || a.
m() != N)
445 mooseError(
"Dimensions of ColumnMajorMatrixTempl<T> are incompatible with RankTwoTensorTempl");
447 const T * cmm_rawdata = a.
rawData();
448 for (
const auto i : make_range(N))
449 for (const auto j : make_range(N))
450 _coords[i * N + j] = cmm_rawdata[i + j * N];
469 for (
const auto i : make_range(N))
470 for (
const auto j : make_range(N))
471 for (
const auto k : make_range(N))
472 for (
const auto l : make_range(N))
473 result(i, k, l) += (*this)(i, j) * b(j, k, l);
484 for (
const auto i : make_range(N))
485 for (const auto j : make_range(N))
486 for (const auto k : make_range(N))
487 result(i, j, k) += (*this)(j, k) * b(i);
498 deviatoric.
addIa(-1.0 / 3.0 * this->tr());
506 return (*
this)(0, 0) * (*
this)(1, 1) + (*
this)(0, 0) * (*
this)(2, 2) +
507 (*
this)(1, 1) * (*
this)(2, 2) - (*
this)(0, 1) * (*
this)(1, 0) -
508 (*
this)(0, 2) * (*
this)(2, 0) - (*
this)(1, 2) * (*
this)(2, 1);
521 result = Utility::pow<2>((*
this)(0, 0) - (*
this)(1, 1)) / 6.0;
522 result += Utility::pow<2>((*
this)(0, 0) - (*
this)(2, 2)) / 6.0;
523 result += Utility::pow<2>((*
this)(1, 1) - (*
this)(2, 2)) / 6.0;
524 result += Utility::pow<2>((*
this)(0, 1) + (*
this)(1, 0)) / 4.0;
525 result += Utility::pow<2>((*
this)(0, 2) + (*
this)(2, 0)) / 4.0;
526 result += Utility::pow<2>((*
this)(1, 2) + (*
this)(2, 1)) / 4.0;
542 for (
const auto i : make_range(N))
543 for (
const auto j : make_range(N))
544 for (
const auto k : make_range(N))
545 for (
const auto l : make_range(N))
546 result(i, j, k, l) = 0.5 * (i == k) * (j == l) + 0.5 * (i == l) * (j == k) -
547 (1.0 / 3.0) * (i == j) * (k == l);
578 return s(0, 0) * (s(1, 1) * s(2, 2) - s(2, 1) * s(1, 2)) -
579 s(1, 0) * (s(0, 1) * s(2, 2) - s(2, 1) * s(0, 2)) +
580 s(2, 0) * (s(0, 1) * s(1, 2) - s(1, 1) * s(0, 2));
588 const T s3 = secondInvariant() / 3.0;
591 d(0, 0) = s(1, 1) * s(2, 2) - s(2, 1) * s(1, 2) + s3;
592 d(0, 1) = s(2, 0) * s(1, 2) - s(1, 0) * s(2, 2);
593 d(0, 2) = s(1, 0) * s(2, 1) - s(2, 0) * s(1, 1);
594 d(1, 0) = s(2, 1) * s(0, 2) - s(0, 1) * s(2, 2);
595 d(1, 1) = s(0, 0) * s(2, 2) - s(2, 0) * s(0, 2) + s3;
596 d(1, 2) = s(2, 0) * s(0, 1) - s(0, 0) * s(2, 1);
597 d(2, 0) = s(0, 1) * s(1, 2) - s(1, 1) * s(0, 2);
598 d(2, 1) = s(1, 0) * s(0, 2) - s(0, 0) * s(1, 2);
599 d(2, 2) = s(0, 0) * s(1, 1) - s(1, 0) * s(0, 1) + s3;
610 for (
const auto i : make_range(N))
611 for (
const auto j : make_range(N))
612 for (
const auto k : make_range(N))
613 for (
const auto l : make_range(N))
615 d2(i, j, k, l) = Real(i == j) * s(k, l) / 3.0 + Real(k == l) * s(i, j) / 3.0;
627 d2(0, 0, 1, 1) += s(2, 2);
628 d2(0, 0, 1, 2) -= s(2, 1);
629 d2(0, 0, 2, 1) -= s(1, 2);
630 d2(0, 0, 2, 2) += s(1, 1);
632 d2(0, 1, 0, 1) -= s(2, 2) / 2.0;
633 d2(0, 1, 1, 0) -= s(2, 2) / 2.0;
634 d2(0, 1, 0, 2) += s(1, 2) / 2.0;
635 d2(0, 1, 2, 0) += s(1, 2) / 2.0;
636 d2(0, 1, 1, 2) += s(2, 0) / 2.0;
637 d2(0, 1, 2, 1) += s(2, 0) / 2.0;
638 d2(0, 1, 2, 2) -= s(1, 0);
640 d2(0, 2, 0, 1) += s(2, 1) / 2.0;
641 d2(0, 2, 1, 0) += s(2, 1) / 2.0;
642 d2(0, 2, 0, 2) -= s(1, 1) / 2.0;
643 d2(0, 2, 2, 0) -= s(1, 1) / 2.0;
644 d2(0, 2, 1, 1) -= s(2, 0);
645 d2(0, 2, 1, 2) += s(1, 0) / 2.0;
646 d2(0, 2, 2, 1) += s(1, 0) / 2.0;
648 d2(1, 0, 0, 1) -= s(2, 2) / 2.0;
649 d2(1, 0, 1, 0) -= s(2, 2) / 2.0;
650 d2(1, 0, 0, 2) += s(1, 2) / 2.0;
651 d2(1, 0, 2, 0) += s(1, 2) / 2.0;
652 d2(1, 0, 1, 2) += s(2, 0) / 2.0;
653 d2(1, 0, 2, 1) += s(2, 0) / 2.0;
654 d2(1, 0, 2, 2) -= s(1, 0);
656 d2(1, 1, 0, 0) += s(2, 2);
657 d2(1, 1, 0, 2) -= s(2, 0);
658 d2(1, 1, 2, 0) -= s(2, 0);
659 d2(1, 1, 2, 2) += s(0, 0);
661 d2(1, 2, 0, 0) -= s(2, 1);
662 d2(1, 2, 0, 1) += s(2, 0) / 2.0;
663 d2(1, 2, 1, 0) += s(2, 0) / 2.0;
664 d2(1, 2, 0, 2) += s(0, 1) / 2.0;
665 d2(1, 2, 2, 0) += s(0, 1) / 2.0;
666 d2(1, 2, 1, 2) -= s(0, 0) / 2.0;
667 d2(1, 2, 2, 1) -= s(0, 0) / 2.0;
669 d2(2, 0, 0, 1) += s(2, 1) / 2.0;
670 d2(2, 0, 1, 0) += s(2, 1) / 2.0;
671 d2(2, 0, 0, 2) -= s(1, 1) / 2.0;
672 d2(2, 0, 2, 0) -= s(1, 1) / 2.0;
673 d2(2, 0, 1, 1) -= s(2, 0);
674 d2(2, 0, 1, 2) += s(1, 0) / 2.0;
675 d2(2, 0, 2, 1) += s(1, 0) / 2.0;
677 d2(2, 1, 0, 0) -= s(2, 1);
678 d2(2, 1, 0, 1) += s(2, 0) / 2.0;
679 d2(2, 1, 1, 0) += s(2, 0) / 2.0;
680 d2(2, 1, 0, 2) += s(0, 1) / 2.0;
681 d2(2, 1, 2, 0) += s(0, 1) / 2.0;
682 d2(2, 1, 1, 2) -= s(0, 0) / 2.0;
683 d2(2, 1, 2, 1) -= s(0, 0) / 2.0;
685 d2(2, 2, 0, 0) += s(1, 1);
686 d2(2, 2, 0, 1) -= s(1, 0);
687 d2(2, 2, 1, 0) -= s(1, 0);
688 d2(2, 2, 1, 1) += s(0, 0);
699 d(0, 0) = (*this)(1, 1) * (*
this)(2, 2) - (*
this)(2, 1) * (*
this)(1, 2);
700 d(0, 1) = (*this)(2, 0) * (*
this)(1, 2) - (*
this)(1, 0) * (*
this)(2, 2);
701 d(0, 2) = (*this)(1, 0) * (*
this)(2, 1) - (*
this)(2, 0) * (*
this)(1, 1);
702 d(1, 0) = (*this)(2, 1) * (*
this)(0, 2) - (*
this)(0, 1) * (*
this)(2, 2);
703 d(1, 1) = (*this)(0, 0) * (*
this)(2, 2) - (*
this)(2, 0) * (*
this)(0, 2);
704 d(1, 2) = (*this)(2, 0) * (*
this)(0, 1) - (*
this)(0, 0) * (*
this)(2, 1);
705 d(2, 0) = (*this)(0, 1) * (*
this)(1, 2) - (*
this)(1, 1) * (*
this)(0, 2);
706 d(2, 1) = (*this)(1, 0) * (*
this)(0, 2) - (*
this)(0, 0) * (*
this)(1, 2);
707 d(2, 2) = (*this)(0, 0) * (*
this)(1, 1) - (*
this)(1, 0) * (*
this)(0, 1);
717 for (
const auto i : make_range(N))
719 for (
const auto j : make_range(N))
720 stm << std::setw(15) << a(i, j) <<
' ';
738 for (
const auto i : make_range(N))
747 for (
const auto i : make_range(N2))
753 return norm == 0.0 ? 0.0 : sqrt(norm);
760 if (input.size() == 4)
764 (*this)(0, 0) = input[0];
765 (*this)(0, 1) = input[1];
766 (*this)(1, 0) = input[2];
767 (*this)(1, 1) = input[3];
770 mooseError(
"please provide correct number of values for surface RankTwoTensorTempl<T> "
778 mooseError(
"The syev method is only supported for Real valued tensors");
783 std::vector<Real> & eigvals,
784 std::vector<Real> & a)
const;
791 symmetricEigenvaluesEigenvectors(eigvals, a);
803 "symmetricEigenvaluesEigenvectors is only available for ordered tensor component types");
822 syev(
"V", eigvals, a);
826 std::vector<T> eig_vec;
829 for (
const auto i : make_range(N))
831 for (
const auto j : make_range(N))
832 eig_vec[j] = a[i * N + j];
833 for (
const auto j : make_range(N))
834 for (
const auto k : make_range(N))
835 deigvals[i](j, k) = eig_vec[j] * eig_vec[k];
843 if (eigvals[0] == eigvals[1] && eigvals[0] == eigvals[2])
844 deigvals[0] = deigvals[1] = deigvals[2] = (deigvals[0] + deigvals[1] + deigvals[2]) / 3.0;
845 else if (eigvals[0] == eigvals[1])
846 deigvals[0] = deigvals[1] = (deigvals[0] + deigvals[1]) / 2.0;
847 else if (eigvals[0] == eigvals[2])
848 deigvals[0] = deigvals[2] = (deigvals[0] + deigvals[2]) / 2.0;
849 else if (eigvals[1] == eigvals[2])
850 deigvals[1] = deigvals[2] = (deigvals[1] + deigvals[2]) / 2.0;
857 std::vector<T> eigvec;
858 std::vector<T> eigvals;
865 syev(
"V", eigvals, eigvec);
867 for (
const auto i : make_range(N))
868 for (const auto j : make_range(N))
869 ev[i][j] = eigvec[i * N + j];
871 for (
unsigned int alpha = 0; alpha < N; ++alpha)
872 for (
unsigned int beta = 0; beta < N; ++beta)
874 if (eigvals[alpha] == eigvals[beta])
877 for (
const auto i : make_range(N))
878 for (
const auto j : make_range(N))
879 for (
const auto k : make_range(N))
880 for (
const auto l : make_range(N))
882 deriv[alpha](i, j, k, l) +=
883 0.5 * (ev[beta][i] * ev[alpha][j] + ev[alpha][i] * ev[beta][j]) *
884 (ev[beta][k] * ev[alpha][l] + ev[beta][l] * ev[alpha][k]) /
885 (eigvals[alpha] - eigvals[beta]);
894 mooseError(
"getRUDecompositionRotation is only supported for Real valued tensors");
912 for (
const auto i : make_range(N))
913 for (
const auto j : make_range(N))
932 for (
const auto i : make_range(N))
933 for (
const auto j : make_range(N))
934 a(i, j) = v1(i) * v2(j);
943 for (
const auto i : make_range(N))
944 for (
const auto j : make_range(N))
945 result(i, j) = v1(i) * v2(j);
954 for (
unsigned int i = 0; i < N; ++i)
955 for (
unsigned int j = 0; j < N; ++j)
956 result(i, j) = v(i) * v(j);
964 for (
const auto i : make_range(N))
965 for (
const auto j : make_range(N))
966 tensor(i, j) = (*this)(i, j);
973 for (
const auto i : make_range(N))
974 (*
this)(r, i) = v(i);
981 for (
const auto i : make_range(N))
982 (*
this)(i, c) = v(i);
990 for (
const auto i : make_range(N))
991 for (const auto j : make_range(N))
992 for (const auto k : make_range(N))
993 for (const auto l : make_range(N))
994 result(k, l) += (*this)(i, j) * b(i, j, k, l);
1002 mooseAssert(N2 == 9,
"RankTwoTensorTempl is currently only tested for 3 dimensions.");
1003 for (
const auto i : make_range(N2))
1004 _coords[i] = identityCoords[i];
DualNumber< Real, DNDerivativeType, true > ADReal
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
for(PetscInt i=0;i< nvars;++i)
void ErrorVector unsigned int
This class defines a Tensor that can change its shape.
unsigned int n() const
Returns the number of rows.
T * rawData()
Returns a reference to the raw data pointer.
unsigned int m() const
Returns the number of columns.
unsigned int size() const
The number of elements that can currently be stored in the array.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
static Real rand()
This method returns the next random number (Real format) from the generator.
static void seed(unsigned int seed)
The method seeds the random number generator.
RankFourTensorTempl is designed to handle any N-dimensional fourth order tensor, C.
RankThreeTensor is designed to handle any N-dimensional third order tensor, r.
RankTwoTensorTempl is designed to handle the Stress or Strain Tensor for a fully anisotropic material...
void setToIdentity()
Set the tensor to identity.
static RankTwoTensorTempl initializeFromRows(const libMesh::TypeVector< T > &row0, const libMesh::TypeVector< T > &row1, const libMesh::TypeVector< T > &row2)
Named constructor for initializing from row vectors.
static void initRandom(unsigned int)
Initialize the random seed based on an unsigned integer.
static RankTwoTensorTempl initializeFromColumns(const libMesh::TypeVector< T > &col0, const libMesh::TypeVector< T > &col1, const libMesh::TypeVector< T > &col2)
Named constructor for initializing from row vectors.
void fillFromScalarVariable(const VariableValue &scalar_variable)
The smart mutator that determines how to fill the second order tensor based on the order of the scala...
T trace() const
A wrapper for tr()
void dsymmetricEigenvalues(std::vector< T > &eigvals, std::vector< RankTwoTensorTempl< T > > &deigvals) const
computes eigenvalues, and their symmetric derivatives wrt vals, assuming tens is symmetric
static RankTwoTensorTempl< T > selfOuterProduct(const libMesh::TypeVector< T > &)
Initialize a second order tensor as the outer product of a vector with itself, i.e.
RankTwoTensorTempl< T > operator-() const
Return the negation of this tensor.
RankThreeTensorTempl< T > mixedProductJkI(const libMesh::VectorValue< T > &b) const
Return the tensor product of this second order tensor with a vector .
void addIa(const T &a)
Add identity times a to _coords.
static RankTwoTensorTempl< T > plusTranspose(const RankTwoTensorTempl< T > &)
Initialize a second order tensor with expression .
RankThreeTensorTempl< T > contraction(const RankThreeTensorTempl< T > &b) const
Return the single contraction of this second order tensor with a third order tensor .
static MooseEnum fillMethodEnum()
Get the available FillMethod options.
RankTwoTensorTempl< T > ddet() const
Denote the _coords[i][j] by A_ij, then this returns d(det)/dA_ij.
static RankTwoTensorTempl< T > outerProduct(const libMesh::TypeVector< T > &, const libMesh::TypeVector< T > &)
Initialize a second order tensor as the outer product of two vectors, i.e.
T doubleContraction(const RankTwoTensorTempl< T > &a) const
Return the double contraction with another second order tensor .
void fillRow(unsigned int r, const libMesh::TypeVector< T > &v)
Assign values to a specific row of the second order tensor.
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 _coords: (1) the eigenvalues (i...
T thirdInvariant() const
Denote the _coords[i][j] by A_ij, then S_ij = A_ij - de_ij*tr(A)/3 Then this returns det(S + S....
RankTwoTensorTempl< T > & operator=(const RankTwoTensorTempl< T > &a)=default
Assignment operator.
RankTwoTensorTempl< T > inverse() const
Return the inverse of this second order tensor.
bool isSymmetric() const
Test for symmetry.
void getRUDecompositionRotation(RankTwoTensorTempl< T > &rot) const
Uses the petscblaslapack.h LAPACKsyev_ routine to perform RU decomposition and obtain the rotation te...
void printReal(std::ostream &stm=Moose::out) const
Print the Real part of the RankTwoTensorTempl<ADReal>
void rotate(const RankTwoTensorTempl< T > &R)
Rotate the tensor in-place given a rotation tensor .
RankTwoTensorTempl< T > transpose() const
Return the tensor transposed.
void print(std::ostream &stm=Moose::out) const
Print the rank two tensor.
T generalSecondInvariant() const
Return the principal second invariant of this second order tensor.
void fillFromInputVector(const std::vector< T > &input, FillMethod fill_method=autodetect)
The smart mutator that determines how to fill the second order tensor based on the size of the input ...
void vectorOuterProduct(const libMesh::TypeVector< T > &, const libMesh::TypeVector< T > &)
Set the values of the second order tensor to be the outer product of two vectors, i....
T secondInvariant() const
Return the main second invariant of this second order tensor.
InitMethod
The initialization method.
RankTwoTensorTempl< T > dthirdInvariant() const
Denote the _coords[i][j] by A_ij, then this returns d(thirdInvariant()/dA_ij.
void d2symmetricEigenvalues(std::vector< RankFourTensorTempl< T > > &deriv) const
Computes second derivatives of Eigenvalues of a rank two tensor.
static RankTwoTensorTempl< T > genRandomSymmTensor(T stddev, T mean)
Generate a random symmetric second order tensor with the 6 upper-triangular components treated as ind...
static RankTwoTensorTempl< T > transposeTimes(const RankTwoTensorTempl< T > &)
Initialize a second order tensor with expression .
RankTwoTensorTempl< T > & operator*=(const T &a)
Multiply this tensor by a scalar (component-wise)
libMesh::VectorValue< T > column(const unsigned int i) const
Get the i-th column of the second order tensor.
RankTwoTensorTempl< T > & operator/=(const T &a)
Divide this tensor by a scalar (component-wise)
FillMethod
To fill up the 9 entries in the 2nd-order tensor, fillFromInputVector is called with one of the follo...
void surfaceFillFromInputVector(const std::vector< T > &input)
sets _coords[0][0], _coords[0][1], _coords[1][0], _coords[1][1] to input, and the remainder to zero
bool operator==(const RankTwoTensorTempl< T > &a) const
Defines logical equality with another RankTwoTensorTempl<T>
static RankTwoTensorTempl< T > genRandomTensor(T stddev, T mean)
Generate a random second order tensor with all 9 components treated as independent random variables f...
RankTwoTensorTempl< T > & operator-=(const RankTwoTensorTempl< T > &a)
Subtract another second order tensor from this one.
void fillRealTensor(libMesh::TensorValue< T > &)
Fill a libMesh::TensorValue<T> from this second order tensor.
RankFourTensorTempl< T > d2thirdInvariant() const
Denote the _coords[i][j] by A_ij, then this returns d^2(thirdInvariant)/dA_ij/dA_kl.
void symmetricEigenvalues(std::vector< T > &eigvals) const
computes eigenvalues, assuming tens is symmetric, and places them in ascending order in eigvals
RankTwoTensorTempl< T > dsecondInvariant() const
Return the derivative of the main second invariant w.r.t.
void fillColumn(unsigned int c, const libMesh::TypeVector< T > &v)
Assign values to a specific column of the second order tensor.
RankTwoTensorTempl< T > rotateXyPlane(T a)
Rotate the tensor about the z-axis.
T L2norm() const
Sqrt(_coords[i][j]*_coords[i][j])
RankTwoTensorTempl< T > dtrace() const
Return the derivative of the trace w.r.t.
RankTwoTensorTempl< T > deviatoric() const
Return the deviatoric part of this tensor .
RankTwoTensorTempl< T > & operator+=(const RankTwoTensorTempl< T > &a)
Add another second order tensor to this one.
RankFourTensorTempl< T > d2secondInvariant() const
Return the second derivative of the main second invariant w.r.t.
void symmetricEigenvaluesEigenvectors(std::vector< T > &eigvals, RankTwoTensorTempl< T > &eigvecs) const
computes eigenvalues and eigenvectors, assuming tens is symmetric, and places them in ascending order...
RankTwoTensorTempl< T > initialContraction(const RankFourTensorTempl< T > &b) const
returns this_ij * b_ijkl
static RankTwoTensorTempl initializeSymmetric(const libMesh::TypeVector< T > &v0, const libMesh::TypeVector< T > &v1, const libMesh::TypeVector< T > &v2)
Named constructor for initializing symmetrically.
RankTwoTensorTempl< T > rotated(const RankTwoTensorTempl< T > &R) const
Return the rotated tensor given a rotation tensor .
static RankTwoTensorTempl< T > timesTranspose(const RankTwoTensorTempl< T > &)
Initialize a second order tensor with expression .
void printADReal(unsigned int nDual, std::ostream &stm=Moose::out) const
Print the Real part of the RankTwoTensorTempl<ADReal> along with its first nDual dual numbers.
RankTwoTensorTempl()
Empty constructor; fills to zero.
RankTwoTensorTempl< T > square() const
Return .
T _coords[LIBMESH_DIM *LIBMESH_DIM]
void mooseSetToZero< ADRankTwoTensor >(ADRankTwoTensor &v)
Helper function template specialization to set an object to zero.
void mooseSetToZero< RankTwoTensor >(RankTwoTensor &v)
Helper function template specialization to set an object to zero.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static int run(const ADReal &x)