Serac  0.1
Serac is an implicit thermal strucural mechanics simulation code.
thermomechanics_input.cpp
1 // Copyright (c) 2019-2024, Lawrence Livermore National Security, LLC and
2 // other Serac Project Developers. See the top-level LICENSE file for
3 // details.
4 //
5 // SPDX-License-Identifier: (BSD-3-Clause)
6 
8 
9 namespace serac {
10 
11 void ThermomechanicsInputOptions::defineInputFileSchema(axom::inlet::Container& container)
12 {
13  // The solid mechanics options
14  auto& solid_solver_table = container.addStruct("solid", "Finite deformation solid mechanics module").required();
16 
17  // The heat transfer options
18  auto& thermal_solver_table = container.addStruct("heat_transfer", "Heat transfer module").required();
20 
21  auto& ref_temp = container.addStruct("reference_temperature",
22  "Coefficient for the reference temperature for isotropic thermal expansion");
24 
25  auto& coef_therm_expansion =
26  container.addStruct("coef_thermal_expansion", "Coefficient of thermal expansion for isotropic thermal expansion");
28 
29  container.registerVerifier([](const axom::inlet::Container& base) -> bool {
30  bool cte_found = base.contains("coef_thermal_expansion");
31  bool ref_temp_found = base.contains("reference_temperature");
32 
33  if (ref_temp_found && cte_found) {
34  return true;
35  } else if ((!ref_temp_found) && (!cte_found)) {
36  return true;
37  }
38 
39  SLIC_WARNING_ROOT(
40  "Either both a coefficient of thermal expansion and reference temperature should be specified"
41  "in the thermal solid input file or neither should be.");
42 
43  return false;
44  });
45 }
46 
47 } // namespace serac
48 
50  const axom::inlet::Container& base)
51 {
53 
54  result.solid_options = base["solid"].get<serac::SolidMechanicsInputOptions>();
55 
56  result.thermal_options = base["heat_transfer"].get<serac::HeatTransferInputOptions>();
57 
58  if (base.contains("coef_thermal_expansion")) {
59  result.coef_thermal_expansion = base["coef_thermal_expansion"].get<serac::input::CoefficientInputOptions>();
60  result.reference_temperature = base["reference_temperature"].get<serac::input::CoefficientInputOptions>();
61  }
62 
63  return result;
64 }
Accelerator functionality.
Definition: serac.cpp:38
serac::ThermomechanicsInputOptions operator()(const axom::inlet::Container &base)
Returns created object from Inlet container.
Stores all information held in the input file that is used to configure the solver.
static void defineInputFileSchema(axom::inlet::Container &container)
Input file parameters specific to this class.
Stores all information held in the input file that is used to configure the solver.
static void defineInputFileSchema(axom::inlet::Container &container)
Input file parameters specific to this class.
Stores all information held in the input file that is used to configure the thermal structural solver...
std::optional< input::CoefficientInputOptions > coef_thermal_expansion
The isotropic coefficient of thermal expansion.
HeatTransferInputOptions thermal_options
Heat transfer input options.
static void defineInputFileSchema(axom::inlet::Container &container)
Input file parameters specific to this class.
SolidMechanicsInputOptions solid_options
Solid mechanics input options.
std::optional< input::CoefficientInputOptions > reference_temperature
The reference temperature for thermal expansion.
The information required from the input file for an mfem::(Vector)(Function)Coefficient.
Definition: input.hpp:88
static void defineInputFileSchema(axom::inlet::Container &container)
Defines the input file schema on the provided inlet container.
Definition: input.cpp:190
An object containing all input file options for the solver for thermal structural solver.