29 std::vector<std::unique_ptr<MeshLib::Mesh>>
const& meshes,
30 std::vector<GeoLib::NamedRaster>
const& named_rasters,
32 std::unique_ptr<MathLib::PiecewiseLinearInterpolation>>
const&
42 auto const mesh_name =
49 if (type ==
"Constant")
51 INFO(
"ConstantParameter: {:s}", name);
54 if (type ==
"CurveScaled")
56 INFO(
"CurveScaledParameter: {:s}", name);
59 if (type ==
"Function")
61 INFO(
"FunctionParameter: {:s}", name);
66 INFO(
"GroupBasedParameter: {:s}", name);
69 if (type ==
"MeshElement")
71 INFO(
"MeshElementParameter: {:s}", name);
74 if (type ==
"MeshNode")
76 INFO(
"MeshNodeParameter: {:s}", name);
79 if (type ==
"RandomFieldMeshElement")
82 INFO(
"RandomFieldMeshElement: {:s}", name);
87 INFO(
"RasterParameter: {:s}", name);
90 if (type ==
"TimeDependentHeterogeneousParameter")
92 INFO(
"TimeDependentHeterogeneousParameter: {:s}", name);
96 OGS_FATAL(
"Cannot construct a parameter of given type '{:s}'.", type);
103 if (parameter.
mesh() ==
nullptr)
109 if (*parameter.
mesh() == mesh)
114 return "The parameter's domain of definition mesh '" +
115 parameter.
mesh()->
getName() +
"' differs from the used mesh '" +
117 "'. The same mesh (the same name) has to be referenced in the "
118 "project file. Possible reasons are:\n - the parameter used for the "
119 "initial condition is not defined on the bulk mesh,\n - the "
120 "parameter's domain of definition mesh differs from the boundary "
121 "condition or source term domain of definition mesh.";
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
T peekConfigParameter(std::string const ¶m) const
T getConfigParameter(std::string const ¶m) const
const std::string getName() const
Get name of the mesh.
Mesh & findMeshByName(std::vector< std::unique_ptr< Mesh > > const &meshes, std::string_view const name)
std::unique_ptr< ParameterBase > createRasterParameter(std::string const &name, BaseLib::ConfigTree const &config, std::vector< GeoLib::NamedRaster > const &named_rasters)
std::unique_ptr< ParameterBase > createTimeDependentHeterogeneousParameter(std::string const &name, BaseLib::ConfigTree const &config)
std::optional< std::string > isDefinedOnSameMesh(ParameterBase const ¶meter, MeshLib::Mesh const &mesh)
std::unique_ptr< ParameterBase > createParameter(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< MeshLib::Mesh > > const &meshes, std::vector< GeoLib::NamedRaster > const &named_rasters, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
std::unique_ptr< ParameterBase > createGroupBasedParameter(std::string const &name, BaseLib::ConfigTree const &config, MeshLib::Mesh const &mesh)
std::unique_ptr< ParameterBase > createMeshElementParameter(std::string const &name, BaseLib::ConfigTree const &config, MeshLib::Mesh const &mesh)
std::unique_ptr< ParameterBase > createCurveScaledParameter(std::string const &name, BaseLib::ConfigTree const &config, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
std::unique_ptr< ParameterBase > createConstantParameter(std::string const &name, BaseLib::ConfigTree const &config)
std::unique_ptr< ParameterBase > createRandomFieldMeshElementParameter(std::string const &name, BaseLib::ConfigTree const &config, MeshLib::Mesh &mesh)
std::unique_ptr< ParameterBase > createFunctionParameter(std::string const &name, BaseLib::ConfigTree const &config, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
std::unique_ptr< ParameterBase > createMeshNodeParameter(std::string const &name, BaseLib::ConfigTree const &config, MeshLib::Mesh const &mesh)
MeshLib::Mesh const * mesh() const