16 #ifndef dealii_transformations_h 17 #define dealii_transformations_h 19 #include <deal.II/base/point.h> 20 #include <deal.II/base/tensor.h> 23 DEAL_II_NAMESPACE_OPEN
29 namespace Transformations
60 template <
typename Number>
93 template <
typename Number>
120 namespace Contravariant
141 template <
int dim,
typename Number>
159 template <
int dim,
typename Number>
178 template <
int dim,
typename Number>
196 template <
int dim,
typename Number>
215 template <
int dim,
typename Number>
240 template <
int dim,
typename Number>
258 template <
int dim,
typename Number>
276 template <
int dim,
typename Number>
294 template <
int dim,
typename Number>
312 template <
int dim,
typename Number>
360 template <
int dim,
typename Number>
378 template <
int dim,
typename Number>
397 template <
int dim,
typename Number>
415 template <
int dim,
typename Number>
434 template <
int dim,
typename Number>
459 template <
int dim,
typename Number>
477 template <
int dim,
typename Number>
495 template <
int dim,
typename Number>
513 template <
int dim,
typename Number>
531 template <
int dim,
typename Number>
568 template <
int dim,
typename Number>
587 template <
int dim,
typename Number>
607 template <
int dim,
typename Number>
626 template <
int dim,
typename Number>
646 template <
int dim,
typename Number>
672 template <
int dim,
typename Number>
691 template <
int dim,
typename Number>
710 template <
int dim,
typename Number>
729 template <
int dim,
typename Number>
748 template <
int dim,
typename Number>
783 template <
int dim,
typename Number>
804 template <
int dim,
typename Number>
810 return contract<1,0>(F, V);
815 template <
int dim,
typename Number>
821 return contract<1,0>(
F,contract<1,1>(T,
F));
826 template <
int dim,
typename Number>
828 ::SymmetricTensor<2,dim,Number>
829 transformation_contraction (const ::SymmetricTensor<2,dim,Number> &T,
833 for (
unsigned int i=0; i<dim; ++i)
834 for (
unsigned int J=0; J<dim; ++J)
835 for (
unsigned int I=0; I<dim; ++I)
836 tmp_1[i][J] += F[i][I] * T[I][J];
839 for (
unsigned int i=0; i<dim; ++i)
840 for (
unsigned int j=i; j<dim; ++j)
841 for (
unsigned int J=0; J<dim; ++J)
842 out[i][j] += F[j][J] * tmp_1[i][J];
849 template <
int dim,
typename Number>
874 return contract<1,1>(
F,contract<1,1>(
F,contract<2,1>(contract<2,1>(H,
F), F)));
879 template <
int dim,
typename Number>
881 ::SymmetricTensor<4,dim,Number>
882 transformation_contraction (const ::SymmetricTensor<4,dim,Number> &H,
902 for (
unsigned int I=0; I<dim; ++I)
903 for (
unsigned int j=0; j<dim; ++j)
904 for (
unsigned int K=0; K<dim; ++K)
905 for (
unsigned int L=0; L<dim; ++L)
906 for (
unsigned int J=0; J<dim; ++J)
907 tmp[I][j][K][L] += F[j][J] * H[I][J][K][L];
910 tmp = contract<1,0>(
F, contract<3,1>(tmp,
F));
914 for (
unsigned int i=0; i<dim; ++i)
915 for (
unsigned int j=i; j<dim; ++j)
916 for (
unsigned int k=0; k<dim; ++k)
917 for (
unsigned int l=k;
l<dim; ++
l)
918 for (
unsigned int K=0; K<dim; ++K)
919 out[i][j][k][l] += F[k][K] * tmp[i][j][K][l];
929 template <
typename Number>
933 const double rotation[2][2]
935 std::cos(angle), -std::sin(angle)
938 std::sin(angle), std::cos(angle)
946 template <
typename Number>
951 Assert(std::abs(axis.norm() - 1.0) < 1
e-9,
952 ExcMessage(
"The supplied axial vector is not a unit vector."));
953 const Number c = std::cos(angle);
954 const Number s = std::sin(angle);
955 const Number t = 1.-c;
956 const double rotation[3][3]
958 t *axis[0] *axis[0] + c,
959 t *axis[0] *axis[1] - s *axis[2],
960 t *axis[0] *axis[2] + s *axis[1]
963 t *axis[0] *axis[1] + s *axis[2],
964 t *axis[1] *axis[1] + c,
965 t *axis[1] *axis[2] - s *axis[0]
968 t *axis[0] *axis[2] - s *axis[1],
969 t *axis[1] *axis[2] + s *axis[0],
970 t *axis[2] *axis[2] + c
978 template <
int dim,
typename Number>
984 return internal::Physics::transformation_contraction(V,F);
989 template <
int dim,
typename Number>
995 return internal::Physics::transformation_contraction(T,F);
1000 template <
int dim,
typename Number>
1006 return internal::Physics::transformation_contraction(T,F);
1011 template <
int dim,
typename Number>
1017 return internal::Physics::transformation_contraction(H,F);
1022 template <
int dim,
typename Number>
1028 return internal::Physics::transformation_contraction(H,F);
1033 template <
int dim,
typename Number>
1039 return internal::Physics::transformation_contraction(v,
invert(F));
1044 template <
int dim,
typename Number>
1050 return internal::Physics::transformation_contraction(t,
invert(F));
1055 template <
int dim,
typename Number>
1061 return internal::Physics::transformation_contraction(t,
invert(F));
1066 template <
int dim,
typename Number>
1072 return internal::Physics::transformation_contraction(h,
invert(F));
1077 template <
int dim,
typename Number>
1083 return internal::Physics::transformation_contraction(h,
invert(F));
1088 template <
int dim,
typename Number>
1094 return internal::Physics::transformation_contraction(V,
transpose(
invert(F)));
1099 template <
int dim,
typename Number>
1105 return internal::Physics::transformation_contraction(T,
transpose(
invert(F)));
1110 template <
int dim,
typename Number>
1116 return internal::Physics::transformation_contraction(T,
transpose(
invert(F)));
1121 template <
int dim,
typename Number>
1127 return internal::Physics::transformation_contraction(H,
transpose(
invert(F)));
1132 template <
int dim,
typename Number>
1138 return internal::Physics::transformation_contraction(H,
transpose(
invert(F)));
1143 template <
int dim,
typename Number>
1149 return internal::Physics::transformation_contraction(v,
transpose(F));
1154 template <
int dim,
typename Number>
1160 return internal::Physics::transformation_contraction(t,
transpose(F));
1165 template <
int dim,
typename Number>
1171 return internal::Physics::transformation_contraction(t,
transpose(F));
1176 template <
int dim,
typename Number>
1182 return internal::Physics::transformation_contraction(h,
transpose(F));
1187 template <
int dim,
typename Number>
1193 return internal::Physics::transformation_contraction(h,
transpose(F));
1198 template <
int dim,
typename Number>
1204 return Number(1.0/
determinant(F))*Contravariant::push_forward(V,F);
1209 template <
int dim,
typename Number>
1215 return Number(1.0/
determinant(F))*Contravariant::push_forward(T,F);
1220 template <
int dim,
typename Number>
1226 return Number(1.0/
determinant(F))*Contravariant::push_forward(T,F);
1231 template <
int dim,
typename Number>
1237 return Number(1.0/
determinant(F))*Contravariant::push_forward(H,F);
1242 template <
int dim,
typename Number>
1248 return Number(1.0/
determinant(F))*Contravariant::push_forward(H,F);
1253 template <
int dim,
typename Number>
1259 return Number(
determinant(F))*Contravariant::pull_back(v,F);
1264 template <
int dim,
typename Number>
1270 return Number(
determinant(F))*Contravariant::pull_back(t,F);
1275 template <
int dim,
typename Number>
1281 return Number(
determinant(F))*Contravariant::pull_back(t,F);
1286 template <
int dim,
typename Number>
1292 return Number(
determinant(F))*Contravariant::pull_back(h,F);
1297 template <
int dim,
typename Number>
1303 return Number(
determinant(F))*Contravariant::pull_back(h,F);
1308 template <
int dim,
typename Number>
1318 DEAL_II_NAMESPACE_CLOSE
SymmetricTensor< 2, dim, Number > invert(const SymmetricTensor< 2, dim, Number > &t)
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
Tensor< 2, dim, Number > F(const Tensor< 2, dim, Number > &Grad_u)
Tensor< 2, dim, Number > cofactor(const Tensor< 2, dim, Number > &t)
static ::ExceptionBase & ExcMessage(std::string arg1)
#define Assert(cond, exc)
Number determinant(const SymmetricTensor< 2, dim, Number > &t)
Tensor< 2, dim, Number > l(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)