40 std::vector<GlobalVector*>
const& x,
41 std::vector<GlobalVector*>
const& x_prev,
int const process_id) = 0;
54 std::vector<GlobalVector*>& x,
55 std::vector<GlobalVector*>
const& x_prev,
56 std::function<
void(
int, std::vector<GlobalVector*>
const&)>
const&
57 postIterationCallback,
58 int const process_id) = 0;
70template <NonlinearSolverTag NLTag>
93 double const damping = 1.0)
94 : _linear_solver(linear_solver), _maxiter(maxiter), _damping(damping)
104 _equation_system = &eq;
105 _convergence_criterion = &conv_crit;
108 void calculateNonEquilibriumInitialResiduum(
109 std::vector<GlobalVector*>
const& x,
110 std::vector<GlobalVector*>
const& x_prev,
111 int const process_id)
override;
114 std::vector<GlobalVector*>& x,
115 std::vector<GlobalVector*>
const& x_prev,
116 std::function<
void(
int, std::vector<GlobalVector*>
const&)>
const&
117 postIterationCallback,
118 int const process_id)
override;
122 _compensate_non_equilibrium_initial_residuum = value;
140 std::size_t _res_id = 0u;
141 std::size_t _J_id = 0u;
142 std::size_t _minus_delta_x_id = 0u;
143 std::size_t _x_new_id =
145 std::size_t _r_neq_id = 0u;
153 bool _compensate_non_equilibrium_initial_residuum =
false;
176 : _linear_solver(linear_solver), _maxiter(maxiter)
186 _equation_system = &eq;
187 _convergence_criterion = &conv_crit;
190 void calculateNonEquilibriumInitialResiduum(
191 std::vector<GlobalVector*>
const& x,
192 std::vector<GlobalVector*>
const& x_prev,
193 int const process_id)
override;
196 std::vector<GlobalVector*>& x,
197 std::vector<GlobalVector*>
const& x_prev,
198 std::function<
void(
int, std::vector<GlobalVector*>
const&)>
const&
199 postIterationCallback,
200 int const process_id)
override;
204 _compensate_non_equilibrium_initial_residuum = value;
216 std::size_t _A_id = 0u;
217 std::size_t _rhs_id = 0u;
218 std::size_t _x_new_id = 0u;
220 std::size_t _r_neq_id = 0u;
225 bool _compensate_non_equilibrium_initial_residuum =
false;
Global vector based on Eigen vector.
virtual ~NonlinearSolverBase()=default
virtual void calculateNonEquilibriumInitialResiduum(std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id)=0
virtual NonlinearSolverStatus solve(std::vector< GlobalVector * > &x, std::vector< GlobalVector * > const &x_prev, std::function< void(int, std::vector< GlobalVector * > const &)> const &postIterationCallback, int const process_id)=0
GlobalLinearSolver & _linear_solver
NonlinearSolver(GlobalLinearSolver &linear_solver, int const maxiter, double const damping=1.0)
void compensateNonEquilibriumInitialResiduum(bool const value)
void setEquationSystem(System &eq, ConvergenceCriterion &conv_crit)
int const _maxiter
maximum number of iterations
const int _maxiter
maximum number of iterations
void compensateNonEquilibriumInitialResiduum(bool const value)
GlobalLinearSolver & _linear_solver
NonlinearSolver(GlobalLinearSolver &linear_solver, const int maxiter)
void setEquationSystem(System &eq, ConvergenceCriterion &conv_crit)
NonlinearSolverTag
Tag used to specify which nonlinear solver will be used.
std::pair< std::unique_ptr< NonlinearSolverBase >, NonlinearSolverTag > createNonlinearSolver(GlobalLinearSolver &linear_solver, BaseLib::ConfigTree const &config)
Status of the non-linear solver.