Handle the settings of saddle-point systems. These systems arise from the monolithic coupling of the Navier-Stokes equations or in mixed formulation of scalar-valued equations. More...
#include "cs_param_sles.h"
Go to the source code of this file.
Data Structures | |
struct | cs_param_saddle_t |
Structure storing all metadata related to the resolution of a saddle-point linear system. A saddle-point system is depicted as. More... | |
struct | cs_param_saddle_context_alu_t |
struct | cs_param_saddle_context_block_krylov_t |
struct | cs_param_saddle_context_gkb_t |
struct | cs_param_saddle_context_notay_t |
struct | cs_param_saddle_context_uzacg_t |
struct | cs_param_saddle_context_simple_t |
Functions | |
void | cs_param_saddle_set_restart_range (cs_param_saddle_t *saddlep, int restart_range) |
Set the number of iterations to store before starting a Krylov solver. More... | |
void | cs_param_saddle_set_notay_scaling (cs_param_saddle_t *saddlep, double scaling_coef) |
Set the scaling coefficient used in the Notay's transformation devised in "Algebraic multigrid for Stokes equations" SIAM J. Sci. Comput. Vol. 39 (5), 2017 In this article, this scaling is denoted by alpha. More... | |
void | cs_param_saddle_set_augmentation_coef (cs_param_saddle_t *saddlep, double coef) |
Set the scaling in front of the augmentation term when an ALU, a GKB or a block Krylov algorithm is considered. More... | |
double | cs_param_saddle_get_augmentation_coef (const cs_param_saddle_t *saddlep) |
Get the scaling coefficient in front of the augmentation term when an ALU, GKB or block Krylov algorithm is considered. More... | |
const char * | cs_param_saddle_get_type_name (cs_param_saddle_solver_t type) |
Retrieve the name of the type of saddle-point solver. More... | |
cs_param_saddle_t * | cs_param_saddle_create (void) |
Create a cs_param_saddle_t structure No solver is set by default. More... | |
void | cs_param_saddle_free (cs_param_saddle_t **p_saddlep) |
Free the structure storing the parameter settings for a saddle-point system. More... | |
const char * | cs_param_saddle_get_name (const cs_param_saddle_t *saddlep) |
Retrieve the name of the saddle-point solver. More... | |
void | cs_param_saddle_set_name (const char *name, cs_param_saddle_t *saddlep) |
Set the name of the saddle-point system. More... | |
void | cs_param_saddle_set_block11_sles_param (cs_param_saddle_t *saddlep, const cs_param_sles_t *block11_slesp) |
Assign the cs_param_sles_t structure (shared) related to the (1,1)-block to the structure managing the resolution of the saddle-point problems. More... | |
int | cs_param_saddle_set_precond (const char *keyval, cs_param_saddle_t *saddlep) |
Set the type of preconditioning to apply for this saddle-point system. More... | |
int | cs_param_saddle_set_schur_approx (const char *keyval, cs_param_saddle_t *saddlep) |
Set the type of Schur approximation to apply to this saddle-point system. More... | |
int | cs_param_saddle_set_solver_class (const char *keyval, cs_param_saddle_t *saddlep) |
Set the class of solver to apply for this saddle-point system. More... | |
int | cs_param_saddle_set_solver (const char *keyval, cs_param_saddle_t *saddlep) |
Set the type of solver to apply for this saddle-point system. More... | |
void | cs_param_saddle_try_init_schur_sles_param (cs_param_saddle_t *saddlep) |
Initialize a cs_param_sles_t structure for the Schur approximation nested inside a cs_param_saddle_t structure. By default, this member is not allocated. Do nothing if the related structure is already allocated. More... | |
cs_param_sles_t * | cs_param_saddle_get_schur_sles_param (const cs_param_saddle_t *saddlep) |
Get the pointer to the set of parameters to handle a SLES. This SLES is associated to the approximation of the Schur complement. This is only useful for solving a saddle-point problem relying on an elaborated approximation of the Schur complement. More... | |
cs_param_sles_t * | cs_param_saddle_get_xtra_sles_param (const cs_param_saddle_t *saddlep) |
Get the pointer to the set of parameters to handle a SLES. This SLES is associated to an extra-operation specific to a saddle-point solver It returns a non-null pointer only for some sadlle-point solver relying on a more elaborated Schur complement approximation. More... | |
cs_param_sles_t * | cs_param_saddle_get_init_sles_param (const cs_param_saddle_t *saddlep) |
Get the pointer to the set of parameters to handle a SLES. This SLES is associated to the initial saddle-point problem. It returns a non null pointer only for some sadlle-point solver. More... | |
void | cs_param_saddle_copy (const cs_param_saddle_t *ref, cs_param_saddle_t *dest) |
Copy a cs_param_saddle_t structure from ref to dest. More... | |
void | cs_param_saddle_log (const cs_param_saddle_t *saddlep) |
Log the setup information for the given cs_param_saddle_t structure. More... | |
Handle the settings of saddle-point systems. These systems arise from the monolithic coupling of the Navier-Stokes equations or in mixed formulation of scalar-valued equations.
Type of preconditioner used to solve a saddle-point system. Up to now, this happens only in two cases: (1) with CDO cell-based schemes and (2) with the Stokes or Navier-Stokes equations with CDO face-based schemes and a monolithic approach (fully coupled) velocity-pressure coupling.
Enumerator | |
---|---|
CS_PARAM_SADDLE_PRECOND_NONE | No preconditioner to apply. |
CS_PARAM_SADDLE_PRECOND_DIAG | A block-diagonal preconditioner is used. The (1,1)-block is an approximation of the (1,1)-block in the saddle-point system based on a cheap resolution. The parameter settings for this resolution relies on the structure cs_param_sles_t. The (2,2)-block is approximated by the Schur approximation given (by default the identity). |
CS_PARAM_SADDLE_PRECOND_LOWER | A 2x2 block matrix is used as preconditioner with the (1,2)-block fills with zero. The (1,1)-block is an approximation of the (1,1)-block in the saddle-point system based on a cheap resolution. The parameter settings for this resolution relies on the structure cs_param_sles_t. The (2,2)-block is approximated by the Schur approximation given (by default the identity). |
CS_PARAM_SADDLE_PRECOND_SGS | A symmetric Gauss-Seidel 2x2 block preconditioner is used. The (1,1)-block is an approximation of the (1,1)-block in the saddle-point system based on a cheap resolution. The parameter settings for this resolution relies on the structure cs_param_sles_t The (2,2)-block is approximated by the Schur approximation given (by default the identity). |
CS_PARAM_SADDLE_PRECOND_UPPER | A 2x2 block matrix is used as preconditioner with the (2,1)-block fills with zero. The (1,1)-block is an approximation of the (1,1)-block in the saddle-point system based on a cheap resolution. The parameter settings for this resolution relies on the structure cs_param_sles_t The (2,2)-block is approximated by the Schur approximation given (by default the identity). |
CS_PARAM_SADDLE_PRECOND_UZAWA | An Uzawa-like 2x2 block preconditioner. One needs a Schur approximation. |
CS_PARAM_SADDLE_N_PRECOND |
Strategy to build the Schur complement approximation. This appears in block preconditioning or Uzawa algorithms when a fully coupled (also called monolithic) approach) is used.
The exact Schur complement is then
Type of solver used to solve a saddle-point system. Up to now, this happens only with CDO cell-based schemes or when solving the fully coupled Navier-Stokes system (monolithic) with CDO face-based schemes. A saddle-point system is an indefinite system.
void cs_param_saddle_copy | ( | const cs_param_saddle_t * | ref, |
cs_param_saddle_t * | dest | ||
) |
Copy a cs_param_saddle_t structure from ref to dest.
[in] | ref | reference structure to be copied |
[in,out] | dest | destination structure |
cs_param_saddle_t * cs_param_saddle_create | ( | void | ) |
Create a cs_param_saddle_t structure No solver is set by default.
void cs_param_saddle_free | ( | cs_param_saddle_t ** | p_saddlep | ) |
Free the structure storing the parameter settings for a saddle-point system.
[in,out] | p_saddlep | double pointer to the structure to free |
double cs_param_saddle_get_augmentation_coef | ( | const cs_param_saddle_t * | saddlep | ) |
Get the scaling coefficient in front of the augmentation term when an ALU, GKB or block Krylov algorithm is considered.
[in] | saddlep | set of parameters for solving a saddle-point |
Get the scaling coefficient in front of the augmentation term when an ALU, GKB or block Krylov algorithm is considered.
[in] | saddlep | set of parameters for solving a saddle-point |
cs_param_sles_t * cs_param_saddle_get_init_sles_param | ( | const cs_param_saddle_t * | saddlep | ) |
Get the pointer to the set of parameters to handle a SLES. This SLES is associated to the initial saddle-point problem. It returns a non null pointer only for some sadlle-point solver.
[in] | saddlep | pointer to a cs_param_saddle_t structure |
const char * cs_param_saddle_get_name | ( | const cs_param_saddle_t * | saddlep | ) |
Retrieve the name of the saddle-point solver.
[in] | saddlep | pointer to a set of saddle-point parameters |
cs_param_sles_t * cs_param_saddle_get_schur_sles_param | ( | const cs_param_saddle_t * | saddlep | ) |
Get the pointer to the set of parameters to handle a SLES. This SLES is associated to the approximation of the Schur complement. This is only useful for solving a saddle-point problem relying on an elaborated approximation of the Schur complement.
[in] | saddlep | pointer to a cs_param_saddle_t structure |
const char * cs_param_saddle_get_type_name | ( | cs_param_saddle_solver_t | type | ) |
Retrieve the name of the type of saddle-point solver.
[in] | type | type of saddle-point solver |
cs_param_sles_t * cs_param_saddle_get_xtra_sles_param | ( | const cs_param_saddle_t * | saddlep | ) |
Get the pointer to the set of parameters to handle a SLES. This SLES is associated to an extra-operation specific to a saddle-point solver It returns a non-null pointer only for some sadlle-point solver relying on a more elaborated Schur complement approximation.
[in] | saddlep | pointer to a cs_param_saddle_t structure |
void cs_param_saddle_log | ( | const cs_param_saddle_t * | saddlep | ) |
Log the setup information for the given cs_param_saddle_t structure.
[in] | saddlep | pointer to the structure |
void cs_param_saddle_set_augmentation_coef | ( | cs_param_saddle_t * | saddlep, |
double | coef | ||
) |
Set the scaling in front of the augmentation term when an ALU, a GKB or a block Krylov algorithm is considered.
[in,out] | saddlep | set of parameters for solving a saddle-point |
[in] | coef | value of the scaling coefficient |
Set the scaling in front of the augmentation term when an ALU, a GKB or a block Krylov algorithm is considered.
[in,out] | saddlep | set of parameters for solving a saddle-point |
[in] | coef | value of the scaling coefficient |
void cs_param_saddle_set_block11_sles_param | ( | cs_param_saddle_t * | saddlep, |
const cs_param_sles_t * | block11_slesp | ||
) |
Assign the cs_param_sles_t structure (shared) related to the (1,1)-block to the structure managing the resolution of the saddle-point problems.
[in,out] | saddlep | pointer to the structure to update |
[in] | block11_slesp | set of parameters for the (1,1) block |
void cs_param_saddle_set_name | ( | const char * | name, |
cs_param_saddle_t * | saddlep | ||
) |
Set the name of the saddle-point system.
[in] | name | name associated to this saddle-point system |
[in,out] | saddlep | pointer to the structure to update |
void cs_param_saddle_set_notay_scaling | ( | cs_param_saddle_t * | saddlep, |
double | scaling_coef | ||
) |
Set the scaling coefficient used in the Notay's transformation devised in "Algebraic multigrid for Stokes equations" SIAM J. Sci. Comput. Vol. 39 (5), 2017 In this article, this scaling is denoted by alpha.
[in,out] | saddlep | set of parameters for solving a saddle-point |
[in] | scaling_coef | value of the scaling coefficient |
int cs_param_saddle_set_precond | ( | const char * | keyval, |
cs_param_saddle_t * | saddlep | ||
) |
Set the type of preconditioning to apply for this saddle-point system.
[in] | keyval | value of the key for the preconditioner |
[in,out] | saddlep | pointer to the structure to update |
void cs_param_saddle_set_restart_range | ( | cs_param_saddle_t * | saddlep, |
int | restart_range | ||
) |
Set the number of iterations to store before starting a Krylov solver.
[in,out] | saddlep | set of parameters for solving a saddle-point |
[in] | restart_range | number of directions |
int cs_param_saddle_set_schur_approx | ( | const char * | keyval, |
cs_param_saddle_t * | saddlep | ||
) |
Set the type of Schur approximation to apply to this saddle-point system.
[in] | keyval | value of the key for the schur approx. |
[in,out] | saddlep | pointer to the structure to update |
int cs_param_saddle_set_solver | ( | const char * | keyval, |
cs_param_saddle_t * | saddlep | ||
) |
Set the type of solver to apply for this saddle-point system.
[in] | keyval | value of the key for the preconditioner |
[in,out] | saddlep | pointer to the structure to update |
int cs_param_saddle_set_solver_class | ( | const char * | keyval, |
cs_param_saddle_t * | saddlep | ||
) |
Set the class of solver to apply for this saddle-point system.
[in] | keyval | value of the key for the preconditioner |
[in,out] | saddlep | pointer to the structure to update |
void cs_param_saddle_try_init_schur_sles_param | ( | cs_param_saddle_t * | saddlep | ) |
Initialize a cs_param_sles_t structure for the Schur approximation nested inside a cs_param_saddle_t structure. By default, this member is not allocated. Do nothing if the related structure is already allocated.
[in,out] | saddlep | pointer to the structure to update |