OGS
TimeDiscretizationBuilder.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
7#include "BaseLib/Error.h"
9
10namespace NumLib
11{
12std::unique_ptr<TimeDiscretization> createTimeDiscretization(
13 BaseLib::ConfigTree const& config)
14{
16 auto const type = config.getConfigParameter<std::string>("type");
17
19 if (type == "BackwardEuler")
20 {
21 return std::make_unique<BackwardEuler>();
22 }
23 OGS_FATAL("Unrecognized time discretization type `{:s}'", type);
24}
25} // namespace NumLib
#define OGS_FATAL(...)
Definition Error.h:19
T getConfigParameter(std::string const &param) const
std::unique_ptr< TimeDiscretization > createTimeDiscretization(BaseLib::ConfigTree const &config)