https://mooseframework.inl.gov
Loading...
Searching...
No Matches
FactorizedRankTwoTensor.C
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
13
14template <typename T>
15void
17{
18 this->get().print(stm);
19}
20
21template <typename T>
27
28template <typename T>
31{
32 return *this;
33}
34
35template <typename T>
38{
39 _eigvals = A._eigvals;
40 _eigvecs = A._eigvecs;
41 return *this;
42}
43
44template <typename T>
47{
48 A.symmetricEigenvaluesEigenvectors(_eigvals, _eigvecs);
49 return *this;
50}
51
52template <typename T>
54FactorizedRankTwoTensorTempl<T>::operator*=(const typename T::value_type & a)
55{
56 for (auto & eigval : _eigvals)
57 eigval *= a;
58 return *this;
59}
60
61template <typename T>
63FactorizedRankTwoTensorTempl<T>::operator/=(const typename T::value_type & a)
64{
65 for (auto & eigval : _eigvals)
66 eigval /= a;
67 return *this;
68}
69
70template <typename T>
71bool
73{
74 T me = get();
75 return me == A;
76}
77
78template <typename T>
79bool
81{
82 T me = get();
83 T you = A.get();
84 return me == you;
85}
86
87template <typename T>
90{
91 return FactorizedRankTwoTensorTempl<T>({1 / _eigvals[0], 1 / _eigvals[1], 1 / _eigvals[2]},
92 _eigvecs);
93}
94
95template <typename T>
96void
97FactorizedRankTwoTensorTempl<T>::addIa(const typename T::value_type & a)
98{
99 for (auto & eigval : _eigvals)
100 eigval += a;
101}
102
103template <typename T>
104typename T::value_type
106{
107 return _eigvals[0] + _eigvals[1] + _eigvals[2];
108}
109
110template <typename T>
111typename T::value_type
113{
114 return _eigvals[0] * _eigvals[1] * _eigvals[2];
115}
116
FactorizedRankTwoTensorTempl is designed to perform the spectral decomposition of an underlying symme...
FactorizedRankTwoTensorTempl< T > & operator*=(const typename T::value_type &a)
performs _A *= a in place, also updates eigen values
FactorizedRankTwoTensorTempl< T > transpose() const
Returns the transpose of _A.
T::value_type trace() const
trace of _A
FactorizedRankTwoTensorTempl< T > & operator/=(const typename T::value_type &a)
performs _A /= a in place, also updates eigen values
FactorizedRankTwoTensorTempl< T > rotated(const RankTwoTensorTempl< typename T::value_type > &R) const
T::value_type det() const
determinant of _A
std::vector< typename T::value_type > _eigvals
FactorizedRankTwoTensorTempl< T > inverse() const
inverse of _A
FactorizedRankTwoTensorTempl< T > & operator=(const FactorizedRankTwoTensorTempl< T > &A)
bool operator==(const T &A) const
Defines logical equality with another second order tensor.
void addIa(const typename T::value_type &a)
add identity times a to _A
RankTwoTensorTempl< typename T::value_type > _eigvecs
void print(std::ostream &stm=Moose::out) const
RankTwoTensorTempl is designed to handle the Stress or Strain Tensor for a fully anisotropic material...