26 template <
typename GEO>
29 static constexpr int worldDim = GEO::coorddimension;
30 static_assert((worldDim == 2) or (worldDim == 3),
"EAS variants are only available 2D and 3D elements.");
33 using EAS2D = std::variant<E0<GEO>, Q1E4<GEO>, Q1E5<GEO>, Q1E7<GEO>>;
36 using EAS3D = std::variant<E0<GEO>, H1E9<GEO>, H1E21<GEO>>;
39 using type = std::conditional_t<worldDim == 2, EAS2D, EAS3D>;
46 template <
typename Geometry>
49 using Variant = Impl::Variants<Geometry>::type;
57 void operator()(F&& f)
const {
59 [&]<
typename EAST>(
const EAST& easFunction) {
60 if constexpr (EAST::enhancedStrainSize != 0)
66 auto numberOfEASParameters()
const {
67 return std::visit([]<
typename EAST>(
const EAST&) ->
int {
return EAST::enhancedStrainSize; }, var_);
69 bool isDisplacmentBased()
const {
return numberOfEASParameters() == 0; }
70 void setEASType(
int numberOfEASParameters) {
71 numberOfEASParameters_ = numberOfEASParameters;
75 void bind(
const Geometry& geometry) {
76 geometry_ = std::make_optional<Geometry>(geometry);
81 void createEASType() {
82 if (numberOfEASParameters_ == 0) {
83 var_ = E0(geometry_.value());
87 if constexpr (Geometry::mydimension == 2) {
88 switch (numberOfEASParameters_) {
90 var_ = Q1E4(geometry_.value());
93 var_ = Q1E5(geometry_.value());
96 var_ = Q1E7(geometry_.value());
99 DUNE_THROW(Dune::NotImplemented,
"The given EAS parameters are not available for the 2D case.");
101 }
else if constexpr (Geometry::mydimension == 3) {
102 switch (numberOfEASParameters_) {
104 var_ = H1E9(geometry_.value());
107 var_ = H1E21(geometry_.value());
110 DUNE_THROW(Dune::NotImplemented,
"The given EAS parameters are not available for the 3D case.");
114 std::optional<Geometry> geometry_;
116 int numberOfEASParameters_;
Helper for the Eigen::Tensor types.
Definition of the types of EAS formulations for 2D elements.
Definition of the types of EAS formulations for 3D elements.