version 0.4.7
decomposehyperelastic.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
9#pragma once
10
13
14namespace Ikarus {
15namespace Materials {
16
20 template <typename MAT>
22 {
23 using TupleType = decltype(decomposeHyperelasticAndGetMaterialParameters(std::declval<MAT>()));
24 using DevType = std::tuple_element_t<0, TupleType>;
25 using VolType = std::tuple_element_t<1, TupleType>;
26 using DevParams = std::tuple_element_t<2, TupleType>;
27 using VolParams = std::tuple_element_t<3, TupleType>;
28 };
29
45 template <Concepts::Material MAT>
46 requires(MAT::isHyperelastic)
48 static_assert(
50 "decomposeHyperelastic is only implemented for the case where both deviatoric and volumetric part exists.");
51 const auto& umat = Materials::underlyingMaterial(mat);
52 const auto dev = umat.deviatoricFunction();
53 const auto vol = umat.volumetricFunction().volumetricFunction();
54 const auto [devParams, volParams] = umat.materialParametersImpl();
55 const auto hdev = Materials::Hyperelastic(dev);
56 const auto hvol = Materials::makePureVolumetric(vol, 1.0); // material parameter set to unity.
57 if constexpr (not MAT::isReduced) {
58 return std::make_tuple(hdev, hvol, devParams, volParams);
59 } else {
60 constexpr auto fixedPairs = MAT::fixedPairs;
61 if constexpr (MAT::isStrainVanished) {
62 const auto reducedDev = Materials::VanishingStrain<fixedPairs, std::remove_cvref_t<decltype(hdev)>>(hdev);
63 const auto reducedVol = Materials::VanishingStrain<fixedPairs, std::remove_cvref_t<decltype(hvol)>>(hvol);
64 return std::make_tuple(reducedDev, reducedVol, devParams, volParams);
65 } else {
66 const auto reducedDev = Materials::VanishingStress<fixedPairs, std::remove_cvref_t<decltype(hdev)>>(hdev);
67 const auto reducedVol = Materials::VanishingStress<fixedPairs, std::remove_cvref_t<decltype(hvol)>>(hvol);
68 return std::make_tuple(reducedDev, reducedVol, devParams, volParams);
69 }
70 }
71 }
72} // namespace Materials
73} // namespace Ikarus
Definition: assemblermanipulatorbuildingblocks.hh:22
auto decomposeHyperelasticAndGetMaterialParameters(const MAT &mat)
A helper function to decompose a hyperelastic material model and get the underlying deviatoric materi...
Definition: decomposehyperelastic.hh:47
auto underlyingMaterial(const MAT &mat)
Helper function to access the underlying material model.
Definition: finiteelements/mechanics/materials/interface.hh:88
auto makePureVolumetric(const Concepts::VolumetricFunction auto &vf, double K)
A helper function to create a hyperelastic material model with pure volumetric functionality,...
Definition: factory.hh:185
typename UnderlyingMaterial< MAT >::type UnderlyingMaterial_t
Type alias for the underlying material model.
Definition: finiteelements/mechanics/materials/interface.hh:84
A helper struct to access the return types of the function decomposeHyperelasticAndGetMaterialParamet...
Definition: decomposehyperelastic.hh:22
decltype(decomposeHyperelasticAndGetMaterialParameters(std::declval< MAT >())) TupleType
Definition: decomposehyperelastic.hh:23
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
std::tuple_element_t< 2, TupleType > DevParams
Type of the parameters of the deviatoric material model.
Definition: decomposehyperelastic.hh:26
std::tuple_element_t< 3, TupleType > VolParams
Type of the parameters of the volumetric material model.
Definition: decomposehyperelastic.hh:27
Implementation of a general Hyperelastic Material material model.
Definition: finiteelements/mechanics/materials/hyperelastic/interface.hh:35
VanishingStrain material model that enforces strain components to be zero.
Definition: vanishingstrain.hh:29
VanishingStress material model that enforces stress components to be zero.
Definition: vanishingstress.hh:31
Header file for material models in Ikarus finite element mechanics.
Several concepts.