OGS
CreateNewtonRaphsonSolverParameters.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 "
CreateNewtonRaphsonSolverParameters.h
"
5
6
#include "
BaseLib/ConfigTree.h
"
7
#include "
NewtonRaphson.h
"
8
9
namespace
NumLib
10
{
11
NewtonRaphsonSolverParameters
createNewtonRaphsonSolverParameters
(
12
BaseLib::ConfigTree
const
& config)
13
{
14
DBUG
(
"Create local nonlinear solver parameters."
);
15
auto
const
maximum_iterations =
17
config.
getConfigParameter
<
int
>(
"maximum_iterations"
);
18
19
DBUG
(
"\tmaximum_iterations: {:d}."
, maximum_iterations);
20
21
auto
const
error_tolerance =
23
config.
getConfigParameterOptional
<
double
>(
"error_tolerance"
);
24
if
(error_tolerance)
25
{
26
WARN
(
27
"The 'error_tolerance' tag for the Newton-Raphson solver is "
28
"deprecated.\n"
29
"Use new tags 'residuum_tolerance' and 'increment_tolerance'.\n"
30
"For now we use residuum_tolerance {} and increment_tolerance 0."
,
31
*error_tolerance);
32
return
{maximum_iterations, *error_tolerance, 0};
33
}
34
35
auto
const
residuum_tolerance =
37
config.
getConfigParameter
<
double
>(
"residuum_tolerance"
);
38
39
DBUG
(
"\tresiduum_tolerance: {:g}."
, residuum_tolerance);
40
41
auto
const
increment_tolerance =
43
config.
getConfigParameter
<
double
>(
"increment_tolerance"
);
44
45
DBUG
(
"\tincrement_tolerance: {:g}."
, increment_tolerance);
46
47
return
{maximum_iterations, residuum_tolerance, increment_tolerance};
48
}
49
}
// namespace NumLib
ConfigTree.h
CreateNewtonRaphsonSolverParameters.h
DBUG
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition
Logging.h:22
WARN
void WARN(fmt::format_string< Args... > fmt, Args &&... args)
Definition
Logging.h:34
NewtonRaphson.h
BaseLib::ConfigTree
Definition
ConfigTree.h:101
BaseLib::ConfigTree::getConfigParameterOptional
std::optional< T > getConfigParameterOptional(std::string const ¶m) const
Definition
ConfigTree-impl.h:58
BaseLib::ConfigTree::getConfigParameter
T getConfigParameter(std::string const ¶m) const
Definition
ConfigTree-impl.h:35
NumLib
Definition
ProjectData.h:35
NumLib::createNewtonRaphsonSolverParameters
NewtonRaphsonSolverParameters createNewtonRaphsonSolverParameters(BaseLib::ConfigTree const &config)
Definition
CreateNewtonRaphsonSolverParameters.cpp:11
NumLib::NewtonRaphsonSolverParameters
Definition
NewtonRaphson.h:14
NumLib
CreateNewtonRaphsonSolverParameters.cpp
Generated by
1.14.0