17 #include "libmesh/libmesh.h" 18 #include "libmesh/int_range.h" 20 #include "metaphysicl/raw_type.h" 61 static constexpr
unsigned int N2 =
N *
N;
62 static constexpr
unsigned int N3 =
N *
N *
N;
92 template <
typename T2>
102 inline T &
operator()(
unsigned int i,
unsigned int j,
unsigned int k)
104 return _vals[((i *
N + j) *
N + k)];
108 inline T
operator()(
unsigned int i,
unsigned int j,
unsigned int k)
const 110 return _vals[((i *
N + j) *
N + k)];
120 void print(std::ostream & stm = Moose::out)
const;
125 template <
typename T2>
166 void rotate(
const T2 & R);
172 void rotate(
const TensorValue<T> & R);
231 template <
typename T>
249 template <
typename T>
250 template <
typename T2>
254 _vals[i] = copy.
_vals[i];
257 template <
typename T>
262 unsigned int index = 0;
267 unsigned int index2 = 0;
276 sum += ab * R(k, o) * _vals[index2++];
279 _vals[index++] = sum;
283 template <
typename T>
291 template <
typename T>
296 "RankTwoTensor and RankThreeTensor have to have the same dimension N.");
302 result(i, j) += p(k) * b(k, i, j);
307 template <
typename T>
308 template <
typename T2>
315 (*this)(i, j, k) = a(i, j, k);
RankFourTensorTempl is designed to handle any N-dimensional fourth order tensor, C.
RankThreeTensorTempl< T > operator*(T a, const RankThreeTensorTempl< T > &b)
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...
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.
void mooseSetToZero(T &v)
Helper function templates to set a variable to zero.
void fillFromPlaneNormal(const VectorValue< T > &input)
Fills RankThreeTensor from plane normal vectors ref.
static constexpr unsigned int N2
RankThreeTensorTempl< T > & operator/=(const T a)
r_ijk /= a for all i, j, k
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
RankThreeTensorTempl< T > & operator-=(const RankThreeTensorTempl< T > &a)
r_ijk -= a_ijk
void fillFromInputVector(const std::vector< T > &input, FillMethod fill_method=automatic)
fillFromInputVector takes some number of inputs to fill the Rank-3 tensor.
RankThreeTensorTempl< T > operator/(const T a) const
r_ijk/a
RankThreeTensor is designed to handle any N-dimensional third order tensor, r.
RankThreeTensorTempl< T > operator-() const
-r_ijk
FillMethod
To fill up the 27 entries in the 3rd-order tensor, fillFromInputVector is called with one of the foll...
RankThreeTensorTempl< T > & operator+=(const RankThreeTensorTempl< T > &a)
r_ijk += a_ijk for all i, j, k
static MooseEnum fillMethodEnum()
Static method for use in validParams for getting the "fill_method".
RankThreeTensorTempl< T > & operator*=(const T a)
r_ijk *= a
void rotate(const T2 &R)
Rotate the tensor using r_ijk = R_im R_in R_ko r_mno.
RankThreeTensorTempl< T > & operator=(const T &value)
Assignment-from-scalar operator.
T & operator()(unsigned int i, unsigned int j, unsigned int k)
Gets the value for the index specified. Takes index = 0,1,2.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
T _vals[N3]
The values of the rank-three tensor stored by index=((i * LIBMESH_DIM + j) * LIBMESH_DIM + k) ...
InitMethod
Initialization method.
static constexpr unsigned int N3
RankThreeTensorTempl()
Default constructor; fills to zero.
RankThreeTensorTempl< T > operator+(const RankThreeTensorTempl< T > &a) const
r_ijkl + a_ijk
T L2norm() const
(r_ijk*r_ijk)
friend void dataLoad(std::istream &, RankThreeTensorTempl< T2 > &, void *)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
RankTwoTensorTempl is designed to handle the Stress or Strain Tensor for a fully anisotropic material...
friend void dataStore(std::ostream &, RankThreeTensorTempl< T2 > &, void *)
IntRange< T > make_range(T beg, T end)
VectorValue< T > operator*(const RankTwoTensorTempl< T > &a) const
b_i = r_ijk * a_jk
void zero()
Zeros out the tensor.
VectorValue< T > doubleContraction(const RankTwoTensorTempl< T > &b) const
Creates a vector from the double contraction of a rank three and rank two tensor. ...
void fillGeneralFromInputVector(const std::vector< T > &input)
void print(std::ostream &stm=Moose::out) const
Print the rank three tensor.
static constexpr unsigned int N
tensor dimension and powers of the dimension