OGS
CreateTransportPorosityFromMassBalance.cpp
Go to the documentation of this file.
1
11
12#include "BaseLib/ConfigTree.h"
13#include "ParameterLib/Utils.h"
15
16namespace MaterialPropertyLib
17{
18std::unique_ptr<TransportPorosityFromMassBalance>
20 BaseLib::ConfigTree const& config,
21 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters)
22{
24 config.checkConfigParameter("type", "TransportPorosityFromMassBalance");
25
26 // Second access for storage.
28 auto property_name = config.peekConfigParameter<std::string>("name");
29
30 DBUG("Create TransportPorosityFromMassBalance medium property {:s}.",
31 property_name);
32
33 std::string const& parameter_name =
35 config.getConfigParameter<std::string>("initial_porosity");
36 auto const& initial_porosity = ParameterLib::findParameter<double>(
37 parameter_name, parameters, 0, nullptr);
38
40 auto const& phi_min = config.getConfigParameter<double>("minimal_porosity");
41
43 auto const& phi_max = config.getConfigParameter<double>("maximal_porosity");
44
45 return std::make_unique<TransportPorosityFromMassBalance>(
46 std::move(property_name), initial_porosity, phi_min, phi_max);
47}
48} // 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< TransportPorosityFromMassBalance > createTransportPorosityFromMassBalance(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters)