14 container.addString(
"model",
"The model of material (e.g. NeoHookean)").required(
true);
15 container.addDouble(
"density",
"Initial mass density");
18 container.addDouble(
"mu",
"The shear modulus");
19 container.addDouble(
"K",
"The bulk modulus");
22 container.addDouble(
"E",
"Young's modulus");
23 container.addDouble(
"nu",
"Poisson's ratio");
24 container.addDouble(
"Hi",
"Isotropic hardening constant");
25 container.addDouble(
"Hk",
"Kinematic hardening constant");
26 container.addDouble(
"sigma_y",
"Yield stress");
27 auto& hardening_container = container.addStruct(
"hardening",
"Hardening law");
31 container.registerVerifier([](
const axom::inlet::Container& c) ->
bool {
32 axom::inlet::InletType double_type = axom::inlet::InletType::Double;
33 axom::inlet::InletType obj_type = axom::inlet::InletType::Object;
34 bool density_present = c.contains(
"density") && (c[
"density"].
type() == double_type);
35 bool mu_present = c.contains(
"mu") && (c[
"mu"].
type() == double_type);
36 bool K_present = c.contains(
"K") && (c[
"K"].
type() == double_type);
37 bool E_present = c.contains(
"E") && (c[
"E"].
type() == double_type);
38 bool nu_present = c.contains(
"nu") && (c[
"nu"].
type() == double_type);
39 bool Hi_present = c.contains(
"Hi") && (c[
"Hi"].
type() == double_type);
40 bool sigma_y_present = c.contains(
"sigma_y") && (c[
"sigma_y"].
type() == double_type);
41 bool hardening_present = c.contains(
"hardening") && (c[
"hardening"].
type() == obj_type);
43 std::string model = c[
"model"];
44 if (model ==
"NeoHookean" || model ==
"LinearIsotropic") {
45 return density_present && mu_present && K_present && !E_present && !nu_present && !Hi_present &&
46 !sigma_y_present && !hardening_present;
47 }
else if (model ==
"J2") {
48 return density_present && !mu_present && !K_present && E_present && nu_present && Hi_present && sigma_y_present &&
50 }
else if (model ==
"J2Nonlinear") {
51 return density_present && !mu_present && !K_present && E_present && nu_present && !Hi_present &&
52 !sigma_y_present && hardening_present;
64 std::string model = base[
"model"];
66 if (model ==
"NeoHookean") {
68 }
else if (model ==
"LinearIsotropic") {
70 }
else if (model ==
"J2") {
75 .sigma_y = base[
"sigma_y"],
76 .density = base[
"density"]};
77 }
else if (model ==
"J2Nonlinear") {
80 if (std::holds_alternative<serac::solid_mechanics::PowerLawHardening>(hardening)) {
84 .hardening = std::get<serac::solid_mechanics::PowerLawHardening>(hardening),
85 .density = base[
"density"]};
86 }
else if (std::holds_alternative<serac::solid_mechanics::VoceHardening>(hardening)) {
90 .hardening = std::get<serac::solid_mechanics::VoceHardening>(hardening),
91 .density = base[
"density"]};
Accelerator functionality.
std::variant< solid_mechanics::NeoHookean, solid_mechanics::LinearIsotropic, solid_mechanics::J2, solid_mechanics::J2Nonlinear< solid_mechanics::PowerLawHardening >, solid_mechanics::J2Nonlinear< solid_mechanics::VoceHardening > > var_solid_material_t
All possible solid mechanics materials that can be utilized in our input file.
constexpr SERAC_HOST_DEVICE auto type(const tuple< T... > &values)
a function intended to be used for extracting the ith type from a tuple.
std::variant< solid_mechanics::PowerLawHardening, solid_mechanics::VoceHardening > var_hardening_t
Holds all possible isotropic hardening laws that can be utilized in our input file.
serac::var_solid_material_t operator()(const axom::inlet::Container &base)
Returns created object from Inlet container.
J2 material with nonlinear isotropic hardening.
a 3D constitutive model for a J2 material with linear isotropic and kinematic hardening.
Linear isotropic elasticity material model.
double density
mass density
Neo-Hookean material model.
double density
mass density