OGS
CreateEvolutionaryPIDcontroller.cpp
Go to the documentation of this file.
1
12
#include "
CreateEvolutionaryPIDcontroller.h
"
13
14
#include "
BaseLib/Algorithm.h
"
15
#include "
BaseLib/ConfigTree.h
"
16
#include "
EvolutionaryPIDcontroller.h
"
17
#include "
TimeStepAlgorithm.h
"
18
19
namespace
NumLib
20
{
21
class
TimeStepAlgorithm;
22
23
EvolutionaryPIDcontrollerParameters
parseEvolutionaryPIDcontroller
(
24
BaseLib::ConfigTree
const
& config)
25
{
27
config.
checkConfigParameter
(
"type"
,
"EvolutionaryPIDcontroller"
);
28
30
auto
const
t0 = config.
getConfigParameter
<
double
>(
"t_initial"
);
32
auto
const
t_end = config.
getConfigParameter
<
double
>(
"t_end"
);
33
35
auto
const
h0 = config.
getConfigParameter
<
double
>(
"dt_guess"
);
36
38
auto
const
h_min = config.
getConfigParameter
<
double
>(
"dt_min"
);
40
auto
const
h_max = config.
getConfigParameter
<
double
>(
"dt_max"
);
42
auto
const
rel_h_min = config.
getConfigParameter
<
double
>(
"rel_dt_min"
);
44
auto
const
rel_h_max = config.
getConfigParameter
<
double
>(
"rel_dt_max"
);
45
47
auto
const
tol = config.
getConfigParameter
<
double
>(
"tol"
);
48
49
return
{t0, t_end, h0, h_min, h_max, rel_h_min, rel_h_max, tol};
50
}
51
52
std::unique_ptr<TimeStepAlgorithm>
createEvolutionaryPIDcontroller
(
53
EvolutionaryPIDcontrollerParameters
const
& config,
54
std::vector<double>
const
& fixed_times_for_output)
55
{
56
if
(config.
t_end
< config.
t0
)
57
{
58
OGS_FATAL
(
59
"Evolutionary PID controller timestepping: end time ({}) is "
60
"smaller than initial time ({})"
,
61
config.
t_end
,
62
config.
t0
);
63
}
64
65
return
std::make_unique<EvolutionaryPIDcontroller>(config.
t0
,
66
config.
t_end
,
67
config.
h0
,
68
config.
h_min
,
69
config.
h_max
,
70
config.
rel_h_min
,
71
config.
rel_h_max
,
72
config.
tol
,
73
fixed_times_for_output);
74
}
75
}
// end of namespace NumLib
Algorithm.h
ConfigTree.h
CreateEvolutionaryPIDcontroller.h
OGS_FATAL
#define OGS_FATAL(...)
Definition
Error.h:26
EvolutionaryPIDcontroller.h
TimeStepAlgorithm.h
BaseLib::ConfigTree
Definition
ConfigTree.h:107
BaseLib::ConfigTree::getConfigParameter
T getConfigParameter(std::string const ¶m) const
Definition
ConfigTree-impl.h:41
BaseLib::ConfigTree::checkConfigParameter
void checkConfigParameter(std::string const ¶m, std::string_view const value) const
Definition
ConfigTree.cpp:151
NumLib
Definition
ProjectData.h:46
NumLib::createEvolutionaryPIDcontroller
std::unique_ptr< TimeStepAlgorithm > createEvolutionaryPIDcontroller(EvolutionaryPIDcontrollerParameters const &config, std::vector< double > const &fixed_times_for_output)
Definition
CreateEvolutionaryPIDcontroller.cpp:52
NumLib::parseEvolutionaryPIDcontroller
EvolutionaryPIDcontrollerParameters parseEvolutionaryPIDcontroller(BaseLib::ConfigTree const &config)
Definition
CreateEvolutionaryPIDcontroller.cpp:23
NumLib::EvolutionaryPIDcontrollerParameters
Definition
CreateEvolutionaryPIDcontroller.h:27
NumLib::EvolutionaryPIDcontrollerParameters::rel_h_min
double rel_h_min
Definition
CreateEvolutionaryPIDcontroller.h:33
NumLib::EvolutionaryPIDcontrollerParameters::h_min
double h_min
Definition
CreateEvolutionaryPIDcontroller.h:31
NumLib::EvolutionaryPIDcontrollerParameters::rel_h_max
double rel_h_max
Definition
CreateEvolutionaryPIDcontroller.h:34
NumLib::EvolutionaryPIDcontrollerParameters::tol
double tol
Definition
CreateEvolutionaryPIDcontroller.h:35
NumLib::EvolutionaryPIDcontrollerParameters::t_end
double t_end
Definition
CreateEvolutionaryPIDcontroller.h:29
NumLib::EvolutionaryPIDcontrollerParameters::t0
double t0
Definition
CreateEvolutionaryPIDcontroller.h:28
NumLib::EvolutionaryPIDcontrollerParameters::h_max
double h_max
Definition
CreateEvolutionaryPIDcontroller.h:32
NumLib::EvolutionaryPIDcontrollerParameters::h0
double h0
Definition
CreateEvolutionaryPIDcontroller.h:30
NumLib
TimeStepping
Algorithms
CreateEvolutionaryPIDcontroller.cpp
Generated by
1.11.0