OGS
CreateNewtonRaphsonSolverParameters.cpp
Go to the documentation of this file.
1
10
#include "
CreateNewtonRaphsonSolverParameters.h
"
11
12
#include "
BaseLib/ConfigTree.h
"
13
#include "
NewtonRaphson.h
"
14
15
namespace
NumLib
16
{
17
NewtonRaphsonSolverParameters
createNewtonRaphsonSolverParameters
(
18
BaseLib::ConfigTree
const
& config)
19
{
20
DBUG
(
"Create local nonlinear solver parameters."
);
21
auto
const
maximum_iterations =
23
config.
getConfigParameter
<
int
>(
"maximum_iterations"
);
24
25
DBUG
(
"\tmaximum_iterations: {:d}."
, maximum_iterations);
26
27
auto
const
error_tolerance =
29
config.
getConfigParameterOptional
<
double
>(
"error_tolerance"
);
30
if
(error_tolerance)
31
{
32
WARN
(
33
"The 'error_tolerance' tag for the Newton-Raphson solver is "
34
"deprecated.\n"
35
"Use new tags 'residuum_tolerance' and 'increment_tolerance'.\n"
36
"For now we use residuum_tolerance {} and increment_tolerance 0."
,
37
*error_tolerance);
38
return
{maximum_iterations, *error_tolerance, 0};
39
}
40
41
auto
const
residuum_tolerance =
43
config.
getConfigParameter
<
double
>(
"residuum_tolerance"
);
44
45
DBUG
(
"\tresiduum_tolerance: {:g}."
, residuum_tolerance);
46
47
auto
const
increment_tolerance =
49
config.
getConfigParameter
<
double
>(
"increment_tolerance"
);
50
51
DBUG
(
"\tincrement_tolerance: {:g}."
, increment_tolerance);
52
53
return
{maximum_iterations, residuum_tolerance, increment_tolerance};
54
}
55
}
// namespace NumLib
ConfigTree.h
CreateNewtonRaphsonSolverParameters.h
DBUG
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition
Logging.h:30
WARN
void WARN(fmt::format_string< Args... > fmt, Args &&... args)
Definition
Logging.h:40
NewtonRaphson.h
BaseLib::ConfigTree
Definition
ConfigTree.h:107
BaseLib::ConfigTree::getConfigParameterOptional
std::optional< T > getConfigParameterOptional(std::string const ¶m) const
Definition
ConfigTree-impl.h:64
BaseLib::ConfigTree::getConfigParameter
T getConfigParameter(std::string const ¶m) const
Definition
ConfigTree-impl.h:41
NumLib
Definition
ProjectData.h:46
NumLib::createNewtonRaphsonSolverParameters
NewtonRaphsonSolverParameters createNewtonRaphsonSolverParameters(BaseLib::ConfigTree const &config)
Definition
CreateNewtonRaphsonSolverParameters.cpp:17
NumLib::NewtonRaphsonSolverParameters
Definition
NewtonRaphson.h:21
NumLib
CreateNewtonRaphsonSolverParameters.cpp
Generated by
1.12.0