RankThreeTensor is designed to handle any N-dimensional third order tensor, r. More...
#include <RankThreeTensor.h>
Public Types | |
enum | InitMethod { initNone } |
Initialization method. More... | |
enum | FillMethod { automatic, general, plane_normal } |
To fill up the 27 entries in the 3rd-order tensor, fillFromInputVector is called with one of the following fill_methods. More... | |
Public Member Functions | |
RankThreeTensorTempl () | |
Default constructor; fills to zero. More... | |
RankThreeTensorTempl (const RankThreeTensorTempl< T > &a)=default | |
Copy assignment operator must be defined if used. More... | |
template<typename T2 > | |
RankThreeTensorTempl (const RankThreeTensorTempl< T2 > ©) | |
Construct from other class template instantiation. More... | |
RankThreeTensorTempl (const InitMethod) | |
Select specific initialization pattern. More... | |
RankThreeTensorTempl (const std::vector< T > &, FillMethod method=automatic) | |
Fill from vector. More... | |
T & | operator() (unsigned int i, unsigned int j, unsigned int k) |
Gets the value for the index specified. Takes index = 0,1,2. More... | |
T | operator() (unsigned int i, unsigned int j, unsigned int k) const |
Gets the value for the index specified. Takes index = 0,1,2. Used for const. More... | |
RankThreeTensorTempl< T > & | operator= (const T &value) |
Assignment-from-scalar operator. More... | |
void | zero () |
Zeros out the tensor. More... | |
void | print (std::ostream &stm=Moose::out) const |
Print the rank three tensor. More... | |
RankThreeTensorTempl< T > & | operator= (const RankThreeTensorTempl< T > &a) |
copies values from "a" into this tensor More... | |
template<typename T2 > | |
RankThreeTensorTempl< T > & | operator= (const RankThreeTensorTempl< T2 > &a) |
VectorValue< T > | operator* (const RankTwoTensorTempl< T > &a) const |
b_i = r_ijk * a_jk More... | |
RankThreeTensorTempl< T > | operator* (const T a) const |
r_ijk*a More... | |
RankThreeTensorTempl< T > & | operator*= (const T a) |
r_ijk *= a More... | |
RankThreeTensorTempl< T > | operator/ (const T a) const |
r_ijk/a More... | |
RankThreeTensorTempl< T > & | operator/= (const T a) |
r_ijk /= a for all i, j, k More... | |
RankThreeTensorTempl< T > & | operator+= (const RankThreeTensorTempl< T > &a) |
r_ijk += a_ijk for all i, j, k More... | |
RankThreeTensorTempl< T > | operator+ (const RankThreeTensorTempl< T > &a) const |
r_ijkl + a_ijk More... | |
RankThreeTensorTempl< T > & | operator-= (const RankThreeTensorTempl< T > &a) |
r_ijk -= a_ijk More... | |
RankThreeTensorTempl< T > | operator- (const RankThreeTensorTempl< T > &a) const |
r_ijk - a_ijk More... | |
RankThreeTensorTempl< T > | operator- () const |
-r_ijk More... | |
T | L2norm () const |
(r_ijk*r_ijk) More... | |
template<class T2 > | |
void | rotate (const T2 &R) |
Rotate the tensor using r_ijk = R_im R_in R_ko r_mno. More... | |
void | rotate (const TensorValue< T > &R) |
Rotate the tensor using r_ijk = R_im R_in R_ko r_mno. More... | |
void | fillFromInputVector (const std::vector< T > &input, FillMethod fill_method=automatic) |
fillFromInputVector takes some number of inputs to fill the Rank-3 tensor. More... | |
void | fillFromPlaneNormal (const VectorValue< T > &input) |
Fills RankThreeTensor from plane normal vectors ref. More... | |
RankFourTensorTempl< T > | mixedProductRankFour (const RankTwoTensorTempl< T > &a) const |
Creates fourth order tensor D_{ijkl}=A_{mij}*b_{mn}*A_{nkl} where A is rank 3 and b is rank 2. More... | |
VectorValue< T > | doubleContraction (const RankTwoTensorTempl< T > &b) const |
Creates a vector from the double contraction of a rank three and rank two tensor. More... | |
Static Public Member Functions | |
static MooseEnum | fillMethodEnum () |
Static method for use in validParams for getting the "fill_method". More... | |
Static Public Attributes | |
static constexpr unsigned int | N = Moose::dim |
tensor dimension and powers of the dimension More... | |
static constexpr unsigned int | N2 = N * N |
static constexpr unsigned int | N3 = N * N * N |
Protected Member Functions | |
void | fillGeneralFromInputVector (const std::vector< T > &input) |
Protected Attributes | |
T | _vals [N3] |
The values of the rank-three tensor stored by index=((i * LIBMESH_DIM + j) * LIBMESH_DIM + k) More... | |
Friends | |
template<class T2 > | |
class | RankTwoTensorTempl |
template<class T2 > | |
class | RankThreeTensorTempl |
template<class T2 > | |
class | RankFourTensorTempl |
template<class T2 > | |
void | dataStore (std::ostream &, RankThreeTensorTempl< T2 > &, void *) |
template<class T2 > | |
void | dataLoad (std::istream &, RankThreeTensorTempl< T2 > &, void *) |
RankThreeTensor is designed to handle any N-dimensional third order tensor, r.
Definition at line 56 of file RankThreeTensor.h.
enum RankThreeTensorTempl::FillMethod |
To fill up the 27 entries in the 3rd-order tensor, fillFromInputVector is called with one of the following fill_methods.
See the fill*FromInputVector functions for more details
Enumerator | |
---|---|
automatic | |
general | |
plane_normal |
Definition at line 76 of file RankThreeTensor.h.
enum RankThreeTensorTempl::InitMethod |
RankThreeTensorTempl< T >::RankThreeTensorTempl | ( | ) |
Default constructor; fills to zero.
Definition at line 45 of file RankThreeTensorImplementation.h.
|
default |
Copy assignment operator must be defined if used.
RankThreeTensorTempl< T >::RankThreeTensorTempl | ( | const RankThreeTensorTempl< T2 > & | copy | ) |
Construct from other class template instantiation.
Definition at line 251 of file RankThreeTensor.h.
RankThreeTensorTempl< T >::RankThreeTensorTempl | ( | const InitMethod | init | ) |
Select specific initialization pattern.
Definition at line 54 of file RankThreeTensorImplementation.h.
RankThreeTensorTempl< T >::RankThreeTensorTempl | ( | const std::vector< T > & | input, |
FillMethod | method = automatic |
||
) |
Fill from vector.
Definition at line 67 of file RankThreeTensorImplementation.h.
VectorValue< T > RankThreeTensorTempl< T >::doubleContraction | ( | const RankTwoTensorTempl< T > & | b | ) | const |
Creates a vector from the double contraction of a rank three and rank two tensor.
c_i = A_{ijk} * b_{jk}
Definition at line 356 of file RankThreeTensorImplementation.h.
void RankThreeTensorTempl< T >::fillFromInputVector | ( | const std::vector< T > & | input, |
FillMethod | fill_method = automatic |
||
) |
fillFromInputVector takes some number of inputs to fill the Rank-3 tensor.
input | the numbers that will be placed in the tensor |
fill_method | this can be: general (use fillGeneralFromInputVector) more fill_methods to be implemented soon! |
Definition at line 232 of file RankThreeTensorImplementation.h.
void RankThreeTensorTempl< T >::fillFromPlaneNormal | ( | const VectorValue< T > & | input | ) |
Fills RankThreeTensor from plane normal vectors ref.
Kuhl et. al. Int. J. Solids Struct. 38(2001) 2933-2952
input | plane normal vector |
Definition at line 268 of file RankThreeTensorImplementation.h.
|
protected |
Definition at line 342 of file RankThreeTensorImplementation.h.
|
static |
Static method for use in validParams for getting the "fill_method".
Definition at line 39 of file RankThreeTensorImplementation.h.
T RankThreeTensorTempl< T >::L2norm | ( | ) | const |
(r_ijk*r_ijk)
Definition at line 220 of file RankThreeTensorImplementation.h.
RankFourTensorTempl< T > RankThreeTensorTempl< T >::mixedProductRankFour | ( | const RankTwoTensorTempl< T > & | a | ) | const |
Creates fourth order tensor D_{ijkl}=A_{mij}*b_{mn}*A_{nkl} where A is rank 3 and b is rank 2.
a | RankThreeTensor A in the equation above |
Definition at line 294 of file RankThreeTensorImplementation.h.
|
inline |
Gets the value for the index specified. Takes index = 0,1,2.
Definition at line 102 of file RankThreeTensor.h.
|
inline |
Gets the value for the index specified. Takes index = 0,1,2. Used for const.
Definition at line 108 of file RankThreeTensor.h.
VectorValue< T > RankThreeTensorTempl< T >::operator* | ( | const RankTwoTensorTempl< T > & | a | ) | const |
b_i = r_ijk * a_jk
Definition at line 101 of file RankThreeTensorImplementation.h.
RankThreeTensorTempl< T > RankThreeTensorTempl< T >::operator* | ( | const T | a | ) | const |
r_ijk*a
Definition at line 120 of file RankThreeTensorImplementation.h.
RankThreeTensorTempl< T > & RankThreeTensorTempl< T >::operator*= | ( | const T | a | ) |
r_ijk *= a
Definition at line 132 of file RankThreeTensorImplementation.h.
RankThreeTensorTempl< T > RankThreeTensorTempl< T >::operator+ | ( | const RankThreeTensorTempl< T > & | a | ) | const |
r_ijkl + a_ijk
Definition at line 174 of file RankThreeTensorImplementation.h.
RankThreeTensorTempl< T > & RankThreeTensorTempl< T >::operator+= | ( | const RankThreeTensorTempl< T > & | a | ) |
r_ijk += a_ijk for all i, j, k
Definition at line 164 of file RankThreeTensorImplementation.h.
RankThreeTensorTempl< T > RankThreeTensorTempl< T >::operator- | ( | const RankThreeTensorTempl< T > & | a | ) | const |
r_ijk - a_ijk
Definition at line 196 of file RankThreeTensorImplementation.h.
RankThreeTensorTempl< T > RankThreeTensorTempl< T >::operator- | ( | ) | const |
-r_ijk
Definition at line 208 of file RankThreeTensorImplementation.h.
RankThreeTensorTempl< T > & RankThreeTensorTempl< T >::operator-= | ( | const RankThreeTensorTempl< T > & | a | ) |
r_ijk -= a_ijk
Definition at line 186 of file RankThreeTensorImplementation.h.
RankThreeTensorTempl< T > RankThreeTensorTempl< T >::operator/ | ( | const T | a | ) | const |
r_ijk/a
Definition at line 142 of file RankThreeTensorImplementation.h.
RankThreeTensorTempl< T > & RankThreeTensorTempl< T >::operator/= | ( | const T | a | ) |
r_ijk /= a for all i, j, k
Definition at line 154 of file RankThreeTensorImplementation.h.
RankThreeTensorTempl< T > & RankThreeTensorTempl< T >::operator= | ( | const T & | value | ) |
Assignment-from-scalar operator.
Definition at line 82 of file RankThreeTensorImplementation.h.
RankThreeTensorTempl< T > & RankThreeTensorTempl< T >::operator= | ( | const RankThreeTensorTempl< T > & | a | ) |
copies values from "a" into this tensor
Definition at line 91 of file RankThreeTensorImplementation.h.
RankThreeTensorTempl< T > & RankThreeTensorTempl< T >::operator= | ( | const RankThreeTensorTempl< T2 > & | a | ) |
Definition at line 310 of file RankThreeTensor.h.
void RankThreeTensorTempl< T >::print | ( | std::ostream & | stm = Moose::out | ) | const |
Print the rank three tensor.
Definition at line 369 of file RankThreeTensorImplementation.h.
Rotate the tensor using r_ijk = R_im R_in R_ko r_mno.
Definition at line 260 of file RankThreeTensor.h.
void RankThreeTensorTempl< T >::rotate | ( | const TensorValue< T > & | R | ) |
Rotate the tensor using r_ijk = R_im R_in R_ko r_mno.
Definition at line 315 of file RankThreeTensorImplementation.h.
void RankThreeTensorTempl< T >::zero | ( | ) |
Zeros out the tensor.
Definition at line 74 of file RankThreeTensorImplementation.h.
|
friend |
|
friend |
Definition at line 226 of file RankThreeTensor.h.
Definition at line 223 of file RankThreeTensor.h.
Definition at line 220 of file RankThreeTensor.h.
|
protected |
The values of the rank-three tensor stored by index=((i * LIBMESH_DIM + j) * LIBMESH_DIM + k)
Definition at line 209 of file RankThreeTensor.h.
Referenced by dataLoad(), dataStore(), RankThreeTensorTempl< T >::operator()(), RankThreeTensorTempl< T >::operator*(), RankThreeTensorTempl< T >::operator+(), RankThreeTensorTempl< T >::operator+=(), RankThreeTensorTempl< T >::operator-(), RankThreeTensorTempl< T >::operator-=(), RankThreeTensorTempl< T >::operator/(), RankThreeTensorTempl< T >::operator=(), RankThreeTensorTempl< T >::RankThreeTensorTempl(), and RankThreeTensorTempl< T >::rotate().
|
static |
tensor dimension and powers of the dimension
Definition at line 60 of file RankThreeTensor.h.
Referenced by RankThreeTensorTempl< T >::operator()().
|
static |
Definition at line 61 of file RankThreeTensor.h.
|
static |
Definition at line 62 of file RankThreeTensor.h.