OGS
CreateDupuitPermeability.cpp
Go to the documentation of this file.
1
12
13#include "BaseLib/ConfigTree.h"
14#include "DupuitPermeability.h"
15#include "ParameterLib/Utils.h"
16
17namespace MaterialPropertyLib
18{
19std::unique_ptr<DupuitPermeability> createDupuitPermeability(
20 BaseLib::ConfigTree const& config,
21 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters)
22{
24 config.checkConfigParameter("type", "Dupuit");
25
26 // Second access for storage.
28 auto property_name = config.peekConfigParameter<std::string>("name");
29
30 DBUG("Create DupuitPermeability property {:s}.", property_name);
31
32 std::string const& parameter_name =
34 config.getConfigParameter<std::string>("parameter_name");
35 auto const& parameter = ParameterLib::findParameter<double>(
36 parameter_name, parameters, 0, nullptr);
37 return std::make_unique<MaterialPropertyLib::DupuitPermeability>(
38 std::move(property_name), parameter);
39}
40} // namespace MaterialPropertyLib
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
T peekConfigParameter(std::string const &param) const
T getConfigParameter(std::string const &param) const
void checkConfigParameter(std::string const &param, std::string_view const value) const
std::unique_ptr< DupuitPermeability > createDupuitPermeability(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters)
OGS_NO_DANGLING Parameter< ParameterDataType > & findParameter(std::string const &parameter_name, std::vector< std::unique_ptr< ParameterBase > > const &parameters, int const num_components, MeshLib::Mesh const *const mesh=nullptr)
Definition Utils.h:102