19 container.addString(
"model",
"The model of material (e.g. NeoHookean)").required(
true);
20 container.addDouble(
"density",
"Initial mass density");
23 container.addDouble(
"mu",
"The shear modulus");
24 container.addDouble(
"K",
"The bulk modulus");
27 container.addDouble(
"E",
"Young's modulus");
28 container.addDouble(
"nu",
"Poisson's ratio");
29 container.addDouble(
"Hk",
"Kinematic hardening constant");
30 auto& hardening_container = container.addStruct(
"hardening",
"Hardening law");
34 container.registerVerifier([](
const axom::inlet::Container& c) ->
bool {
35 axom::inlet::InletType double_type = axom::inlet::InletType::Double;
36 axom::inlet::InletType obj_type = axom::inlet::InletType::Object;
37 bool density_present = c.contains(
"density") && (c[
"density"].
type() == double_type);
38 bool mu_present = c.contains(
"mu") && (c[
"mu"].
type() == double_type);
39 bool K_present = c.contains(
"K") && (c[
"K"].
type() == double_type);
40 bool E_present = c.contains(
"E") && (c[
"E"].
type() == double_type);
41 bool nu_present = c.contains(
"nu") && (c[
"nu"].
type() == double_type);
42 bool Hk_present = c.contains(
"Hk") && (c[
"Hk"].
type() == double_type);
43 bool hardening_present = c.contains(
"hardening") && (c[
"hardening"].
type() == obj_type);
45 std::string model = c[
"model"];
46 if (model ==
"NeoHookean" || model ==
"LinearIsotropic") {
47 return density_present && mu_present && K_present && !E_present && !nu_present && !hardening_present;
48 }
else if (model ==
"J2SmallStrain") {
49 return density_present && !mu_present && !K_present && E_present && nu_present && Hk_present && hardening_present;
61 std::string model = base[
"model"];
63 if (model ==
"NeoHookean") {
65 }
else if (model ==
"LinearIsotropic") {
67 }
else if (model ==
"J2SmallStrain") {
70 if (std::holds_alternative<smith::solid_mechanics::LinearHardening>(hardening)) {
74 .hardening = std::get<smith::solid_mechanics::LinearHardening>(hardening),
76 .density = base[
"density"]};
77 }
else if (std::holds_alternative<smith::solid_mechanics::PowerLawHardening>(hardening)) {
81 .hardening = std::get<smith::solid_mechanics::PowerLawHardening>(hardening),
83 .density = base[
"density"]};
84 }
else if (std::holds_alternative<smith::solid_mechanics::VoceHardening>(hardening)) {
88 .hardening = std::get<smith::solid_mechanics::VoceHardening>(hardening),
90 .density = base[
"density"]};
Accelerator functionality.
std::variant< solid_mechanics::NeoHookean, solid_mechanics::LinearIsotropic, solid_mechanics::J2SmallStrain< solid_mechanics::LinearHardening >, solid_mechanics::J2SmallStrain< solid_mechanics::PowerLawHardening >, solid_mechanics::J2SmallStrain< solid_mechanics::VoceHardening > > var_solid_material_t
All possible solid mechanics materials that can be utilized in our input file.
std::variant< solid_mechanics::LinearHardening, solid_mechanics::PowerLawHardening, solid_mechanics::VoceHardening > var_hardening_t
Holds all possible isotropic hardening laws that can be utilized in our input file.
constexpr SMITH_HOST_DEVICE auto type(const tuple< T... > &values)
a function intended to be used for extracting the ith type from a tuple.
The material and load types for the solid functional physics module.
smith::var_solid_material_t operator()(const axom::inlet::Container &base)
Returns created object from Inlet container.
J2 material with nonlinear isotropic hardening and linear kinematic hardening.
Linear isotropic elasticity material model.
double density
mass density
Neo-Hookean material model.
double density
mass density