OGS
CreateTransportPorosityFromMassBalance.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
5
9
10namespace MaterialPropertyLib
11{
12std::unique_ptr<TransportPorosityFromMassBalance>
14 BaseLib::ConfigTree const& config,
15 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters)
16{
18 config.checkConfigParameter("type", "TransportPorosityFromMassBalance");
19
20 // Second access for storage.
22 auto property_name = config.peekConfigParameter<std::string>("name");
23
24 DBUG("Create TransportPorosityFromMassBalance medium property {:s}.",
25 property_name);
26
27 std::string const& parameter_name =
29 config.getConfigParameter<std::string>("initial_porosity");
30 auto const& initial_porosity = ParameterLib::findParameter<double>(
31 parameter_name, parameters, 0, nullptr);
32
34 auto const& phi_min = config.getConfigParameter<double>("minimal_porosity");
35
37 auto const& phi_max = config.getConfigParameter<double>("maximal_porosity");
38
39 return std::make_unique<TransportPorosityFromMassBalance>(
40 std::move(property_name), initial_porosity, phi_min, phi_max);
41}
42} // namespace MaterialPropertyLib
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:22
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)
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)