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
4
#include "
TimeDiscretizationBuilder.h
"
5
6
#include "
BaseLib/ConfigTree.h
"
7
#include "
BaseLib/Error.h
"
8
#include "
TimeDiscretization.h
"
9
10
namespace
NumLib
11
{
12
std::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
ConfigTree.h
Error.h
OGS_FATAL
#define OGS_FATAL(...)
Definition
Error.h:19
TimeDiscretizationBuilder.h
TimeDiscretization.h
BaseLib::ConfigTree
Definition
ConfigTree.h:101
BaseLib::ConfigTree::getConfigParameter
T getConfigParameter(std::string const ¶m) const
Definition
ConfigTree-impl.h:35
NumLib
Definition
ProjectData.h:35
NumLib::createTimeDiscretization
std::unique_ptr< TimeDiscretization > createTimeDiscretization(BaseLib::ConfigTree const &config)
Definition
TimeDiscretizationBuilder.cpp:12
NumLib
ODESolver
TimeDiscretizationBuilder.cpp
Generated by
1.14.0