www.mooseframework.org
RankFourTensor.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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"
13 #include "MooseTypes.h"
14 #include "ADRankTwoTensorForward.h"
17 
18 #include "libmesh/libmesh.h"
19 #include "libmesh/tuple_of.h"
20 #include "libmesh/int_range.h"
21 
22 #include "metaphysicl/raw_type.h"
23 
24 #include <petscsys.h>
25 
26 #include <Eigen/Core>
27 #include <Eigen/Dense>
28 
29 using libMesh::Real;
30 using libMesh::tuple_of;
31 namespace libMesh
32 {
33 template <typename>
34 class TensorValue;
35 template <typename>
36 class TypeTensor;
37 template <typename>
38 class VectorValue;
39 }
40 
41 // Forward declarations
42 class MooseEnum;
43 
44 namespace MathUtils
45 {
46 template <typename T>
47 void mooseSetToZero(T & v);
48 
53 template <>
55 template <>
57 }
58 
64 template <typename T>
66 {
67 public:
69  static constexpr unsigned int N = Moose::dim;
70  static constexpr unsigned int N2 = N * N;
71  static constexpr unsigned int N3 = N * N * N;
72  static constexpr unsigned int N4 = N * N * N * N;
74 
76  typedef T value_type;
77 
80  {
86  };
87 
94  {
106  };
107 
108  template <template <typename> class Tensor, typename Scalar>
110  {
111  static const bool value = false;
112  };
113  template <typename Scalar>
115  {
116  static const bool value = ScalarTraits<Scalar>::value;
117  };
118  template <typename Scalar>
119  struct TwoTensorMultTraits<TensorValue, Scalar>
120  {
121  static const bool value = ScalarTraits<Scalar>::value;
122  };
123  template <typename Scalar>
124  struct TwoTensorMultTraits<TypeTensor, Scalar>
125  {
126  static const bool value = ScalarTraits<Scalar>::value;
127  };
128 
131 
134 
136  RankFourTensorTempl(const std::vector<T> &, FillMethod);
137 
139  RankFourTensorTempl(const RankFourTensorTempl<T> & a) = default;
140 
144  template <typename T2>
146 
147  // Named constructors
152  {
154  };
155 
157  inline T & operator()(unsigned int i, unsigned int j, unsigned int k, unsigned int l)
158  {
159  return _vals[i * N3 + j * N2 + k * N + l];
160  }
161 
166  inline const T & operator()(unsigned int i, unsigned int j, unsigned int k, unsigned int l) const
167  {
168  return _vals[i * N3 + j * N2 + k * N + l];
169  }
170 
172  void zero();
173 
175  void print(std::ostream & stm = Moose::out) const;
176 
178  void printReal(std::ostream & stm = Moose::out) const;
179 
182 
188  template <typename Scalar>
189  typename boostcopy::enable_if_c<ScalarTraits<Scalar>::value, RankFourTensorTempl &>::type
190  operator=(const Scalar & libmesh_dbg_var(p))
191  {
192  libmesh_assert_equal_to(p, Scalar(0));
193  this->zero();
194  return *this;
195  }
196 
198  template <template <typename> class Tensor, typename T2>
199  auto operator*(const Tensor<T2> & a) const ->
200  typename std::enable_if<TwoTensorMultTraits<Tensor, T2>::value,
202 
204  template <typename T2>
205  auto operator*(const T2 & a) const ->
206  typename std::enable_if<ScalarTraits<T2>::value,
208 
210  RankFourTensorTempl<T> & operator*=(const T & a);
211 
213  template <typename T2>
214  auto operator/(const T2 & a) const ->
215  typename std::enable_if<ScalarTraits<T2>::value,
216  RankFourTensorTempl<decltype(T() / T2())>>::type;
217 
219  RankFourTensorTempl<T> & operator/=(const T & a);
220 
223 
225  template <typename T2>
226  auto operator+(const RankFourTensorTempl<T2> & a) const
228 
231 
233  template <typename T2>
234  auto operator-(const RankFourTensorTempl<T2> & a) const
235  -> RankFourTensorTempl<decltype(T() - T2())>;
236 
239 
241  template <typename T2>
242  auto operator*(const RankFourTensorTempl<T2> & a) const
244 
246  T L2norm() const;
247 
253 
259 
264  void rotate(const TypeTensor<T> & R);
265 
271 
277 
283 
288  template <int m>
289  RankThreeTensorTempl<T> contraction(const VectorValue<T> & b) const;
290 
303  void surfaceFillFromInputVector(const std::vector<T> & input);
304 
306  static MooseEnum fillMethodEnum();
307 
323  void fillFromInputVector(const std::vector<T> & input, FillMethod fill_method);
324 
326  void fillGeneralIsotropic(const T & i0, const T & i1, const T & i2);
327  void fillAntisymmetricIsotropic(const T & i0);
328  void fillSymmetricIsotropic(const T & i0, const T & i1);
329  void fillSymmetricIsotropicEandNu(const T & E, const T & nu);
331 
342  template <typename T2>
343  void fillSymmetric9FromInputVector(const T2 & input);
344 
353  template <typename T2>
354  void fillSymmetric21FromInputVector(const T2 & input);
355 
358 
360  T contractionIj(unsigned int, unsigned int, const RankTwoTensorTempl<T> &) const;
361 
363  T contractionKl(unsigned int, unsigned int, const RankTwoTensorTempl<T> &) const;
364 
366  T sum3x3() const;
367 
369  VectorValue<T> sum3x1() const;
370 
373  const RankTwoTensorTempl<T> &,
374  const RankTwoTensorTempl<T> &) const;
377  const RankTwoTensorTempl<T> &,
378  const RankTwoTensorTempl<T> &) const;
381  const RankTwoTensorTempl<T> &,
382  const RankTwoTensorTempl<T> &) const;
385  const RankTwoTensorTempl<T> &,
386  const RankTwoTensorTempl<T> &) const;
387 
396 
398  bool isSymmetric() const;
399 
401  bool isIsotropic() const;
402 
403 protected:
406  T _vals[N4];
407 
414  void fillAntisymmetricFromInputVector(const std::vector<T> & input);
415 
424  void fillGeneralIsotropicFromInputVector(const std::vector<T> & input);
425 
432  void fillAntisymmetricIsotropicFromInputVector(const std::vector<T> & input);
433 
441  void fillSymmetricIsotropicFromInputVector(const std::vector<T> & input);
442 
452  void fillSymmetricIsotropicEandNuFromInputVector(const std::vector<T> & input);
453 
461  void fillAxisymmetricRZFromInputVector(const std::vector<T> & input);
462 
468  void fillGeneralFromInputVector(const std::vector<T> & input);
469 
484  void fillPrincipalFromInputVector(const std::vector<T> & input);
485 
492  void fillGeneralOrthotropicFromInputVector(const std::vector<T> & input);
493 
494  template <class T2>
495  friend void dataStore(std::ostream &, RankFourTensorTempl<T2> &, void *);
496 
497  template <class T2>
498  friend void dataLoad(std::istream &, RankFourTensorTempl<T2> &, void *);
499 
500  template <typename T2>
501  friend class RankTwoTensorTempl;
502  template <typename T2>
503  friend class RankFourTensorTempl;
504  template <typename T2>
505  friend class RankThreeTensorTempl;
506 };
507 
508 namespace MetaPhysicL
509 {
510 template <typename T>
511 struct RawType<RankFourTensorTempl<T>>
512 {
514 
516  {
517  constexpr auto N = RankFourTensorTempl<T>::N;
518  value_type ret;
519  for (auto i : make_range(N))
520  for (auto j : make_range(N))
521  for (auto k : make_range(N))
522  for (auto l : make_range(N))
523  ret(i, j, k, l) = raw_value(in(i, j, k, l));
524 
525  return ret;
526  }
527 };
528 }
529 
530 template <typename T1, typename T2>
531 inline auto
532 operator*(const T1 & a, const RankFourTensorTempl<T2> & b) ->
533  typename std::enable_if<ScalarTraits<T1>::value,
535 {
536  return b * a;
537 }
538 
539 template <typename T>
540 template <typename T2>
542 {
543  for (auto i : make_range(N4))
544  _vals[i] = copy._vals[i];
545 }
546 
547 template <typename T>
548 template <typename T2>
549 auto
550 RankFourTensorTempl<T>::operator*(const T2 & b) const ->
551  typename std::enable_if<ScalarTraits<T2>::value,
553 {
554  typedef decltype(T() * T2()) ValueType;
556 
557  for (auto i : make_range(N4))
558  result._vals[i] = _vals[i] * b;
559 
560  return result;
561 }
562 
563 template <typename T>
564 template <typename T2>
565 auto
566 RankFourTensorTempl<T>::operator/(const T2 & b) const ->
567  typename std::enable_if<ScalarTraits<T2>::value,
568  RankFourTensorTempl<decltype(T() / T2())>>::type
569 {
570  RankFourTensorTempl<decltype(T() / T2())> result;
571  for (auto i : make_range(N4))
572  result._vals[i] = _vals[i] / b;
573  return result;
574 }
575 
576 template <typename T>
577 template <typename T2>
578 void
580 {
581  mooseAssert(input.size() == 9,
582  "To use fillSymmetric9FromInputVector, your input must have size 9.");
583  zero();
584 
585  (*this)(0, 0, 0, 0) = input[0]; // C1111
586  (*this)(1, 1, 1, 1) = input[3]; // C2222
587  (*this)(2, 2, 2, 2) = input[5]; // C3333
588 
589  (*this)(0, 0, 1, 1) = input[1]; // C1122
590  (*this)(1, 1, 0, 0) = input[1];
591 
592  (*this)(0, 0, 2, 2) = input[2]; // C1133
593  (*this)(2, 2, 0, 0) = input[2];
594 
595  (*this)(1, 1, 2, 2) = input[4]; // C2233
596  (*this)(2, 2, 1, 1) = input[4];
597 
598  (*this)(1, 2, 1, 2) = input[6]; // C2323
599  (*this)(2, 1, 2, 1) = input[6];
600  (*this)(2, 1, 1, 2) = input[6];
601  (*this)(1, 2, 2, 1) = input[6];
602 
603  (*this)(0, 2, 0, 2) = input[7]; // C1313
604  (*this)(2, 0, 2, 0) = input[7];
605  (*this)(2, 0, 0, 2) = input[7];
606  (*this)(0, 2, 2, 0) = input[7];
607 
608  (*this)(0, 1, 0, 1) = input[8]; // C1212
609  (*this)(1, 0, 1, 0) = input[8];
610  (*this)(1, 0, 0, 1) = input[8];
611  (*this)(0, 1, 1, 0) = input[8];
612 }
613 template <typename T>
614 template <typename T2>
615 void
617 {
618  mooseAssert(input.size() == 21,
619  "To use fillSymmetric21FromInputVector, your input must have size 21.");
620 
621  (*this)(0, 0, 0, 0) = input[0]; // C1111
622  (*this)(1, 1, 1, 1) = input[6]; // C2222
623  (*this)(2, 2, 2, 2) = input[11]; // C3333
624 
625  (*this)(0, 0, 1, 1) = input[1]; // C1122
626  (*this)(1, 1, 0, 0) = input[1];
627 
628  (*this)(0, 0, 2, 2) = input[2]; // C1133
629  (*this)(2, 2, 0, 0) = input[2];
630 
631  (*this)(1, 1, 2, 2) = input[7]; // C2233
632  (*this)(2, 2, 1, 1) = input[7];
633 
634  (*this)(0, 0, 0, 2) = input[4]; // C1113
635  (*this)(0, 0, 2, 0) = input[4];
636  (*this)(0, 2, 0, 0) = input[4];
637  (*this)(2, 0, 0, 0) = input[4];
638 
639  (*this)(0, 0, 0, 1) = input[5]; // C1112
640  (*this)(0, 0, 1, 0) = input[5];
641  (*this)(0, 1, 0, 0) = input[5];
642  (*this)(1, 0, 0, 0) = input[5];
643 
644  (*this)(1, 1, 1, 2) = input[8]; // C2223
645  (*this)(1, 1, 2, 1) = input[8];
646  (*this)(1, 2, 1, 1) = input[8];
647  (*this)(2, 1, 1, 1) = input[8];
648 
649  (*this)(1, 1, 1, 0) = input[10];
650  (*this)(1, 1, 0, 1) = input[10];
651  (*this)(1, 0, 1, 1) = input[10];
652  (*this)(0, 1, 1, 1) = input[10]; // C2212 //flipped for filling purposes
653 
654  (*this)(2, 2, 2, 1) = input[12];
655  (*this)(2, 2, 1, 2) = input[12];
656  (*this)(2, 1, 2, 2) = input[12];
657  (*this)(1, 2, 2, 2) = input[12]; // C3323 //flipped for filling purposes
658 
659  (*this)(2, 2, 2, 0) = input[13];
660  (*this)(2, 2, 0, 2) = input[13];
661  (*this)(2, 0, 2, 2) = input[13];
662  (*this)(0, 2, 2, 2) = input[13]; // C3313 //flipped for filling purposes
663 
664  (*this)(0, 0, 1, 2) = input[3]; // C1123
665  (*this)(0, 0, 2, 1) = input[3];
666  (*this)(1, 2, 0, 0) = input[3];
667  (*this)(2, 1, 0, 0) = input[3];
668 
669  (*this)(1, 1, 0, 2) = input[9];
670  (*this)(1, 1, 2, 0) = input[9];
671  (*this)(0, 2, 1, 1) = input[9]; // C2213 //flipped for filling purposes
672  (*this)(2, 0, 1, 1) = input[9];
673 
674  (*this)(2, 2, 0, 1) = input[14];
675  (*this)(2, 2, 1, 0) = input[14];
676  (*this)(0, 1, 2, 2) = input[14]; // C3312 //flipped for filling purposes
677  (*this)(1, 0, 2, 2) = input[14];
678 
679  (*this)(1, 2, 1, 2) = input[15]; // C2323
680  (*this)(2, 1, 2, 1) = input[15];
681  (*this)(2, 1, 1, 2) = input[15];
682  (*this)(1, 2, 2, 1) = input[15];
683 
684  (*this)(0, 2, 0, 2) = input[18]; // C1313
685  (*this)(2, 0, 2, 0) = input[18];
686  (*this)(2, 0, 0, 2) = input[18];
687  (*this)(0, 2, 2, 0) = input[18];
688 
689  (*this)(0, 1, 0, 1) = input[20]; // C1212
690  (*this)(1, 0, 1, 0) = input[20];
691  (*this)(1, 0, 0, 1) = input[20];
692  (*this)(0, 1, 1, 0) = input[20];
693 
694  (*this)(1, 2, 0, 2) = input[16];
695  (*this)(0, 2, 1, 2) = input[16]; // C2313 //flipped for filling purposes
696  (*this)(2, 1, 0, 2) = input[16];
697  (*this)(1, 2, 2, 0) = input[16];
698  (*this)(2, 0, 1, 2) = input[16];
699  (*this)(0, 2, 2, 1) = input[16];
700  (*this)(2, 1, 2, 0) = input[16];
701  (*this)(2, 0, 2, 1) = input[16];
702 
703  (*this)(1, 2, 0, 1) = input[17];
704  (*this)(0, 1, 1, 2) = input[17]; // C2312 //flipped for filling purposes
705  (*this)(2, 1, 0, 1) = input[17];
706  (*this)(1, 2, 1, 0) = input[17];
707  (*this)(1, 0, 1, 2) = input[17];
708  (*this)(0, 1, 2, 1) = input[17];
709  (*this)(2, 1, 1, 0) = input[17];
710  (*this)(1, 0, 2, 1) = input[17];
711 
712  (*this)(0, 2, 0, 1) = input[19];
713  (*this)(0, 1, 0, 2) = input[19]; // C1312 //flipped for filling purposes
714  (*this)(2, 0, 0, 1) = input[19];
715  (*this)(0, 2, 1, 0) = input[19];
716  (*this)(1, 0, 0, 2) = input[19];
717  (*this)(0, 1, 2, 0) = input[19];
718  (*this)(2, 0, 1, 0) = input[19];
719  (*this)(1, 0, 2, 0) = input[19];
720 }
721 
722 template <typename T>
725 {
726 
727  // The inverse of a 3x3x3x3 in the C_ijkl*A_klmn = de_im de_jn sense is
728  // simply the inverse of the 9x9 matrix of the tensor entries.
729  // So all we need to do is inverse _vals (with the appropriate row-major
730  // storage)
731 
732  RankFourTensorTempl<T> result;
733 
734  if constexpr (RankFourTensorTempl<T>::N4 * sizeof(T) > EIGEN_STACK_ALLOCATION_LIMIT)
735  {
736  // Allocate on the heap if you're going to exceed the stack size limit
737  Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> mat(9, 9);
738  for (auto i : make_range(9 * 9))
739  mat(i) = _vals[i];
740 
741  mat = mat.inverse();
742 
743  for (auto i : make_range(9 * 9))
744  result._vals[i] = mat(i);
745  }
746  else
747  {
748  // Allocate on the stack if small enough
749  const Eigen::Map<const Eigen::Matrix<T, 9, 9, Eigen::RowMajor>> mat(&_vals[0]);
750  Eigen::Map<Eigen::Matrix<T, 9, 9, Eigen::RowMajor>> res(&result._vals[0]);
751  res = mat.inverse();
752  }
753 
754  return result;
755 }
756 
757 template <typename T>
758 template <int m>
760 RankFourTensorTempl<T>::contraction(const VectorValue<T> & b) const
761 {
763  static constexpr std::size_t z[4][3] = {{1, 2, 3}, {0, 2, 3}, {0, 1, 3}, {0, 1, 2}};
764  std::size_t x[4];
765  for (x[0] = 0; x[0] < N; ++x[0])
766  for (x[1] = 0; x[1] < N; ++x[1])
767  for (x[2] = 0; x[2] < N; ++x[2])
768  for (x[3] = 0; x[3] < N; ++x[3])
769  result(x[z[m][0]], x[z[m][1]], x[z[m][2]]) += (*this)(x[0], x[1], x[2], x[3]) * b(x[m]);
770 
771  return result;
772 }
RankFourTensorTempl is designed to handle any N-dimensional fourth order tensor, C.
RankFourTensorTempl< T > inverse() const
This returns A_ijkl such that C_ijkl*A_klmn = de_im de_jn i.e.
RankFourTensorTempl< T > singleProductJ(const RankTwoTensorTempl< T > &) const
Calculates C_imkl A_jm.
void mooseSetToZero(T &v)
Helper function templates to set a variable to zero.
Definition: MathUtils.h:368
RankFourTensorTempl< T > & operator=(const RankFourTensorTempl< T > &a)
copies values from a into this tensor
void fillSymmetric9FromInputVector(const T2 &input)
fillSymmetric9FromInputVector takes 9 inputs to fill in the Rank-4 tensor with the appropriate crysta...
VectorValue< T > sum3x1() const
Calculates the vector a[i] = sum over j Ciijj for i and j varying from 0 to 2.
void fillGeneralFromInputVector(const std::vector< T > &input)
fillGeneralFromInputVector takes 81 inputs to fill the Rank-4 tensor No symmetries are explicitly mai...
void fillGeneralOrthotropicFromInputVector(const std::vector< T > &input)
fillGeneralOrhotropicFromInputVector takes 10 inputs to fill the Rank-4 tensor It defines a general o...
void fillAntisymmetricFromInputVector(const std::vector< T > &input)
fillAntisymmetricFromInputVector takes 6 inputs to fill the the antisymmetric Rank-4 tensor with the ...
RankFourTensorTempl< T > singleProductL(const RankTwoTensorTempl< T > &) const
Calculates C_ijkm A_lm.
friend void dataStore(std::ostream &, RankFourTensorTempl< T2 > &, void *)
static RankFourTensorTempl< T > IdentityFour()
RankFourTensorTempl< T > tripleProductIjl(const RankTwoTensorTempl< T > &, const RankTwoTensorTempl< T > &, const RankTwoTensorTempl< T > &) const
Calculates C_mnkt A_im B_jn C_lt.
RankThreeTensorTempl< T > contraction(const VectorValue< T > &b) const
single contraction of a RankFourTensor with a vector over index m
RankFourTensorTempl< T > & operator*=(const T &a)
C_ijkl *= a.
void fillSymmetric21FromInputVector(const T2 &input)
fillSymmetric21FromInputVector takes either 21 inputs to fill in the Rank-4 tensor with the appropria...
RankTwoTensorTempl< T > innerProductTranspose(const RankTwoTensorTempl< T > &) const
Inner product of the major transposed tensor with a rank two tensor.
static constexpr unsigned int N3
tuple_of< 4, unsigned int > index_type
static RankFourTensorTempl< T > Identity()
auto raw_value(const Eigen::Map< T > &in)
Definition: ADReal.h:73
friend void dataLoad(std::istream &, RankFourTensorTempl< T2 > &, void *)
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:148
void fillPrincipalFromInputVector(const std::vector< T > &input)
fillPrincipalFromInputVector takes 9 inputs to fill a Rank-4 tensor C1111 = input0 C1122 = input1 C11...
void mooseSetToZero< ADRankFourTensor >(ADRankFourTensor &v)
We need to instantiate the following CompareTypes to tell the compiler that ADReal is a subtype of Ch...
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
void fillFromInputVector(const std::vector< T > &input, FillMethod fill_method)
fillFromInputVector takes some number of inputs to fill the Rank-4 tensor.
const Number zero
static constexpr unsigned int N2
void surfaceFillFromInputVector(const std::vector< T > &input)
Fills the tensor entries ignoring the last dimension (ie, C_ijkl=0 if any of i, j, k, or l = 3).
static constexpr unsigned int N4
T contractionIj(unsigned int, unsigned int, const RankTwoTensorTempl< T > &) const
Sum C_ijkl M_kl for a given i,j.
auto operator*(const T1 &a, const RankFourTensorTempl< T2 > &b) -> typename std::enable_if< ScalarTraits< T1 >::value, RankFourTensorTempl< decltype(T1() *T2())>>::type
void print(std::ostream &stm=Moose::out) const
Print the rank four tensor.
RankFourTensorTempl< T > & operator/=(const T &a)
C_ijkl /= a for all i, j, k, l.
RankThreeTensor is designed to handle any N-dimensional third order tensor, r.
auto operator*(const Tensor< T2 > &a) const -> typename std::enable_if< TwoTensorMultTraits< Tensor, T2 >::value, RankTwoTensorTempl< decltype(T() *T2())>>::type
C_ijkl*a_kl.
RankFourTensorTempl< T > tripleProductJkl(const RankTwoTensorTempl< T > &, const RankTwoTensorTempl< T > &, const RankTwoTensorTempl< T > &) const
Calculates C_imnt A_jm B_kn C_lt.
RankFourTensorTempl< T > tripleProductIjk(const RankTwoTensorTempl< T > &, const RankTwoTensorTempl< T > &, const RankTwoTensorTempl< T > &) const
Calculates C_mntl A_im B_jn C_kt.
void fillSymmetricIsotropic(const T &i0, const T &i1)
auto operator+(const RankFourTensorTempl< T2 > &a) const -> RankFourTensorTempl< decltype(T()+T2())>
C_ijkl + a_ijkl.
void fillGeneralIsotropicFromInputVector(const std::vector< T > &input)
fillGeneralIsotropicFromInputVector takes 3 inputs to fill the Rank-4 tensor with symmetries C_ijkl =...
void zero()
Zeros out the tensor.
typename tuple_n< Index, T >::template type<> tuple_of
FillMethod
To fill up the 81 entries in the 4th-order tensor, fillFromInputVector is called with one of the foll...
T L2norm() const
sqrt(C_ijkl*C_ijkl)
void mooseSetToZero< RankFourTensor >(RankFourTensor &v)
Helper function template specialization to set an object to zero.
void fillSymmetricIsotropicEandNu(const T &E, const T &nu)
bool isSymmetric() const
checks if the tensor is symmetric
void fillGeneralIsotropic(const T &i0, const T &i1, const T &i2)
Vector-less fill API functions. See docs of the corresponding ...FromInputVector methods.
RankFourTensorTempl()
Default constructor; fills to zero.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:31
void printReal(std::ostream &stm=Moose::out) const
Print the values of the rank four tensor.
T sum3x3() const
Calculates the sum of Ciijj for i and j varying from 0 to 2.
RankFourTensorTempl< T > transposeMajor() const
Transpose the tensor by swapping the first pair with the second pair of indices.
bool isIsotropic() const
checks if the tensor is isotropic
T _vals[N4]
The values of the rank-four tensor stored by index=(((i * LIBMESH_DIM + j) * LIBMESH_DIM + k) * LIBME...
void fillAxisymmetricRZFromInputVector(const std::vector< T > &input)
fillAxisymmetricRZFromInputVector takes 5 inputs to fill the axisymmetric Rank-4 tensor with the appr...
void rotate(const TypeTensor< T > &R)
Rotate the tensor using C_ijkl = R_im R_jn R_ko R_lp C_mnop.
void fillSymmetricIsotropicEandNuFromInputVector(const std::vector< T > &input)
fillSymmetricIsotropicEandNuFromInputVector is a variation of the fillSymmetricIsotropicFromInputVect...
T contractionKl(unsigned int, unsigned int, const RankTwoTensorTempl< T > &) const
Sum M_ij C_ijkl for a given k,l.
T & operator()(unsigned int i, unsigned int j, unsigned int k, unsigned int l)
Gets the value for the indices specified. Takes indices ranging from 0-2 for i, j, k, and l.
RankFourTensorTempl< T > transposeIj() const
Transpose the tensor by swapping the first two indeces.
void fillSymmetricIsotropicFromInputVector(const std::vector< T > &input)
fillSymmetricIsotropicFromInputVector takes 2 inputs to fill the the symmetric Rank-4 tensor with the...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
NumberTensorValue Tensor
RankFourTensorTempl< T > singleProductI(const RankTwoTensorTempl< T > &) const
Calculates C_mjkl A_im.
RankTwoTensorTempl is designed to handle the Stress or Strain Tensor for a fully anisotropic material...
Definition: RankTwoTensor.h:79
auto operator/(const T2 &a) const -> typename std::enable_if< ScalarTraits< T2 >::value, RankFourTensorTempl< decltype(T()/T2())>>::type
C_ijkl/a.
InitMethod
Initialization method.
RankFourTensorTempl< T > operator-() const
-C_ijkl
IntRange< T > make_range(T beg, T end)
void fillAntisymmetricIsotropicFromInputVector(const std::vector< T > &input)
fillAntisymmetricIsotropicFromInputVector takes 1 input to fill the the antisymmetric Rank-4 tensor w...
static MooseEnum fillMethodEnum()
Static method for use in validParams for getting the "fill_method".
RankFourTensorTempl< T > singleProductK(const RankTwoTensorTempl< T > &) const
Calculates C_ijml A_km.
static constexpr unsigned int N
tensor dimension and powers of the dimension
RankFourTensorTempl< T > & operator+=(const RankFourTensorTempl< T > &a)
C_ijkl += a_ijkl for all i, j, k, l.
static value_type value(const RankFourTensorTempl< T > &in)
const T & operator()(unsigned int i, unsigned int j, unsigned int k, unsigned int l) const
Gets the value for the indices specified.
void fillAntisymmetricIsotropic(const T &i0)
RankFourTensorTempl< T > tripleProductIkl(const RankTwoTensorTempl< T > &, const RankTwoTensorTempl< T > &, const RankTwoTensorTempl< T > &) const
Calculates C_mjnt A_im B_kn C_lt.
static RankFourTensorTempl< T > IdentityDeviatoric()
Identity of type {ik} {jl} - {ij} {kl} / 3.
RankFourTensorTempl< T > transposeKl() const
Transpose the tensor by swapping the last two indeces.
RankFourTensorTempl< typename RawType< T >::value_type > value_type
RankFourTensorTempl< T > invSymm() const
This returns A_ijkl such that C_ijkl*A_klmn = 0.5*(de_im de_jn + de_in de_jm) This routine assumes th...
RankFourTensorTempl< T > & operator-=(const RankFourTensorTempl< T > &a)
C_ijkl -= a_ijkl.
boostcopy::enable_if_c< ScalarTraits< Scalar >::value, RankFourTensorTempl & >::type operator=(const Scalar &libmesh_dbg_var(p))
Assignment-from-scalar operator.