PRISMS-PF Manual v3.0-pre
Loading...
Searching...
No Matches
SolverParameters.h
1#ifndef INCLUDE_NONLINEARSOLVERPARAMETERS_H_
2#define INCLUDE_NONLINEARSOLVERPARAMETERS_H_
3
4#include <vector>
5
6enum SolverToleranceType
7{
8 ABSOLUTE_RESIDUAL,
9 RELATIVE_RESIDUAL_CHANGE,
10 ABSOLUTE_SOLUTION_CHANGE
11};
12
21{
22public:
26 SolverToleranceType
27 getToleranceType(unsigned int index);
28
32 double
33 getToleranceValue(unsigned int index);
34
35protected:
36 std::vector<unsigned int> var_index_list;
37
38 std::vector<SolverToleranceType> tolerance_type_list;
39 std::vector<double> tolerance_value_list;
40
45 unsigned int
46 getEquationIndex(unsigned int global_index);
47};
48
55{
56public:
61 void
62 loadParameters(unsigned int _var_index,
63 SolverToleranceType _tolerance_type,
64 double _tolerance_value,
65 unsigned int _max_iterations);
66
71 unsigned int
72 getMaxIterations(unsigned int index);
73
74protected:
75 std::vector<unsigned int> max_iterations_list;
76};
77
84{
85public:
90 void
91 setMaxIterations(unsigned int _max_iterations);
92
97 [[nodiscard]] double
98 getMaxIterations() const;
99
104 void
105 loadParameters(unsigned int _var_index,
106 SolverToleranceType _tolerance_type,
107 double _tolerance_value,
108 bool _backtrack_damping_flag,
109 double _backtrack_step_modifier,
110 double _backtrack_residual_decrease_coeff,
111 double _default_dampling_coefficient,
112 bool _laplace_for_initial_guess);
113
118 bool
119 getBacktrackDampingFlag(unsigned int index);
120
125 double
126 getBacktrackStepModifier(unsigned int index);
127
132 double
133 getBacktrackResidualDecreaseCoeff(unsigned int index);
134
139 double
140 getDefaultDampingCoefficient(unsigned int index);
141
146 bool
147 getLaplaceInitializationFlag(unsigned int index);
148
149private:
150 unsigned int max_iterations;
151
152 std::vector<bool> backtrack_damping_flag_list;
153 std::vector<double> backtrack_step_modifier_list;
154 std::vector<double> backtrack_residual_decrease_coeff_list;
155 std::vector<double> default_damping_coefficient_list;
156 std::vector<bool> laplace_for_initial_guess_list;
157};
158
159#endif
Definition SolverParameters.h:55
void loadParameters(unsigned int _var_index, SolverToleranceType _tolerance_type, double _tolerance_value, unsigned int _max_iterations)
Definition SolverParameters.cc:32
unsigned int getMaxIterations(unsigned int index)
Definition SolverParameters.cc:44
Definition SolverParameters.h:84
void loadParameters(unsigned int _var_index, SolverToleranceType _tolerance_type, double _tolerance_value, bool _backtrack_damping_flag, double _backtrack_step_modifier, double _backtrack_residual_decrease_coeff, double _default_dampling_coefficient, bool _laplace_for_initial_guess)
Definition SolverParameters.cc:50
double getDefaultDampingCoefficient(unsigned int index)
Definition SolverParameters.cc:88
double getBacktrackResidualDecreaseCoeff(unsigned int index)
Definition SolverParameters.cc:82
void setMaxIterations(unsigned int _max_iterations)
Definition SolverParameters.cc:100
double getMaxIterations() const
Definition SolverParameters.cc:106
bool getLaplaceInitializationFlag(unsigned int index)
Definition SolverParameters.cc:94
double getBacktrackStepModifier(unsigned int index)
Definition SolverParameters.cc:76
bool getBacktrackDampingFlag(unsigned int index)
Definition SolverParameters.cc:70
Definition SolverParameters.h:21
double getToleranceValue(unsigned int index)
Definition SolverParameters.cc:11
SolverToleranceType getToleranceType(unsigned int index)
Definition SolverParameters.cc:5
unsigned int getEquationIndex(unsigned int global_index)
Definition SolverParameters.cc:17