version 0.4.7
displacementpressure.hh
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2021-2025 The Ikarus Developers ikarus@ibb.uni-stuttgart.de
2// SPDX-License-Identifier: LGPL-3.0-or-later
3
10#pragma once
11
12#if HAVE_DUNE_LOCALFEFUNCTIONS
13 #include <dune/fufem/boundarypatch.hh>
14 #include <dune/geometry/quadraturerules.hh>
15 #include <dune/geometry/type.hh>
16 #include <dune/localfefunctions/cachedlocalBasis/cachedlocalBasis.hh>
17 #include <dune/localfefunctions/expressions/greenLagrangeStrains.hh>
18 #include <dune/localfefunctions/impl/standardLocalFunction.hh>
19 #include <dune/localfefunctions/manifolds/realTuple.hh>
20
34
35namespace Ikarus {
36
37namespace Impl {
38
46 template <Concepts::Material DEV, Concepts::Material VOL>
47 struct DPConstitutiveDriver
48 {
49 static constexpr auto strainType = StrainTags::greenLagrangian;
50
51 auto Uhat(const auto& Estrain) const { return vol_.template storedEnergy<strainType>(Estrain); }
52
53 auto storedEnergy(const auto& Estrain, const auto& p) {
54 auto Wdev = dev_.template storedEnergy<strainType>(Estrain);
55 auto uhat = Uhat(Estrain);
56 return Wdev + p * uhat - (1.0 / (2.0 * kappa_)) * Dune::power(p, 2);
57 }
58
59 auto firstDerivatives(const auto& Estrain, const auto& p) const {
60 const auto Sdev = dev_.template stresses<strainType, true>(Estrain);
61 const auto dUdE = vol_.template stresses<strainType, true>(Estrain);
62 const auto S = (Sdev + p * dUdE).eval();
63 return std::make_tuple(dUdE, S);
64 }
65
66 auto secondDerivative(const auto& Estrain, const auto& p) const {
67 const auto Cdev = dev_.template tangentModuli<strainType, true>(Estrain);
68 const auto d2UdE2 = vol_.template tangentModuli<strainType, true>(Estrain);
69 const auto C = (Cdev + p * d2UdE2).eval();
70 return C;
71 }
72
73 double kappa() const { return kappa_; }
74
75 DEV deviatoricMaterial() const { return dev_; }
76 VOL volumetricMaterial() const { return vol_; }
77
78 DPConstitutiveDriver(const DEV& dev, const VOL& vol, double kappa)
79 : dev_(dev),
80 vol_(vol),
81 kappa_(kappa) {}
82
88 template <typename STO>
89 auto rebind() const {
90 auto reboundDEV = dev_.template rebind<STO>();
91 auto reboundVOL = vol_.template rebind<STO>();
92 return DPConstitutiveDriver<decltype(reboundDEV), decltype(reboundVOL)>(reboundDEV, reboundVOL, kappa_);
93 }
94
95 private:
96 DEV dev_;
97 VOL vol_;
98 double kappa_;
99 };
100
101} // namespace Impl
102template <typename PreFE, typename FE, typename PRE>
103class DisplacementPressure;
104
109template <Concepts::Material MAT>
111{
112 using Material = MAT;
114
115 template <typename PreFE, typename FE>
117};
118
128template <typename PreFE, typename FE, typename PRE>
129class DisplacementPressure : public ResultTypeBase<ResultTypes::PK2Stress, ResultTypes::PK2StressFull>
130{
131public:
133 using Basis = typename Traits::Basis;
134 using FlatBasis = typename Traits::FlatBasis;
136 using LocalView = typename Traits::LocalView;
137 using Geometry = typename Traits::Geometry;
138 using GridView = typename Traits::GridView;
139 using Element = typename Traits::Element;
140 using Pre = PRE;
141
143 decltype(std::declval<LocalView>().tree().child(Dune::Indices::_0).child(0).finiteElement().localBasis());
145 decltype(std::declval<LocalView>().tree().child(Dune::Indices::_1).finiteElement().localBasis());
146
147 template <typename ST>
148 using VectorXOptRef = std::optional<std::reference_wrapper<const Eigen::VectorX<ST>>>;
149
150 static constexpr int myDim = Traits::mydim;
151 static constexpr int strainDim = myDim * (myDim + 1) / 2;
153 static constexpr auto stressType = StressTags::PK2;
154
155 template <template <typename, int, int> class RT>
157
158 template <typename ST = double>
159 using StrainType = Eigen::Vector<ST, strainDim>;
160
161 template <typename ST = double>
162 using BopType = Eigen::Matrix<ST, strainDim, myDim>;
163
164 template <typename ST = double>
165 using KgType = Eigen::Matrix<ST, myDim, myDim>;
166
167 using MaterialType = typename Pre::Material;
168
169 template <typename MAT>
171
172 template <typename MAT>
174
176 Impl::DPConstitutiveDriver<DecomposedDevType<MaterialType>, DecomposedVolType<MaterialType>>;
177
182 explicit DisplacementPressure(const Pre& pre)
183 : constitutiveDriver_([](const auto& mat) {
184 auto [dev, vol, devParams, volParams] = Materials::decomposeHyperelasticAndGetMaterialParameters(mat);
185 return DPConstitutiveDriverType(dev, vol, volParams);
186 }(pre.material)) {
187 static_assert(Pre::Material::isHyperelastic, "DisplacementPressure is only implemented for the hyperelastic case.");
188 }
189
190protected:
194 void bindImpl() {
195 const auto& localView = underlying().localView();
196 const auto& element = localView.element();
197 auto& firstChild = localView.tree().child(Dune::Indices::_0);
198 const auto& firstFE = firstChild.child(0).finiteElement();
199
200 auto& secondChild = localView.tree().child(Dune::Indices::_1);
201 const auto& secondFE = secondChild.finiteElement();
202
203 geo_ = std::make_shared<const Geometry>(element.geometry());
204 numberOfNodes_ = firstFE.size();
205 order_ = 2 * firstFE.localBasis().order();
206 localBasisU_ = Dune::CachedLocalBasis(firstFE.localBasis());
207 localBasisP_ = Dune::CachedLocalBasis(secondFE.localBasis());
208
209 if (underlying().quadratureRule()) {
210 localBasisU_.bind(underlying().quadratureRule().value(), Dune::bindDerivatives(0, 1));
211 localBasisP_.bind(underlying().quadratureRule().value(), Dune::bindDerivatives(0, 1));
212 } else {
213 localBasisU_.bind(defaultQuadratureRule<myDim>(element, order_), Dune::bindDerivatives(0, 1));
214 localBasisP_.bind(defaultQuadratureRule<myDim>(element, order_), Dune::bindDerivatives(0, 1));
215 }
216 }
217
218public:
227 template <typename ScalarType = double>
228 auto displacementFunction(const Requirement& par, const VectorXOptRef<ScalarType>& dx = std::nullopt) const {
229 const auto& d = par.globalSolution();
230 auto disp =
231 Ikarus::FEHelper::localSolutionBlockVectorComposite<Traits>(d, underlying().localView(), Dune::Indices::_0, dx);
232 Dune::StandardLocalFunction uFunction(localBasisU_, disp, geo_);
233 return uFunction;
234 }
235
244 template <typename ScalarType = double>
245 auto pressureFunction(const Requirement& par, const VectorXOptRef<ScalarType>& dx = std::nullopt) const {
246 const auto& d = par.globalSolution();
247 auto pressure =
248 Ikarus::FEHelper::localSolutionBlockVectorScalar<Traits>(d, underlying().localView(), Dune::Indices::_1, dx);
249
250 Dune::StandardLocalFunction pFunction(localBasisP_, pressure, geo_);
251 return pFunction;
252 }
253
262 template <typename ScalarType = double>
263 inline auto strainFunction(const Requirement& par, const VectorXOptRef<ScalarType>& dx = std::nullopt) const {
264 return Dune::greenLagrangeStrains(displacementFunction(par, dx));
265 }
266
267 const Geometry& geometry() const { return *geo_; }
268 [[nodiscard]] size_t numberOfNodes() const { return numberOfNodes_; }
269 [[nodiscard]] int order() const { return order_; }
270 const Dune::CachedLocalBasis<std::remove_cvref_t<LocalBasisTypeU>>& localBasis() const { return localBasisU_; }
271 const Dune::CachedLocalBasis<std::remove_cvref_t<LocalBasisTypeP>>& localBasisP() const { return localBasisP_; }
272
273 template <typename ScalarType = double>
274 decltype(auto) constitutiveDriver() const {
276 return constitutiveDriver_.template rebind<ScalarType>();
277 else
278 return constitutiveDriver_;
279 }
280
281public:
288 template <template <typename, int, int> class RT>
289 requires(supportsResultType<RT>())
290 auto resultFunction() const {
291 return [&](const Eigen::Vector<double, strainDim>& strainInVoigt, double p) {
292 if constexpr (isSameResultType<RT, ResultTypes::PK2Stress> or isSameResultType<RT, ResultTypes::PK2StressFull>) {
293 auto [dev, vol] = [&]() {
294 if constexpr (isSameResultType<RT, ResultTypes::PK2StressFull> and PRE::Material::isReduced)
295 return std::make_pair(constitutiveDriver_.deviatoricMaterial().underlying(),
296 constitutiveDriver_.volumetricMaterial().underlying());
297 else
298 return std::make_pair(constitutiveDriver_.deviatoricMaterial(), constitutiveDriver_.volumetricMaterial());
299 }();
300
301 return RTWrapperType<RT>{
302 dev.template stresses<strainType>(enlargeIfReduced<typename PRE::Material>(strainInVoigt)) +
303 p * vol.template stresses<strainType>(enlargeIfReduced<typename PRE::Material>(strainInVoigt))};
304 }
305 };
306 }
307
317 template <template <typename, int, int> class RT>
318 requires(supportsResultType<RT>())
320 Dune::PriorityTag<1>) const {
321 using namespace Dune::DerivativeDirections;
322
323 if constexpr (isSameResultType<RT, ResultTypes::PK2Stress> or isSameResultType<RT, ResultTypes::PK2StressFull>) {
324 const auto uFunction = displacementFunction(req);
325 const auto pFunction = pressureFunction(req);
326
327 const auto rFunction = resultFunction<RT>();
328 const auto H = uFunction.evaluateDerivative(local, Dune::wrt(spatialAll), Dune::on(gridElement));
329 const auto p = pFunction.evaluate(local, Dune::on(gridElement)).eval();
330 const auto E = (0.5 * (H.transpose() + H + H.transpose() * H)).eval();
331
332 return rFunction(toVoigt(E), p[0]);
333 }
334 }
335
336private:
337 //> CRTP
338 const auto& underlying() const { return static_cast<const FE&>(*this); }
339 auto& underlying() { return static_cast<FE&>(*this); }
340 std::shared_ptr<const Geometry> geo_;
341 Dune::CachedLocalBasis<std::remove_cvref_t<LocalBasisTypeU>> localBasisU_;
342 Dune::CachedLocalBasis<std::remove_cvref_t<LocalBasisTypeP>> localBasisP_;
343 DPConstitutiveDriverType constitutiveDriver_;
344 size_t numberOfNodes_{0};
345 int order_{};
346
347public:
358 template <typename ST>
359 auto geometricStiffnessMatrixFunction(const Requirement& par, typename Traits::template MatrixType<ST>& K,
360 const VectorXOptRef<ST>& dx = std::nullopt) const {
361 return [&](const FE::template KgType<ST>& kgIJ, const int I, const int J, const auto& gp) {
362 const auto geo = underlying().localView().element().geometry();
363 const double intElement = geo.integrationElement(gp.position()) * gp.weight();
364 K.template block<FE::myDim, FE::myDim>(I * FE::myDim, J * FE::myDim) += kgIJ * intElement;
365 };
366 }
377 template <typename ST>
378 auto materialStiffnessMatrixFunction(const Requirement& par, typename Traits::template MatrixType<ST>& K,
379 const VectorXOptRef<ST>& dx = std::nullopt) const {
380 return
381 [&](const auto& C, const BopType<ST>& bopI, const BopType<ST>& bopJ, const int I, const int J, const auto& gp) {
382 const double intElement = geo_->integrationElement(gp.position()) * gp.weight();
383 K.template block<myDim, myDim>(I * myDim, J * myDim) += (bopI.transpose() * C * bopJ) * intElement;
384 };
385 }
386
398 template <typename ST>
399 auto internalForcesFunction(const Requirement& par, typename Traits::template VectorType<ST>& force,
400 const VectorXOptRef<ST>& dx = std::nullopt) const {
401 return [&](const StrainType<ST>& stresses, const BopType<ST>& bopI, const int I, const auto& gp) {
402 const double intElement = geo_->integrationElement(gp.position()) * gp.weight();
403 force.template segment<myDim>(myDim * I) += bopI.transpose() * stresses * intElement;
404 };
405 }
406
415 template <typename ST>
416 auto energyFunction(const Requirement& par, const VectorXOptRef<ST>& dx = std::nullopt) const {
417 return [&]() -> ST {
418 using namespace Dune::DerivativeDirections;
419 using namespace Dune;
420 ST energy = 0.0;
421 const auto eps = strainFunction(par, dx);
422 const auto pFunction = pressureFunction(par, dx);
423 for (const auto& [gpIndex, gp] : eps.viewOverIntegrationPoints()) {
424 const auto EVoigt = eps.evaluate(gpIndex, on(gridElement));
425 const auto p = pFunction.evaluate(gpIndex, on(gridElement)).eval();
426
427 auto e = constitutiveDriver<ST>().storedEnergy(EVoigt, p[0]);
428 energy += e * geo_->integrationElement(gp.position()) * gp.weight();
429 }
430 return energy;
431 };
432 }
433
434protected:
442 template <typename ScalarType>
443 void calculateMatrixImpl(const Requirement& par, const MatrixAffordance& affordance,
444 typename Traits::template MatrixType<> K,
445 const VectorXOptRef<ScalarType>& dx = std::nullopt) const {
447 static_assert(Dune::AlwaysFalse<ScalarType>::value,
448 "DisplacementPressure element does not support matrix calculations for autodiff scalars");
449 }
450 using namespace Dune::DerivativeDirections;
451 using namespace Dune;
452 const auto pFunction = pressureFunction(par, dx);
453
454 auto pFE = underlying().localView().tree().child(Dune::Indices::_1);
455 auto plocalBasis = pFE.finiteElement().localBasis();
456 std::vector<Dune::FieldVector<double, 1>> Np;
457
458 const auto eps = strainFunction(par, dx);
459 const auto kMFunction = materialStiffnessMatrixFunction<ScalarType>(par, K, dx);
460 const auto kGFunction = geometricStiffnessMatrixFunction<ScalarType>(par, K, dx);
461 for (const auto& [gpIndex, gp] : eps.viewOverIntegrationPoints()) {
462 const auto EVoigt = (eps.evaluate(gpIndex, on(gridElement))).eval();
463 const auto p = pFunction.evaluate(gpIndex, on(gridElement)).eval();
464 plocalBasis.evaluateFunction(gp.position(), Np);
465 const auto intElement = geo_->integrationElement(gp.position()) * gp.weight();
466
467 auto [dUdE, S] = constitutiveDriver<ScalarType>().firstDerivatives(EVoigt, p[0]);
468 auto C = constitutiveDriver<ScalarType>().secondDerivative(EVoigt, p[0]);
469
470 // Loop over u-u
471 for (size_t i = 0; i < numberOfNodes_; ++i) {
472 const auto bopI = eps.evaluateDerivative(gpIndex, wrt(coeff(i)), on(gridElement));
473 for (size_t j = 0; j < numberOfNodes_; ++j) {
474 const auto bopJ = eps.evaluateDerivative(gpIndex, wrt(coeff(j)), on(gridElement));
475 const auto kgIJ = eps.evaluateDerivative(gpIndex, wrt(coeff(i, j)), along(S), on(gridElement));
476 kMFunction(C, bopI, bopJ, i, j, gp);
477 kGFunction(kgIJ, i, j, gp);
478 }
479 }
480
481 // Loop over u-p
482 for (size_t i = 0; i < numberOfNodes_; ++i) {
483 const auto bopI = eps.evaluateDerivative(gpIndex, wrt(coeff(i)), on(gridElement));
484 for (auto j : Dune::range(pFE.size())) {
485 auto jIdx = pFE.localIndex(j);
486 const auto upTerm = (bopI.transpose() * dUdE * Np[j][0]).eval();
487 K.template block<myDim, 1>(i * myDim, jIdx) += upTerm * intElement;
488 }
489 }
490
491 // Loop over p-u
492 for (auto i : Dune::range(pFE.size())) {
493 auto iIdx = pFE.localIndex(i);
494 for (size_t j = 0; j < numberOfNodes_; ++j) {
495 const auto bopJ = eps.evaluateDerivative(gpIndex, wrt(coeff(j)), on(gridElement));
496 const auto upTerm = (bopJ.transpose() * dUdE * Np[i][0]).transpose().eval();
497 K.template block<1, myDim>(iIdx, j * myDim) += upTerm * intElement;
498 }
499 }
500
501 // Loop over p-p
502 for (auto i : Dune::range(pFE.size())) {
503 auto iIdx = pFE.localIndex(i);
504 for (auto j : Dune::range(pFE.size())) {
505 auto jIdx = pFE.localIndex(j);
506 auto ppTerm = Np[i][0] * (1.0 / constitutiveDriver_.kappa()) * Np[j][0];
507 K(iIdx, jIdx) -= ppTerm * intElement;
508 }
509 }
510 }
511 }
512
513 template <typename ScalarType>
515 const VectorXOptRef<ScalarType>& dx = std::nullopt) const -> ScalarType {
516 if constexpr (not Concepts::AutodiffScalar<ScalarType>) {
517 return energyFunction(par, dx)();
518 } else {
519 static_assert(Dune::AlwaysFalse<ScalarType>::value,
520 "DisplacementPressure element does not support scalar calculations for autodiff scalars");
521 }
522 }
523
524 template <typename ScalarType>
526 typename Traits::template VectorType<ScalarType> force,
527 const VectorXOptRef<ScalarType>& dx = std::nullopt) const {
529 static_assert(Dune::AlwaysFalse<ScalarType>::value,
530 "DisplacementPressure element does not support vector calculations for autodiff scalars");
531 }
532 using namespace Dune::DerivativeDirections;
533 using namespace Dune;
534 const auto eps = strainFunction(par, dx);
535 const auto pFunction = pressureFunction(par, dx);
536
537 auto pFE = underlying().localView().tree().child(Dune::Indices::_1);
538 auto plocalBasis = pFE.finiteElement().localBasis();
539 std::vector<Dune::FieldVector<double, 1>> Np;
540
541 const auto fIntFunction = internalForcesFunction<ScalarType>(par, force, dx);
542
543 for (const auto& [gpIndex, gp] : eps.viewOverIntegrationPoints()) {
544 const auto EVoigt = (eps.evaluate(gpIndex, on(gridElement))).eval();
545 const auto p = pFunction.evaluate(gpIndex, on(gridElement)).eval();
546 plocalBasis.evaluateFunction(gp.position(), Np);
547
548 auto [dUdE, S] = constitutiveDriver<ScalarType>().firstDerivatives(EVoigt, p[0]);
549 auto Uhat = constitutiveDriver<ScalarType>().Uhat(EVoigt);
550
551 // Loop over u
552 for (size_t i = 0; i < numberOfNodes_; ++i) {
553 const auto bopI = eps.evaluateDerivative(gpIndex, wrt(coeff(i)), on(gridElement));
554 fIntFunction(S, bopI, i, gp);
555 }
556
557 // Loop over p
558 for (auto i : Dune::range(pFE.size())) {
559 auto iIdx = pFE.localIndex(i);
560 auto pTerm = Np[i][0] * (Uhat - p[0] / constitutiveDriver_.kappa());
561 force(iIdx) += pTerm * geo_->integrationElement(gp.position()) * gp.weight();
562 }
563 }
564 }
565};
566
573template <Concepts::Material MAT>
574auto displacementPressure(const MAT& mat) {
576 return pre;
577}
578
579} // namespace Ikarus
580
581#else
582 #error DisplacementPressure depends on dune-localfefunctions, which is not included
583#endif
Free function for creating a tensor product quadrature rule and other Dune::Quadrature rule utils.
Collection of fallback default functions.
Helper for transform between Dune linear algebra types and Eigen.
Helper for the autodiff library.
Header file for various EAS functions.
Definition of several material related enums.
Definition of helper struct and function to decompose a hyperelastic material model.
Header file for types of loads in Ikarus finite element mechanics.
Material property functions and conversion utilities.
Contains the FE class, which is used as a base class for all finite elements. It provides information...
Definition of the LinearElastic class for finite element mechanics computations.
constexpr Eigen::Index toVoigt(Eigen::Index i, Eigen::Index j) noexcept
Converts 2D indices to Voigt notation index.
Definition: tensorutils.hh:182
Definition: assemblermanipulatorbuildingblocks.hh:22
MatrixAffordance
A strongly typed enum class representing the matrix affordance.
Definition: ferequirements.hh:65
auto displacementPressure(const MAT &mat)
A helper function to create a displacement-pressure pre finite element.
Definition: displacementpressure.hh:574
VectorAffordance
A strongly typed enum class representing the vector affordance.
Definition: ferequirements.hh:50
auto transpose(const Eigen::EigenBase< Derived > &A)
ScalarAffordance
A strongly typed enum class representing the scalar affordance.
Definition: ferequirements.hh:39
auto decomposeHyperelasticAndGetMaterialParameters(const MAT &mat)
A helper function to decompose a hyperelastic material model and get the underlying deviatoric materi...
Definition: decomposehyperelastic.hh:47
Definition: utils/dirichletvalues.hh:35
FE class is a base class for all finite elements.
Definition: febase.hh:79
static constexpr int myDim
Definition: febase.hh:95
FETraits< BH, useEigenRef, useFlat > Traits
Definition: febase.hh:38
Class representing the requirements for finite element calculations.
Definition: ferequirements.hh:224
const SolutionVectorType & globalSolution() const
Get the global solution vector.
Definition: ferequirements.hh:314
Container that is used for FE Results. It gives access to the stored value, but can also be used to a...
Definition: feresulttypes.hh:164
Base class for element definitions that provides common functionality for ResultTypes.
Definition: feresulttypes.hh:277
Traits for handling finite elements.
Definition: fetraits.hh:25
typename Basis::LocalView LocalView
Type of the local view.
Definition: fetraits.hh:42
typename Element::Geometry Geometry
Type of the element geometry.
Definition: fetraits.hh:51
std::conditional_t< useFlat, FlatBasis, UntouchedBasis > Basis
Type of the basis version.
Definition: fetraits.hh:39
typename Basis::GridView GridView
Type of the grid view.
Definition: fetraits.hh:45
typename BasisHandler::FlatBasis FlatBasis
Type of the flat basis.
Definition: fetraits.hh:33
typename LocalView::Element Element
Type of the grid element.
Definition: fetraits.hh:48
static constexpr int mydim
Dimension of the geometry.
Definition: fetraits.hh:63
DisplacementPressure class represents a displacement-pressure finite element.
Definition: displacementpressure.hh:130
decltype(std::declval< LocalView >().tree().child(Dune::Indices::_0).child(0).finiteElement().localBasis()) LocalBasisTypeU
Definition: displacementpressure.hh:143
static constexpr auto strainType
Definition: displacementpressure.hh:152
DisplacementPressure(const Pre &pre)
Constructor for the DisplacementPressure class.
Definition: displacementpressure.hh:182
typename Traits::Geometry Geometry
Definition: displacementpressure.hh:137
static constexpr auto stressType
Definition: displacementpressure.hh:153
decltype(auto) constitutiveDriver() const
Definition: displacementpressure.hh:274
auto calculateAtImpl(const Requirement &req, const Dune::FieldVector< double, Traits::mydim > &local, Dune::PriorityTag< 1 >) const
Calculates a requested result at a specific local position.
Definition: displacementpressure.hh:319
typename Pre::Material MaterialType
Definition: displacementpressure.hh:167
void calculateVectorImpl(const Requirement &par, VectorAffordance affordance, typename Traits::template VectorType< ScalarType > force, const VectorXOptRef< ScalarType > &dx=std::nullopt) const
Definition: displacementpressure.hh:525
int order() const
Definition: displacementpressure.hh:269
std::optional< std::reference_wrapper< const Eigen::VectorX< ST > > > VectorXOptRef
Definition: displacementpressure.hh:148
typename Traits::Basis Basis
Definition: displacementpressure.hh:133
auto geometricStiffnessMatrixFunction(const Requirement &par, typename Traits::template MatrixType< ST > &K, const VectorXOptRef< ST > &dx=std::nullopt) const
Get a lambda function that evaluates the geometric part of the stiffness matrix (Kg) for a given inte...
Definition: displacementpressure.hh:359
typename Traits::Element Element
Definition: displacementpressure.hh:139
Impl::DPConstitutiveDriver< DecomposedDevType< MaterialType >, DecomposedVolType< MaterialType > > DPConstitutiveDriverType
Definition: displacementpressure.hh:176
auto resultFunction() const
Get a lambda function that evaluates the requested result type for a given strain (in Voigt notation)...
Definition: displacementpressure.hh:290
typename Materials::DecomposedMaterialTypes< MaterialType >::DevType DecomposedDevType
Definition: displacementpressure.hh:170
const Geometry & geometry() const
Definition: displacementpressure.hh:267
size_t numberOfNodes() const
Definition: displacementpressure.hh:268
const Dune::CachedLocalBasis< std::remove_cvref_t< LocalBasisTypeU > > & localBasis() const
Definition: displacementpressure.hh:270
typename Traits::GridView GridView
Definition: displacementpressure.hh:138
typename Traits::LocalView LocalView
Definition: displacementpressure.hh:136
void bindImpl()
A helper function to bind the local view to the element.
Definition: displacementpressure.hh:194
auto materialStiffnessMatrixFunction(const Requirement &par, typename Traits::template MatrixType< ST > &K, const VectorXOptRef< ST > &dx=std::nullopt) const
Get a lambda function that evaluates the material part of the stiffness matrix (Ke + Ku) for a given ...
Definition: displacementpressure.hh:378
Eigen::Matrix< ST, myDim, myDim > KgType
Definition: displacementpressure.hh:165
PRE Pre
Definition: displacementpressure.hh:140
typename Materials::DecomposedMaterialTypes< MaterialType >::VolType DecomposedVolType
Definition: displacementpressure.hh:173
static constexpr int strainDim
Definition: displacementpressure.hh:151
typename Traits::FlatBasis FlatBasis
Definition: displacementpressure.hh:134
void calculateMatrixImpl(const Requirement &par, const MatrixAffordance &affordance, typename Traits::template MatrixType<> K, const VectorXOptRef< ScalarType > &dx=std::nullopt) const
Calculate the matrix associated with the given Requirement.
Definition: displacementpressure.hh:443
Eigen::Vector< ST, strainDim > StrainType
Definition: displacementpressure.hh:159
auto strainFunction(const Requirement &par, const VectorXOptRef< ScalarType > &dx=std::nullopt) const
The strain function for the given Requirement.
Definition: displacementpressure.hh:263
auto displacementFunction(const Requirement &par, const VectorXOptRef< ScalarType > &dx=std::nullopt) const
Get the displacement function for the given Requirement.
Definition: displacementpressure.hh:228
auto internalForcesFunction(const Requirement &par, typename Traits::template VectorType< ST > &force, const VectorXOptRef< ST > &dx=std::nullopt) const
Get a lambda function that evaluates the internal force vector for a given strain,...
Definition: displacementpressure.hh:399
decltype(std::declval< LocalView >().tree().child(Dune::Indices::_1).finiteElement().localBasis()) LocalBasisTypeP
Definition: displacementpressure.hh:145
static constexpr int myDim
Definition: displacementpressure.hh:150
auto pressureFunction(const Requirement &par, const VectorXOptRef< ScalarType > &dx=std::nullopt) const
Get the pressure function for the given Requirement.
Definition: displacementpressure.hh:245
Eigen::Matrix< ST, strainDim, myDim > BopType
Definition: displacementpressure.hh:162
auto calculateScalarImpl(const Requirement &par, ScalarAffordance affordance, const VectorXOptRef< ScalarType > &dx=std::nullopt) const -> ScalarType
Definition: displacementpressure.hh:514
const Dune::CachedLocalBasis< std::remove_cvref_t< LocalBasisTypeP > > & localBasisP() const
Definition: displacementpressure.hh:271
auto energyFunction(const Requirement &par, const VectorXOptRef< ST > &dx=std::nullopt) const
Get a lambda function that evaluates the internal energy at a given integration point and its index.
Definition: displacementpressure.hh:416
A PreFE struct for displacement-pressure elements.
Definition: displacementpressure.hh:111
MAT material
Definition: displacementpressure.hh:113
MAT Material
Definition: displacementpressure.hh:112
std::tuple_element_t< 1, TupleType > VolType
Type of the pure volumetric material model.
Definition: decomposehyperelastic.hh:25
std::tuple_element_t< 0, TupleType > DevType
Type of the pure deviatoric material model.
Definition: decomposehyperelastic.hh:24
Definition: utils/dirichletvalues.hh:37
Concept to check if the underlying scalar type is a dual type.
Definition: utils/concepts.hh:625
Implementation of the Hyperelastic material model.