586 int n_last_inner_iter);
662 const char *algo_name,
cs_real_t() cs_cdo_blas_square_norm_t(const cs_real_t *array)
Generic function pointer for computing a square norm. Parallel synchronization is performed inside th...
Definition: cs_cdo_blas.h:73
cs_real_t() cs_cdo_blas_dotprod_t(const cs_real_t *a, const cs_real_t *b)
Generic function pointer for computing a dot product. Parallel synchronization is performed inside th...
Definition: cs_cdo_blas.h:59
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:325
unsigned short int cs_flag_t
Definition: cs_defs.h:334
void cs_iter_algo_reset(cs_iter_algo_t *algo)
Reset a cs_iter_algo_t structure.
Definition: cs_iter_algo.cpp:540
void cs_iter_algo_check_warning(const char *func_name, const char *eq_name, const char *algo_name, cs_iter_algo_t *algo)
Check if something wrong happens during the iterative process after one new iteration.
Definition: cs_iter_algo.cpp:1513
void cs_iter_algo_set_tolerance(cs_iter_algo_t *algo, double tol)
Set the final tolerance used to check the convergence of the algorithm This tolerance should take int...
Definition: cs_iter_algo.cpp:641
void cs_iter_algo_log_cvg(cs_iter_algo_t *algo, const char *label)
Log the convergence of the iterative algorithm.
Definition: cs_iter_algo.cpp:1415
void cs_iter_algo_release_anderson_arrays(cs_iter_algo_aac_t *c)
Free the members (arrays and matrix) associated to the context structure of an Anderson acceleration.
Definition: cs_iter_algo.cpp:572
cs_iter_algo_param_aac_t cs_iter_algo_get_anderson_param(cs_iter_algo_t *algo)
Retrieve the set of parameters for an Anderson algorithm.
Definition: cs_iter_algo.cpp:966
void cs_iter_algo_set_initial_residual(cs_iter_algo_t *algo, double value)
Set the initial residual used to detect a divergence.
Definition: cs_iter_algo.cpp:672
cs_sles_convergence_state_t cs_iter_algo_get_cvg_status(const cs_iter_algo_t *algo)
Retrieve the last convergence state.
Definition: cs_iter_algo.cpp:902
cs_iter_algo_type_bit_t
Definition: cs_iter_algo.h:61
@ CS_ITER_ALGO_DEFAULT
Definition: cs_iter_algo.h:63
@ CS_ITER_ALGO_ANDERSON
Definition: cs_iter_algo.h:64
@ CS_ITER_ALGO_TWO_LEVEL
Definition: cs_iter_algo.h:65
cs_iter_algo_t * cs_iter_algo_create(cs_iter_algo_type_t type)
Create and initialize by default a new cs_iter_algo_t structure.
Definition: cs_iter_algo.cpp:400
cs_sles_convergence_state_t cs_iter_algo_update_cvg_tol_auto(cs_iter_algo_t *algo)
Update the convergence status and the number of iterations. The tolerance threshold is automatically ...
Definition: cs_iter_algo.cpp:1390
cs_iter_algo_t * cs_iter_algo_create_with_settings(cs_iter_algo_type_t type, int verbosity, cs_param_convergence_t cvg_param)
Create a new cs_iter_algo_t structure with the given settings.
Definition: cs_iter_algo.cpp:479
void cs_iter_algo_set_cvg_status(cs_iter_algo_t *algo, cs_sles_convergence_state_t cvg_status)
Set the convergence status of the given structure.
Definition: cs_iter_algo.cpp:735
int cs_iter_algo_get_n_iter(const cs_iter_algo_t *algo)
Retrieve the current number of iterations done.
Definition: cs_iter_algo.cpp:799
void cs_iter_algo_set_verbosity(cs_iter_algo_t *algo, int verbosity)
Define the verbosity of the given iterative algorithm.
Definition: cs_iter_algo.cpp:597
void cs_iter_algo_update_inner_iters(cs_iter_algo_t *algo, int n_last_inner_iter)
Update the counting of inner iterations in two-level algorithms.
Definition: cs_iter_algo.cpp:1229
void cs_iter_algo_update_residual(cs_iter_algo_t *algo, double res)
Update the value of the residual and its associated members.
Definition: cs_iter_algo.cpp:1266
void cs_iter_algo_set_normalization(cs_iter_algo_t *algo, double value)
Set the normalization to apply when checking the convergence of the algorithm.
Definition: cs_iter_algo.cpp:704
void cs_iter_algo_free(cs_iter_algo_t **p_algo)
Free a cs_iter_algo_t structure.
Definition: cs_iter_algo.cpp:503
void cs_iter_algo_update_anderson(cs_iter_algo_t *algo, cs_real_t *cur_iterate, const cs_real_t *pre_iterate, cs_cdo_blas_dotprod_t *dotprod, cs_cdo_blas_square_norm_t *sqnorm)
Apply one more iteration of the Anderson acceleration.
Definition: cs_iter_algo.cpp:993
double cs_iter_algo_get_normalization(const cs_iter_algo_t *algo)
Get the normalization to apply when computing the tolerance threshold.
Definition: cs_iter_algo.cpp:933
double cs_iter_algo_get_residual(const cs_iter_algo_t *algo)
Retrieve the last computed residual.
Definition: cs_iter_algo.cpp:869
void cs_iter_algo_set_anderson_param(cs_iter_algo_t *algo, cs_iter_algo_param_aac_t aac_param, cs_lnum_t n_elts)
Create a new cs_iter_algo_aac_t structure for Anderson acceleration.
Definition: cs_iter_algo.cpp:767
cs_sles_convergence_state_t cs_iter_algo_update_cvg_tol_given(cs_iter_algo_t *algo, double tol)
Update the convergence status and the number of iterations. The tolerance threshold is given so that ...
Definition: cs_iter_algo.cpp:1314
void cs_iter_algo_set_cvg_param(cs_iter_algo_t *algo, cs_param_convergence_t cvg_param)
Define the criteria related to the convergence of the given iterative algorithm.
Definition: cs_iter_algo.cpp:618
cs_flag_t cs_iter_algo_type_t
Definition: cs_iter_algo.h:69
int cs_iter_algo_get_n_inner_iter(const cs_iter_algo_t *algo)
Retrieve the cumulated number of inner iterations done.
Definition: cs_iter_algo.cpp:832
Structure and routines handling the SLES ((Sparse Linear Equation Solver) settings stored inside a cs...
cs_sles_convergence_state_t
Definition: cs_sles.h:57
char * label
Definition: keywords.h:58
char * algo
Definition: field_names.h:106
Context structure for the algorithm called Anderson acceleration.
Definition: cs_iter_algo.h:165
int n_inner_iter
Definition: cs_iter_algo.h:221
cs_real_t * gold
Definition: cs_iter_algo.h:261
double prev_res
Definition: cs_iter_algo.h:216
double tol
Definition: cs_iter_algo.h:214
double res0
Definition: cs_iter_algo.h:218
cs_real_t * dg
Definition: cs_iter_algo.h:262
cs_iter_algo_param_aac_t param
Definition: cs_iter_algo.h:175
cs_real_t * fold
Definition: cs_iter_algo.h:259
cs_real_t * Q
Definition: cs_iter_algo.h:264
cs_lnum_t n_elts
Definition: cs_iter_algo.h:256
cs_sles_convergence_state_t cvg_status
Definition: cs_iter_algo.h:212
cs_real_t * gamma
Definition: cs_iter_algo.h:267
int n_dir
Definition: cs_iter_algo.h:257
double res
Definition: cs_iter_algo.h:217
cs_real_t * df
Definition: cs_iter_algo.h:260
int last_inner_iter
Definition: cs_iter_algo.h:222
cs_sdm_t * R
Definition: cs_iter_algo.h:265
double normalization
Definition: cs_iter_algo.h:213
int n_algo_iter
Definition: cs_iter_algo.h:220
Definition: cs_iter_algo.h:74
int n_inner_iter
Definition: cs_iter_algo.h:120
double prev_res
Definition: cs_iter_algo.h:115
double tol
Definition: cs_iter_algo.h:113
double res0
Definition: cs_iter_algo.h:117
cs_sles_convergence_state_t cvg_status
Definition: cs_iter_algo.h:111
double res
Definition: cs_iter_algo.h:116
int last_inner_iter
Definition: cs_iter_algo.h:121
double normalization
Definition: cs_iter_algo.h:112
int n_algo_iter
Definition: cs_iter_algo.h:119
Structure storing all the parameters to drive the algorithm called Anderson acceleration.
Definition: cs_iter_algo.h:134
int n_max_dir
Definition: cs_iter_algo.h:152
double max_cond
Definition: cs_iter_algo.h:154
int starting_iter
Definition: cs_iter_algo.h:153
double beta
Definition: cs_iter_algo.h:155
Structure to handle the convergence of an iterative algorithm.
Definition: cs_iter_algo.h:285
cs_param_convergence_t cvg_param
Definition: cs_iter_algo.h:306
bool header_done
Definition: cs_iter_algo.h:308
void * context
Definition: cs_iter_algo.h:310
cs_iter_algo_type_t type
Definition: cs_iter_algo.h:305
int verbosity
Definition: cs_iter_algo.h:307
Set of parameters to check the convergence (or the divergence) of an iterative process (tolerances or...
Definition: cs_param_types.h:603