version 0.4.1
eas3d.hh
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2021-2024 The Ikarus Developers mueller@ibb.uni-stuttgart.de
2// SPDX-License-Identifier: LGPL-3.0-or-later
3
10#pragma once
11
13
14namespace Ikarus::EAS {
15
23template <typename GEO>
24struct H1E9
25{
26 static constexpr int strainSize = 6;
27 static constexpr int enhancedStrainSize = 9;
28 using MType = Eigen::Matrix<double, strainSize, enhancedStrainSize>;
29 using DType = Eigen::Matrix<double, enhancedStrainSize, enhancedStrainSize>;
30
31 H1E9() = default;
32 explicit H1E9(const GEO& geometry)
33 : geometry_{std::make_optional<GEO>(geometry)},
34 T0InverseTransformed_{calcTransformationMatrix3D(geometry)} {}
35
36 auto calcM(const Dune::FieldVector<double, 3>& quadPos) const {
37 MType M;
38 M.setZero();
39 const double xi = quadPos[0];
40 const double eta = quadPos[1];
41 const double zeta = quadPos[2];
42 M(0, 0) = 2 * xi - 1.0;
43 M(1, 1) = 2 * eta - 1.0;
44 M(2, 2) = 2 * zeta - 1.0;
45 M(3, 3) = 2 * xi - 1.0;
46 M(3, 4) = 2 * eta - 1.0;
47 M(4, 5) = 2 * xi - 1.0;
48 M(4, 6) = 2 * zeta - 1.0;
49 M(5, 7) = 2 * eta - 1.0;
50 M(5, 8) = 2 * zeta - 1.0;
51 const double detJ = geometry_->integrationElement(quadPos);
52 M = T0InverseTransformed_ / detJ * M;
53 return M;
54 }
55
56private:
57 std::optional<GEO> geometry_;
58 Eigen::Matrix<double, strainSize, strainSize> T0InverseTransformed_;
59};
60
68template <typename GEO>
69struct H1E21
70{
71 static constexpr int strainSize = 6;
72 static constexpr int enhancedStrainSize = 21;
73 using MType = Eigen::Matrix<double, strainSize, enhancedStrainSize>;
74 using DType = Eigen::Matrix<double, enhancedStrainSize, enhancedStrainSize>;
75
76 H1E21() = default;
77 explicit H1E21(const GEO& geometry)
78 : geometry_{std::make_optional<GEO>(geometry)},
79 T0InverseTransformed{calcTransformationMatrix3D(geometry)} {}
80
81 auto calcM(const Dune::FieldVector<double, 3>& quadPos) const {
82 MType M;
83 M.setZero();
84 const double xi = quadPos[0];
85 const double eta = quadPos[1];
86 const double zeta = quadPos[2];
87 M(0, 0) = 2 * xi - 1.0;
88 M(1, 1) = 2 * eta - 1.0;
89 M(2, 2) = 2 * zeta - 1.0;
90 M(3, 3) = 2 * xi - 1.0;
91 M(3, 4) = 2 * eta - 1.0;
92 M(4, 5) = 2 * xi - 1.0;
93 M(4, 6) = 2 * zeta - 1.0;
94 M(5, 7) = 2 * eta - 1.0;
95 M(5, 8) = 2 * zeta - 1.0;
96
97 M(3, 9) = (2 * xi - 1.0) * (2 * zeta - 1.0);
98 M(3, 10) = (2 * eta - 1.0) * (2 * zeta - 1.0);
99 M(4, 11) = (2 * xi - 1.0) * (2 * eta - 1.0);
100 M(4, 12) = (2 * eta - 1.0) * (2 * zeta - 1.0);
101 M(5, 13) = (2 * xi - 1.0) * (2 * eta - 1.0);
102 M(5, 14) = (2 * xi - 1.0) * (2 * zeta - 1.0);
103
104 M(0, 15) = (2 * xi - 1.0) * (2 * eta - 1.0);
105 M(0, 16) = (2 * xi - 1.0) * (2 * zeta - 1.0);
106 M(1, 17) = (2 * xi - 1.0) * (2 * eta - 1.0);
107 M(1, 18) = (2 * eta - 1.0) * (2 * zeta - 1.0);
108 M(2, 19) = (2 * xi - 1.0) * (2 * zeta - 1.0);
109 M(2, 20) = (2 * eta - 1.0) * (2 * zeta - 1.0);
110
111 const double detJ = geometry_->integrationElement(quadPos);
112 M = T0InverseTransformed / detJ * M;
113 return M;
114 }
115
116private:
117 std::optional<GEO> geometry_;
118 Eigen::Matrix<double, strainSize, strainSize> T0InverseTransformed;
119};
120} // namespace Ikarus::EAS
Helper for the Eigen::Tensor types.
STL namespace.
Eigen::Matrix< double, 6, 6 > calcTransformationMatrix3D(const Geometry &geometry)
Calculates the 3D transformation matrix.
Definition: tensorutils.hh:400
Definition: eas2d.hh:14
Structure representing EAS for H1 with 9 enhanced strains.
Definition: eas3d.hh:25
H1E9(const GEO &geometry)
Definition: eas3d.hh:32
Eigen::Matrix< double, strainSize, enhancedStrainSize > MType
Definition: eas3d.hh:28
Eigen::Matrix< double, enhancedStrainSize, enhancedStrainSize > DType
Definition: eas3d.hh:29
static constexpr int enhancedStrainSize
Definition: eas3d.hh:27
auto calcM(const Dune::FieldVector< double, 3 > &quadPos) const
Definition: eas3d.hh:36
static constexpr int strainSize
Definition: eas3d.hh:26
Structure representing EAS for H1 with 21 enhanced strains.
Definition: eas3d.hh:70
Eigen::Matrix< double, strainSize, enhancedStrainSize > MType
Definition: eas3d.hh:73
H1E21(const GEO &geometry)
Definition: eas3d.hh:77
static constexpr int enhancedStrainSize
Definition: eas3d.hh:72
Eigen::Matrix< double, enhancedStrainSize, enhancedStrainSize > DType
Definition: eas3d.hh:74
static constexpr int strainSize
Definition: eas3d.hh:71
auto calcM(const Dune::FieldVector< double, 3 > &quadPos) const
Definition: eas3d.hh:81
Definition: utils/dirichletvalues.hh:32