OGS
CreateSoilThermalConductivitySomerton.cpp
Go to the documentation of this file.
1 
13 
14 #include <string>
15 
16 #include "BaseLib/ConfigTree.h"
19 #include "ParameterLib/Parameter.h"
20 #include "ParameterLib/Utils.h"
22 
23 namespace MaterialPropertyLib
24 {
25 std::unique_ptr<Property> createSoilThermalConductivitySomerton(
26  int const geometry_dimension,
27  BaseLib::ConfigTree const& config,
28  std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
29  ParameterLib::CoordinateSystem const* const local_coordinate_system)
30 {
32  config.checkConfigParameter("type", "SoilThermalConductivitySomerton");
33 
35  auto property_name = config.peekConfigParameter<std::string>("name");
36 
37  DBUG("Create SoilThermalConductivitySomerton medium property");
38 
39  std::string const& dry_thermal_conductivity_parameter_name =
41  config.getConfigParameter<std::string>("dry_thermal_conductivity");
42  auto const& dry_thermal_conductivity = ParameterLib::findParameter<double>(
43  dry_thermal_conductivity_parameter_name, parameters, 0, nullptr);
44 
45  std::string const& wet_thermal_conductivity_parameter_name =
47  config.getConfigParameter<std::string>("wet_thermal_conductivity");
48  auto const& wet_thermal_conductivity = ParameterLib::findParameter<double>(
49  wet_thermal_conductivity_parameter_name, parameters, 0, nullptr);
50 
51  if (geometry_dimension == 1)
52  {
53  return std::make_unique<SoilThermalConductivitySomerton<1>>(
54  std::move(property_name),
55  dry_thermal_conductivity,
56  wet_thermal_conductivity,
57  local_coordinate_system);
58  }
59 
60  if (geometry_dimension == 2)
61  {
62  return std::make_unique<SoilThermalConductivitySomerton<2>>(
63  std::move(property_name),
64  dry_thermal_conductivity,
65  wet_thermal_conductivity,
66  local_coordinate_system);
67  }
68 
69  return std::make_unique<SoilThermalConductivitySomerton<3>>(
70  std::move(property_name),
71  dry_thermal_conductivity,
72  wet_thermal_conductivity,
73  local_coordinate_system);
74 }
75 } // namespace MaterialPropertyLib
void DBUG(char const *fmt, Args const &... args)
Definition: Logging.h:27
T peekConfigParameter(std::string const &param) const
void checkConfigParameter(std::string const &param, T const &value) const
T getConfigParameter(std::string const &param) const
std::unique_ptr< Property > createSoilThermalConductivitySomerton(int const geometry_dimension, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system)