28 std::vector<std::unique_ptr<MeshLib::Mesh>>
const& meshes,
30 std::unique_ptr<MathLib::PiecewiseLinearInterpolation>>
const&
40 auto const mesh_name =
45 begin(meshes), end(meshes),
46 [&mesh_name](
auto const& m) {
return m->getName() == mesh_name; },
47 "Expected to find a mesh named " + mesh_name +
".");
50 if (type ==
"Constant")
52 INFO(
"ConstantParameter: {:s}",
name);
55 if (type ==
"CurveScaled")
57 INFO(
"CurveScaledParameter: {:s}",
name);
60 if (type ==
"Function")
62 INFO(
"FunctionParameter: {:s}",
name);
67 INFO(
"GroupBasedParameter: {:s}",
name);
70 if (type ==
"MeshElement")
72 INFO(
"MeshElementParameter: {:s}",
name);
75 if (type ==
"MeshNode")
77 INFO(
"MeshNodeParameter: {:s}",
name);
80 if (type ==
"RandomFieldMeshElement")
83 begin(meshes), end(meshes),
84 [&mesh_name](
auto const& m) {
return m->getName() == mesh_name; },
85 "Expected to find a mesh named " + mesh_name +
".");
86 INFO(
"RandomFieldMeshElement: {:s}",
name);
89 if (type ==
"TimeDependentHeterogeneousParameter")
91 INFO(
"TimeDependentHeterogeneousParameter: {:s}",
name);
95 OGS_FATAL(
"Cannot construct a parameter of given type '{:s}'.", type);
102 if (parameter.
mesh() ==
nullptr)
108 if (*parameter.
mesh() == mesh)
113 return "The parameter's domain of definition mesh '" +
114 parameter.
mesh()->
getName() +
"' differs from the used mesh '" +
116 "'. The same mesh (the same name) has to be referenced in the "
117 "project file. Possible reasons are:\n - the parameter used for the "
118 "initial condition is not defined on the bulk mesh,\n - the "
119 "parameter's domain of definition mesh differs from the boundary "
120 "condition or source term domain of definition mesh.";
void INFO(char const *fmt, Args const &... 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.
std::iterator_traits< InputIt >::reference findElementOrError(InputIt begin, InputIt end, Predicate predicate, std::string const &error="")
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 > createTimeDependentHeterogeneousParameter(std::string const &name, BaseLib::ConfigTree const &config)
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::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::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 > 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 > createMeshNodeParameter(std::string const &name, BaseLib::ConfigTree const &config, MeshLib::Mesh const &mesh)
MeshLib::Mesh const * mesh() const