1 #ifndef __CS_ITER_ALGO_H__
2 #define __CS_ITER_ALGO_H__
239 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.
Definition: cs_cdo_blas.h:79
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.
Definition: cs_cdo_blas.h:64
#define BEGIN_C_DECLS
Definition: cs_defs.h:509
double cs_real_t
Floating-point value.
Definition: cs_defs.h:319
#define END_C_DECLS
Definition: cs_defs.h:510
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:313
static void cs_iter_algo_reset(cs_iter_algo_t *algo)
Reset a cs_iter_algo_t structure.
Definition: cs_iter_algo.h:190
cs_iter_algo_param_aa_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.c:594
void cs_iter_algo_post_check(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.c:409
void cs_iter_algo_aa_free_arrays(cs_iter_algo_aa_t *aa)
Free arrays used during the Anderson acceleration.
Definition: cs_iter_algo.c:664
void cs_iter_algo_aa_update(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.c:719
void cs_iter_algo_aa_free(cs_iter_algo_t *algo)
Free a cs_iter_algo_aa_t structure inside a cs_iter_algo_t structure This structure is used to manage...
Definition: cs_iter_algo.c:691
cs_iter_algo_aa_t * cs_iter_algo_aa_create(cs_iter_algo_param_aa_t aap, cs_lnum_t n_elts)
Create a new cs_iter_algo_aa_t structure for Anderson acceleration.
Definition: cs_iter_algo.c:550
void cs_iter_algo_aa_allocate_arrays(cs_iter_algo_aa_t *aa)
Allocate arrays needed by the "Anderson acceleration" algorithm.
Definition: cs_iter_algo.c:626
void cs_iter_algo_reset_nl(cs_param_nl_algo_t nl_algo_type, cs_iter_algo_t *algo)
Reset a cs_iter_algo_t structure in case of a non-linear algorothm.
Definition: cs_iter_algo.c:521
void cs_iter_algo_update_cvg(cs_iter_algo_t *algo)
Update the convergence status and the number of iterations. The tolerance threshold has to be compute...
Definition: cs_iter_algo.c:449
void cs_iter_algo_update_cvg_default(cs_iter_algo_t *algo)
Update the convergence status and the number of iterations. The tolerance threshold is computed by a ...
Definition: cs_iter_algo.c:483
cs_iter_algo_t * cs_iter_algo_create(int verbosity, cs_param_sles_cvg_t cvg_param)
Create and initialize a new cs_iter_algo_t structure.
Definition: cs_iter_algo.c:375
const cs_real_t cs_math_big_r
Structure and routines handling the SLES settings stored inside a cs_param_sles_t structure.
cs_param_nl_algo_t
Class of non-linear iterative algorithm.
Definition: cs_param_types.h:551
cs_param_dotprod_type_t
Definition: cs_param_types.h:1093
cs_sles_convergence_state_t
Definition: cs_sles.h:56
@ CS_SLES_ITERATING
Definition: cs_sles.h:61
Context structure for the algorithm called Anderson acceleration.
Structure storing all the parameters to drive the algorithm called Anderson acceleration.
Definition: cs_iter_algo.h:140
cs_param_dotprod_type_t dp_type
Definition: cs_iter_algo.h:165
int n_max_dir
Definition: cs_iter_algo.h:161
double max_cond
Definition: cs_iter_algo.h:163
int starting_iter
Definition: cs_iter_algo.h:162
double beta
Definition: cs_iter_algo.h:164
Structure to handle the convergence of an iterative algorithm.
Definition: cs_iter_algo.h:60
cs_param_sles_cvg_t cvg_param
Definition: cs_iter_algo.h:116
int n_inner_iter
Definition: cs_iter_algo.h:129
double prev_res
Definition: cs_iter_algo.h:124
double tol
Definition: cs_iter_algo.h:122
void * context
Definition: cs_iter_algo.h:118
double res0
Definition: cs_iter_algo.h:126
cs_sles_convergence_state_t cvg_status
Definition: cs_iter_algo.h:120
int verbosity
Definition: cs_iter_algo.h:115
double res
Definition: cs_iter_algo.h:125
int last_inner_iter
Definition: cs_iter_algo.h:130
double normalization
Definition: cs_iter_algo.h:121
int n_algo_iter
Definition: cs_iter_algo.h:128
Set of parameters to check the convergence (or the divergence) of an iterative process (tolerances or...
Definition: cs_param_sles.h:61