version 0.4
enhancedassumedstrains.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#if HAVE_DUNE_LOCALFEFUNCTIONS
12# include <dune/localfefunctions/derivativetransformators.hh>
13# include <dune/localfefunctions/linearAlgebraHelper.hh>
14# include <dune/localfefunctions/meta.hh>
15
19
20namespace Ikarus {
21
31 template <typename Geometry>
32 Eigen::Matrix3d calcTransformationMatrix2D(const Geometry& geometry) {
33 const auto& referenceElement = Dune::ReferenceElements<double, 2>::general(geometry.type());
34 const auto quadPos0 = referenceElement.position(0, 0);
35
36 const auto jacobianinvT0 = toEigen(geometry.jacobianInverseTransposed(quadPos0));
37 const auto detJ0 = geometry.integrationElement(quadPos0);
38
39 auto jaco = (jacobianinvT0).inverse().eval();
40 auto J11 = jaco(0, 0);
41 auto J12 = jaco(0, 1);
42 auto J21 = jaco(1, 0);
43 auto J22 = jaco(1, 1);
44
45 Eigen::Matrix3d T0;
46 // clang-format off
47 T0 << J11 * J11, J12 * J12, J11 * J12,
48 J21 * J21, J22 * J22, J21 * J22,
49 2.0 * J11 * J21, 2.0 * J12 * J22, J21 * J12 + J11 * J22;
50 // clang-format on
51 return T0.inverse() * detJ0;
52 }
53
63 template <typename Geometry>
64 Eigen::Matrix<double, 6, 6> calcTransformationMatrix3D(const Geometry& geometry) {
65 const auto& referenceElement = Dune::ReferenceElements<double, 3>::general(geometry.type());
66 const auto quadPos0 = referenceElement.position(0, 0);
67
68 const auto jacobianinvT0 = toEigen(geometry.jacobianInverseTransposed(quadPos0));
69 const auto detJ0 = geometry.integrationElement(quadPos0);
70
71 auto jaco = (jacobianinvT0).inverse().eval();
72 auto J11 = jaco(0, 0);
73 auto J12 = jaco(0, 1);
74 auto J13 = jaco(0, 2);
75 auto J21 = jaco(1, 0);
76 auto J22 = jaco(1, 1);
77 auto J23 = jaco(1, 2);
78 auto J31 = jaco(2, 0);
79 auto J32 = jaco(2, 1);
80 auto J33 = jaco(2, 2);
81
82 Eigen::Matrix<double, 6, 6> T0;
83 // clang-format off
84 T0 << J11 * J11, J12 * J12, J13 * J13, J11 * J12, J11 * J13, J12 * J13,
85 J21 * J21, J22 * J22, J23 * J23, J21 * J22, J21 * J23, J22 * J23,
86 J31 * J31, J32 * J32, J33 * J33, J31 * J32, J31 * J33, J32 * J33,
87 2.0 * J11 * J21, 2.0 * J12 * J22, 2.0 * J13 * J23, J11 * J22 + J21 * J12, J11 * J23 + J21 * J13, J12 * J23 + J22 * J13,
88 2.0 * J11 * J31, 2.0 * J12 * J32, 2.0 * J13 * J33, J11 * J32 + J31 * J12, J11 * J33 + J31 * J13, J12 * J33 + J32 * J13,
89 2.0 * J31 * J21, 2.0 * J32 * J22, 2.0 * J33 * J23, J31 * J22 + J21 * J32, J31 * J23 + J21 * J33, J32 * J23 + J22 * J33;
90 // clang-format on
91
92 return T0.inverse() * detJ0;
93 }
94
104 template <typename Geometry>
105 struct EASQ1E4 {
106 static constexpr int strainSize = 3;
107 static constexpr int enhancedStrainSize = 4;
108 using MType = Eigen::Matrix<double, strainSize, enhancedStrainSize>;
109
110 EASQ1E4() = default;
111 explicit EASQ1E4(const Geometry& geometry_)
112 : geometry{std::make_shared<Geometry>(geometry_)},
114
115 auto calcM(const Dune::FieldVector<double, 2>& quadPos) const {
116 MType M;
117 M.setZero(strainSize, enhancedStrainSize);
118 const double xi = quadPos[0];
119 const double eta = quadPos[1];
120 M(0, 0) = 2 * xi - 1.0;
121 M(1, 1) = 2 * eta - 1.0;
122 M(2, 2) = 2 * xi - 1.0;
123 M(2, 3) = 2 * eta - 1.0;
124 const double detJ = geometry->integrationElement(quadPos);
125 M = T0InverseTransformed / detJ * M;
126 return M;
127 }
128
129 std::shared_ptr<Geometry> geometry;
130 Eigen::Matrix3d T0InverseTransformed;
131 };
132
140 template <typename Geometry>
141 struct EASQ1E5 {
142 static constexpr int strainSize = 3;
143 static constexpr int enhancedStrainSize = 5;
144 using MType = Eigen::Matrix<double, strainSize, enhancedStrainSize>;
145
146 EASQ1E5() = default;
147 explicit EASQ1E5(const Geometry& geometry_)
148 : geometry{std::make_shared<Geometry>(geometry_)},
150
151 auto calcM(const Dune::FieldVector<double, 2>& quadPos) const {
152 MType M;
153 M.setZero();
154 const double xi = quadPos[0];
155 const double eta = quadPos[1];
156 M(0, 0) = 2 * xi - 1.0;
157 M(1, 1) = 2 * eta - 1.0;
158 M(2, 2) = 2 * xi - 1.0;
159 M(2, 3) = 2 * eta - 1.0;
160 M(2, 4) = (2 * xi - 1.0) * (2 * eta - 1.0);
161 const double detJ = geometry->integrationElement(quadPos);
162 M = T0InverseTransformed / detJ * M;
163 return M;
164 }
165
166 std::shared_ptr<Geometry> geometry;
167 Eigen::Matrix3d T0InverseTransformed;
168 };
169
177 template <typename Geometry>
178 struct EASQ1E7 {
179 static constexpr int strainSize = 3;
180 static constexpr int enhancedStrainSize = 7;
181 using MType = Eigen::Matrix<double, strainSize, enhancedStrainSize>;
182
183 EASQ1E7() = default;
184 explicit EASQ1E7(const Geometry& geometry_)
185 : geometry{std::make_shared<Geometry>(geometry_)},
187
188 auto calcM(const Dune::FieldVector<double, 2>& quadPos) const {
189 MType M;
190 M.setZero();
191 const double xi = quadPos[0];
192 const double eta = quadPos[1];
193 M(0, 0) = 2 * xi - 1.0;
194 M(1, 1) = 2 * eta - 1.0;
195 M(2, 2) = 2 * xi - 1.0;
196 M(2, 3) = 2 * eta - 1.0;
197 M(0, 4) = (2 * xi - 1.0) * (2 * eta - 1.0);
198 M(1, 5) = (2 * xi - 1.0) * (2 * eta - 1.0);
199 M(2, 6) = (2 * xi - 1.0) * (2 * eta - 1.0);
200 const double detJ = geometry->integrationElement(quadPos);
201 M = T0InverseTransformed / detJ * M;
202 return M;
203 }
204
205 std::shared_ptr<Geometry> geometry;
206 Eigen::Matrix3d T0InverseTransformed;
207 };
208
216 template <typename Geometry>
217 struct EASH1E9 {
218 static constexpr int strainSize = 6;
219 static constexpr int enhancedStrainSize = 9;
220 using MType = Eigen::Matrix<double, strainSize, enhancedStrainSize>;
221
222 EASH1E9() = default;
223 explicit EASH1E9(const Geometry& geometry_)
224 : geometry{std::make_shared<Geometry>(geometry_)},
226
227 auto calcM(const Dune::FieldVector<double, 3>& quadPos) const {
228 MType M;
229 M.setZero();
230 const double xi = quadPos[0];
231 const double eta = quadPos[1];
232 const double zeta = quadPos[2];
233 M(0, 0) = 2 * xi - 1.0;
234 M(1, 1) = 2 * eta - 1.0;
235 M(2, 2) = 2 * zeta - 1.0;
236 M(3, 3) = 2 * xi - 1.0;
237 M(3, 4) = 2 * eta - 1.0;
238 M(4, 5) = 2 * xi - 1.0;
239 M(4, 6) = 2 * zeta - 1.0;
240 M(5, 7) = 2 * eta - 1.0;
241 M(5, 8) = 2 * zeta - 1.0;
242 const double detJ = geometry->integrationElement(quadPos);
243 M = T0InverseTransformed / detJ * M;
244 return M;
245 }
246 std::shared_ptr<Geometry> geometry;
247 Eigen::Matrix<double, 6, 6> T0InverseTransformed;
248 };
249
257 template <typename Geometry>
258 struct EASH1E21 {
259 static constexpr int strainSize = 6;
260 static constexpr int enhancedStrainSize = 21;
261 using MType = Eigen::Matrix<double, strainSize, enhancedStrainSize>;
262
263 EASH1E21() = default;
264 explicit EASH1E21(const Geometry& geometry_)
265 : geometry{std::make_shared<Geometry>(geometry_)},
267
268 auto calcM(const Dune::FieldVector<double, 3>& quadPos) const {
269 MType M;
270 M.setZero();
271 const double xi = quadPos[0];
272 const double eta = quadPos[1];
273 const double zeta = quadPos[2];
274 M(0, 0) = 2 * xi - 1.0;
275 M(1, 1) = 2 * eta - 1.0;
276 M(2, 2) = 2 * zeta - 1.0;
277 M(3, 3) = 2 * xi - 1.0;
278 M(3, 4) = 2 * eta - 1.0;
279 M(4, 5) = 2 * xi - 1.0;
280 M(4, 6) = 2 * zeta - 1.0;
281 M(5, 7) = 2 * eta - 1.0;
282 M(5, 8) = 2 * zeta - 1.0;
283
284 M(3, 9) = (2 * xi - 1.0) * (2 * zeta - 1.0);
285 M(3, 10) = (2 * eta - 1.0) * (2 * zeta - 1.0);
286 M(4, 11) = (2 * xi - 1.0) * (2 * eta - 1.0);
287 M(4, 12) = (2 * eta - 1.0) * (2 * zeta - 1.0);
288 M(5, 13) = (2 * xi - 1.0) * (2 * eta - 1.0);
289 M(5, 14) = (2 * xi - 1.0) * (2 * zeta - 1.0);
290
291 M(0, 15) = (2 * xi - 1.0) * (2 * eta - 1.0);
292 M(0, 16) = (2 * xi - 1.0) * (2 * zeta - 1.0);
293 M(1, 17) = (2 * xi - 1.0) * (2 * eta - 1.0);
294 M(1, 18) = (2 * eta - 1.0) * (2 * zeta - 1.0);
295 M(2, 19) = (2 * xi - 1.0) * (2 * zeta - 1.0);
296 M(2, 20) = (2 * eta - 1.0) * (2 * zeta - 1.0);
297
298 const double detJ = geometry->integrationElement(quadPos);
299 M = T0InverseTransformed / detJ * M;
300 return M;
301 }
302
303 std::shared_ptr<Geometry> geometry;
304 Eigen::Matrix<double, 6, 6> T0InverseTransformed;
305 };
306
314 template <typename Geometry>
315 using EAS2DVariant = std::variant<std::monostate, EASQ1E4<Geometry>, EASQ1E5<Geometry>, EASQ1E7<Geometry>>;
316
324 template <typename Geometry>
325 using EAS3DVariant = std::variant<std::monostate, EASH1E9<Geometry>, EASH1E21<Geometry>>;
326
336 template <typename DisplacementBasedElement>
337 class EnhancedAssumedStrains : public DisplacementBasedElement {
338 public:
339 using FERequirementType = typename DisplacementBasedElement::FERequirementType;
340 using ResultRequirementsType = typename DisplacementBasedElement::ResultRequirementsType;
341 using LocalView = typename DisplacementBasedElement::LocalView;
342 using GridView = typename DisplacementBasedElement::GridView;
343 using Traits = typename DisplacementBasedElement::Traits;
344 using DisplacementBasedElement::localView;
345
354 template <typename... Args>
355 requires(not std::is_same_v<std::remove_cvref_t<std::tuple_element_t<0, std::tuple<Args...>>>,
357 : DisplacementBasedElement(std::forward<Args>(args)...) {}
358
367 double calculateScalar(const FERequirementType& par) const {
368 if (isDisplacementBased()) return DisplacementBasedElement::calculateScalar(par);
369 DUNE_THROW(Dune::NotImplemented,
370 "EAS element do not support any scalar calculations, i.e. they are not derivable from a potential");
371 }
372
378 bool isDisplacementBased() const { return std::holds_alternative<std::monostate>(easVariant_); }
379
388 inline void calculateVector(const FERequirementType& par, typename Traits::template VectorType<> force) const {
389 calculateVectorImpl<double>(par, force);
390 }
391
397 const auto& easVariant() const { return easVariant_; }
398
405 return std::visit(
406 [&]<typename EAST>(const EAST&) {
407 if constexpr (std::is_same_v<std::monostate, EAST>)
408 return 0;
409 else
410 return EAST::enhancedStrainSize;
411 },
412 easVariant_);
413 }
414
423 void calculateMatrix(const FERequirementType& par, typename Traits::template MatrixType<> K) const {
424 using namespace Dune::DerivativeDirections;
425 using namespace Dune;
426
430 DisplacementBasedElement::calculateMatrix(par, K);
431
432 if (isDisplacementBased()) return;
433
434 std::visit(
435 [&]<typename EAST>(const EAST& easFunction) {
436 if constexpr (not std::is_same_v<std::monostate, EAST>) {
437 constexpr int enhancedStrainSize = EAST::enhancedStrainSize;
438 Eigen::Matrix<double, enhancedStrainSize, enhancedStrainSize> D;
439 calculateDAndLMatrix(easFunction, par, D, L);
440
441 K.template triangularView<Eigen::Upper>() -= L.transpose() * D.inverse() * L;
442 K.template triangularView<Eigen::StrictlyLower>() = K.transpose();
443 }
444 },
445 easVariant_);
446 }
447
463 ResultTypeMap<double>& result) const {
464 using namespace Dune::Indices;
465 using namespace Dune::DerivativeDirections;
466 using namespace Dune;
467
468 DisplacementBasedElement::calculateAt(req, local, result);
469
470 if (isDisplacementBased()) return;
471
472 const auto& par = req.getFERequirements();
473 const auto C = DisplacementBasedElement::materialTangentFunction(req.getFERequirements());
474 const auto& numberOfNodes = DisplacementBasedElement::numberOfNodes();
475 auto uFunction = DisplacementBasedElement::displacementFunction(par);
476 const auto disp = Dune::viewAsFlatEigenVector(uFunction.coefficientsRef());
477
478 std::visit(
479 [&]<typename EAST>(const EAST& easFunction) {
480 if constexpr (not std::is_same_v<std::monostate, EAST>) {
481 constexpr int enhancedStrainSize = EAST::enhancedStrainSize;
482 Eigen::Matrix<double, enhancedStrainSize, enhancedStrainSize> D;
483 calculateDAndLMatrix(easFunction, req.getFERequirements(), D, L);
484 const auto alpha = (-D.inverse() * L * disp).eval();
485 const auto M = easFunction.calcM(local);
486 const auto CEval = C(local);
487 auto easStress = (CEval * M * alpha).eval();
488 typename ResultTypeMap<double>::ResultArray resultVector;
489 if (req.isResultRequested(ResultType::linearStress)) {
490 resultVector.resize(3, 1);
491 resultVector = result.getResult(ResultType::linearStress) + easStress;
493 } else
494 DUNE_THROW(Dune::NotImplemented, "The requested result type is NOT implemented.");
495 }
496 },
497 easVariant_);
498 }
499
505 void setEASType(int numberOfEASParameters_) {
506 const auto& numberOfNodes = DisplacementBasedElement::numberOfNodes();
507 if (not((numberOfNodes == 4 and Traits::mydim == 2) or (numberOfNodes == 8 and Traits::mydim == 3))
508 and (not isDisplacementBased()))
509 DUNE_THROW(Dune::NotImplemented, "EAS only supported for Q1 or H1 elements");
510
511 if constexpr (Traits::mydim == 2) {
512 switch (numberOfEASParameters_) {
513 case 0:
514 easVariant_ = std::monostate();
515 break;
516 case 4:
517 easVariant_ = EASQ1E4(localView().element().geometry());
518 break;
519 case 5:
520 easVariant_ = EASQ1E5(localView().element().geometry());
521 break;
522 case 7:
523 easVariant_ = EASQ1E7(localView().element().geometry());
524 break;
525 default:
526 DUNE_THROW(Dune::NotImplemented, "The given EAS parameters are not available for the 2D case.");
527 break;
528 }
529 } else if constexpr (Traits::mydim == 3) {
530 switch (numberOfEASParameters_) {
531 case 0:
532 easVariant_ = std::monostate();
533 break;
534 case 9:
535 easVariant_ = EASH1E9(localView().element().geometry());
536 break;
537 case 21:
538 easVariant_ = EASH1E21(localView().element().geometry());
539 break;
540 default:
541 DUNE_THROW(Dune::NotImplemented, "The given EAS parameters are not available for the 3D case.");
542 break;
543 }
544 }
545 }
546
547 protected:
548 template <typename ScalarType>
549 inline ScalarType calculateScalarImpl(const FERequirementType& par,
550 const std::optional<const Eigen::VectorX<ScalarType>>& dx
551 = std::nullopt) const {
552 if (isDisplacementBased()) return DisplacementBasedElement::template calculateScalarImpl<ScalarType>(par, dx);
553 DUNE_THROW(Dune::NotImplemented,
554 "EAS element do not support any scalar calculations, i.e. they are not derivable from a potential");
555 }
556
557 template <typename ScalarType>
558 void calculateVectorImpl(const FERequirementType& par, typename Traits::template VectorType<ScalarType> force,
559 const std::optional<const Eigen::VectorX<ScalarType>>& dx = std::nullopt) const {
560 DisplacementBasedElement::calculateVectorImpl(par, force, dx);
561 if (isDisplacementBased()) return;
562 using namespace Dune;
563 const auto uFunction = DisplacementBasedElement::displacementFunction(par, dx);
564 auto strainFunction = DisplacementBasedElement::strainFunction(par, dx);
565 const auto& numberOfNodes = DisplacementBasedElement::numberOfNodes();
566 const auto disp = Dune::viewAsFlatEigenVector(uFunction.coefficientsRef());
567
568 using namespace Dune::DerivativeDirections;
569
570 auto C = DisplacementBasedElement::materialTangentFunction(par);
571 const auto geo = localView().element().geometry();
572
573 // Internal forces from enhanced strains
574 std::visit(
575 [&]<typename EAST>(const EAST& easFunction) {
576 if constexpr (not std::is_same_v<std::monostate, EAST>) {
577 constexpr int enhancedStrainSize = EAST::enhancedStrainSize;
578 Eigen::Matrix<double, enhancedStrainSize, enhancedStrainSize> D;
579 calculateDAndLMatrix(easFunction, par, D, L);
580
581 const auto alpha = (-D.inverse() * L * disp).eval();
582
583 for (const auto& [gpIndex, gp] : strainFunction.viewOverIntegrationPoints()) {
584 const auto M = easFunction.calcM(gp.position());
585 const double intElement = geo.integrationElement(gp.position()) * gp.weight();
586 const auto CEval = C(gpIndex);
587 auto stresses = (CEval * M * alpha).eval();
588 for (size_t i = 0; i < numberOfNodes; ++i) {
589 const auto bopI = strainFunction.evaluateDerivative(gpIndex, wrt(coeff(i)), on(gridElement));
590 force.template segment<Traits::worlddim>(Traits::worlddim * i)
591 += bopI.transpose() * stresses * intElement;
592 }
593 }
594 }
595 },
596 easVariant_);
597 }
598
599 private:
602 std::conditional_t<Traits::mydim == 2, EAS2DVariantImpl, EAS3DVariantImpl> easVariant_;
603 mutable Eigen::MatrixXd L;
604 template <int enhancedStrainSize>
605 void calculateDAndLMatrix(const auto& easFunction, const auto& par,
606 Eigen::Matrix<double, enhancedStrainSize, enhancedStrainSize>& DMat,
607 Eigen::MatrixXd& LMat) const {
608 using namespace Dune;
609 using namespace Dune::DerivativeDirections;
610
611 auto strainFunction = DisplacementBasedElement::strainFunction(par);
612 const auto C = DisplacementBasedElement::materialTangentFunction(par);
613 const auto geo = localView().element().geometry();
614 const auto numberOfNodes = DisplacementBasedElement::numberOfNodes();
615 DMat.setZero();
616 LMat.setZero(enhancedStrainSize, localView().size());
617 for (const auto& [gpIndex, gp] : strainFunction.viewOverIntegrationPoints()) {
618 const auto M = easFunction.calcM(gp.position());
619 const auto CEval = C(gpIndex);
620 const double detJ = geo.integrationElement(gp.position());
621 DMat += M.transpose() * CEval * M * detJ * gp.weight();
622 for (size_t i = 0U; i < numberOfNodes; ++i) {
623 const size_t I = Traits::worlddim * i;
624 const auto Bi = strainFunction.evaluateDerivative(gpIndex, wrt(coeff(i)), on(gridElement));
625 LMat.template block<enhancedStrainSize, Traits::worlddim>(0, I)
626 += M.transpose() * CEval * Bi * detJ * gp.weight();
627 }
628 }
629 }
630 };
631} // namespace Ikarus
632
633#else
634# error EnhancedAssumedStrains depends on dune-localfefunctions, which is not included
635#endif
Helper for transform between Dune linear algebra types and Eigen.
Definition of the LinearElastic class for finite element mechanics computations.
auto viewAsFlatEigenVector(Dune::BlockVector< ValueType > &blockedVector)
View Dune::BlockVector as an Eigen::Vector.
Definition: linearalgebrahelper.hh:57
Definition: simpleassemblers.hh:21
std::variant< std::monostate, EASH1E9< Geometry >, EASH1E21< Geometry > > EAS3DVariant
Variant type for 3D EAS structures.
Definition: enhancedassumedstrains.hh:325
Eigen::Matrix3d calcTransformationMatrix2D(const Geometry &geometry)
Calculates the 2D transformation matrix for Enhanced Assumed Strains (EAS).
Definition: enhancedassumedstrains.hh:32
std::variant< std::monostate, EASQ1E4< Geometry >, EASQ1E5< Geometry >, EASQ1E7< Geometry > > EAS2DVariant
Variant type for 2D EAS structures.
Definition: enhancedassumedstrains.hh:315
Eigen::Matrix< double, 6, 6 > calcTransformationMatrix3D(const Geometry &geometry)
Calculates the 3D transformation matrix for Enhanced Assumed Strains (EAS).
Definition: enhancedassumedstrains.hh:64
Definition: resultevaluators.hh:17
Class representing a map of result types to result arrays.
Definition: ferequirements.hh:342
Eigen::Matrix< ParameterType, Eigen::Dynamic, Eigen::Dynamic, 0, 9, 3 > ResultArray
Definition: ferequirements.hh:344
ResultArray & getResult(const ResultType &resultType)
Get the result array for a specific result type.
Definition: ferequirements.hh:368
void insertOrAssignResult(ResultType &&resultType, const ResultArray &resultArray)
Insert or assign a result to the map.
Definition: ferequirements.hh:354
EASQ1E4 structure for Enhanced Assumed Strains (EAS) with linear strains and 4 enhanced modes.
Definition: enhancedassumedstrains.hh:105
static constexpr int strainSize
Definition: enhancedassumedstrains.hh:106
EASQ1E4(const Geometry &geometry_)
Definition: enhancedassumedstrains.hh:111
Eigen::Matrix3d T0InverseTransformed
Definition: enhancedassumedstrains.hh:130
auto calcM(const Dune::FieldVector< double, 2 > &quadPos) const
Definition: enhancedassumedstrains.hh:115
std::shared_ptr< Geometry > geometry
Definition: enhancedassumedstrains.hh:129
Eigen::Matrix< double, strainSize, enhancedStrainSize > MType
Definition: enhancedassumedstrains.hh:108
EASQ1E4()=default
static constexpr int enhancedStrainSize
Definition: enhancedassumedstrains.hh:107
Structure representing EAS for Q1 with 5 enhanced strains.
Definition: enhancedassumedstrains.hh:141
Eigen::Matrix< double, strainSize, enhancedStrainSize > MType
Definition: enhancedassumedstrains.hh:144
static constexpr int enhancedStrainSize
Definition: enhancedassumedstrains.hh:143
EASQ1E5()=default
EASQ1E5(const Geometry &geometry_)
Definition: enhancedassumedstrains.hh:147
auto calcM(const Dune::FieldVector< double, 2 > &quadPos) const
Definition: enhancedassumedstrains.hh:151
std::shared_ptr< Geometry > geometry
Definition: enhancedassumedstrains.hh:166
Eigen::Matrix3d T0InverseTransformed
Definition: enhancedassumedstrains.hh:167
static constexpr int strainSize
Definition: enhancedassumedstrains.hh:142
Structure representing EAS for Q1 with 7 enhanced strains.
Definition: enhancedassumedstrains.hh:178
Eigen::Matrix< double, strainSize, enhancedStrainSize > MType
Definition: enhancedassumedstrains.hh:181
EASQ1E7()=default
static constexpr int strainSize
Definition: enhancedassumedstrains.hh:179
EASQ1E7(const Geometry &geometry_)
Definition: enhancedassumedstrains.hh:184
auto calcM(const Dune::FieldVector< double, 2 > &quadPos) const
Definition: enhancedassumedstrains.hh:188
std::shared_ptr< Geometry > geometry
Definition: enhancedassumedstrains.hh:205
Eigen::Matrix3d T0InverseTransformed
Definition: enhancedassumedstrains.hh:206
static constexpr int enhancedStrainSize
Definition: enhancedassumedstrains.hh:180
Structure representing EAS for H1 with 9 enhanced strains.
Definition: enhancedassumedstrains.hh:217
auto calcM(const Dune::FieldVector< double, 3 > &quadPos) const
Definition: enhancedassumedstrains.hh:227
EASH1E9(const Geometry &geometry_)
Definition: enhancedassumedstrains.hh:223
static constexpr int strainSize
Definition: enhancedassumedstrains.hh:218
Eigen::Matrix< double, 6, 6 > T0InverseTransformed
Definition: enhancedassumedstrains.hh:247
EASH1E9()=default
Eigen::Matrix< double, strainSize, enhancedStrainSize > MType
Definition: enhancedassumedstrains.hh:220
std::shared_ptr< Geometry > geometry
Definition: enhancedassumedstrains.hh:246
static constexpr int enhancedStrainSize
Definition: enhancedassumedstrains.hh:219
Structure representing EAS for H1 with 21 enhanced strains.
Definition: enhancedassumedstrains.hh:258
auto calcM(const Dune::FieldVector< double, 3 > &quadPos) const
Definition: enhancedassumedstrains.hh:268
EASH1E21(const Geometry &geometry_)
Definition: enhancedassumedstrains.hh:264
EASH1E21()=default
static constexpr int strainSize
Definition: enhancedassumedstrains.hh:259
std::shared_ptr< Geometry > geometry
Definition: enhancedassumedstrains.hh:303
Eigen::Matrix< double, strainSize, enhancedStrainSize > MType
Definition: enhancedassumedstrains.hh:261
static constexpr int enhancedStrainSize
Definition: enhancedassumedstrains.hh:260
Eigen::Matrix< double, 6, 6 > T0InverseTransformed
Definition: enhancedassumedstrains.hh:304
Wrapper class for using Enhanced Assumed Strains (EAS) with displacement based elements.
Definition: enhancedassumedstrains.hh:337
EnhancedAssumedStrains(Args &&... args)
Constructor for Enhanced Assumed Strains elements.
Definition: enhancedassumedstrains.hh:356
void calculateAt(const ResultRequirementsType &req, const Dune::FieldVector< double, Traits::mydim > &local, ResultTypeMap< double > &result) const
Calculates the results at a given set of local coordinates using the Enhanced Assumed Strains (EAS) m...
Definition: enhancedassumedstrains.hh:462
bool isDisplacementBased() const
Checks if the element is displacement-based and the EAS is turned off.
Definition: enhancedassumedstrains.hh:378
void setEASType(int numberOfEASParameters_)
Sets the EAS type for 2D elements.
Definition: enhancedassumedstrains.hh:505
void calculateVector(const FERequirementType &par, typename Traits::template VectorType<> force) const
Calculates vectorial quantities for the element.
Definition: enhancedassumedstrains.hh:388
typename DisplacementBasedElement::Traits Traits
Definition: enhancedassumedstrains.hh:343
typename DisplacementBasedElement::LocalView LocalView
Definition: enhancedassumedstrains.hh:341
typename DisplacementBasedElement::FERequirementType FERequirementType
Definition: enhancedassumedstrains.hh:339
typename DisplacementBasedElement::ResultRequirementsType ResultRequirementsType
Definition: enhancedassumedstrains.hh:340
void calculateMatrix(const FERequirementType &par, typename Traits::template MatrixType<> K) const
Calculates the matrix for the element.
Definition: enhancedassumedstrains.hh:423
double calculateScalar(const FERequirementType &par) const
Calculates a scalar quantity for the element.
Definition: enhancedassumedstrains.hh:367
auto getNumberOfEASParameters() const
Gets the number of EAS parameters based on the current EAS type.
Definition: enhancedassumedstrains.hh:404
const auto & easVariant() const
Gets the variant representing the type of Enhanced Assumed Strains (EAS).
Definition: enhancedassumedstrains.hh:397
typename DisplacementBasedElement::GridView GridView
Definition: enhancedassumedstrains.hh:342
void calculateVectorImpl(const FERequirementType &par, typename Traits::template VectorType< ScalarType > force, const std::optional< const Eigen::VectorX< ScalarType > > &dx=std::nullopt) const
Definition: enhancedassumedstrains.hh:558
ScalarType calculateScalarImpl(const FERequirementType &par, const std::optional< const Eigen::VectorX< ScalarType > > &dx=std::nullopt) const
Definition: enhancedassumedstrains.hh:549
Definition: resultevaluators.hh:20