My Project
programmer's documentation
Functions
cs_sles_default.h File Reference
#include "cs_base.h"
#include "cs_halo_perio.h"
#include "cs_matrix.h"
#include "cs_sles.h"
Include dependency graph for cs_sles_default.h:

Go to the source code of this file.

Functions

void cs_sles_default_log_setup (void)
 
void cs_sles_default (int f_id, const char *name, const cs_matrix_t *a)
 Default definition of a sparse linear equation solver. More...
 
void cs_sles_default_setup (void)
 Default setup for sparse linear equation solver API. More...
 
int cs_sles_default_get_verbosity (int f_id, const char *name)
 Return default verbosity associated to a field id, name couple. More...
 
void cs_sles_default_finalize (void)
 Default finalization for sparse linear equation solver API. More...
 
void cs_sles_setup_native_coupling (int f_id, const char *name, bool symmetric, const int *diag_block_size, const int *extra_diag_block_size, const cs_real_t *da, const cs_real_t *xa)
 Call sparse linear equation solver setup for systems with internal coupling. More...
 
void cs_sles_setup_native_conv_diff (int f_id, const char *name, const int *diag_block_size, const int *extra_diag_block_size, const cs_real_t *da, const cs_real_t *xa, const cs_real_t *da_conv, const cs_real_t *xa_conv, const cs_real_t *da_diff, const cs_real_t *xa_diff)
 Call sparse linear equation solver setup for convection-diffusion systems. More...
 
cs_sles_convergence_state_t cs_sles_solve_native (int f_id, const char *name, bool symmetric, const int *diag_block_size, const int *extra_diag_block_size, const cs_real_t *da, const cs_real_t *xa, cs_halo_rotation_t rotation_mode, double precision, double r_norm, int *n_iter, double *residue, const cs_real_t *rhs, cs_real_t *vx)
 Call sparse linear equation solver using native matrix arrays. More...
 
void cs_sles_free_native (int f_id, const char *name)
 Free sparse linear equation solver setup using native matrix arrays. More...
 
bool cs_sles_default_error (cs_sles_t *sles, cs_sles_convergence_state_t state, const cs_matrix_t *a, cs_halo_rotation_t rotation_mode, const cs_real_t rhs[], cs_real_t vx[])
 Error handler attempting fallback to alternative solution procedure for sparse linear equation solver. More...
 

Function Documentation

◆ cs_sles_default()

void cs_sles_default ( int  f_id,
const char *  name,
const cs_matrix_t a 
)

Default definition of a sparse linear equation solver.

Parameters
[in]f_idassociated field id, or < 0
[in]nameassociated name if f_id < 0, or NULL
[in]amatrix

◆ cs_sles_default_error()

bool cs_sles_default_error ( cs_sles_t sles,
cs_sles_convergence_state_t  state,
const cs_matrix_t a,
cs_halo_rotation_t  rotation_mode,
const cs_real_t  rhs[],
cs_real_t  vx[] 
)

Error handler attempting fallback to alternative solution procedure for sparse linear equation solver.

In case of divergence with an iterative solver, this error handler switches to a default preconditioner, then resets the solution vector.

The default error for the solver type handler is then set, in case the solution fails again.

Note that this error handler may rebuild solver contexts, so should not be used in conjunction with shared contexts (such as multigrid ascent/descent contexts), but only for "outer" solvers.

Parameters
[in,out]slespointer to solver object
[in]stateconvergence status
[in]amatrix
[in]rotation_modehalo update option for rotational periodicity
[in]rhsright hand side
[in,out]vxsystem solution
Returns
true if fallback solution is possible, false otherwise

◆ cs_sles_default_finalize()

void cs_sles_default_finalize ( void  )

Default finalization for sparse linear equation solver API.

This includes performance data logging output.

◆ cs_sles_default_get_verbosity()

int cs_sles_default_get_verbosity ( int  f_id,
const char *  name 
)

Return default verbosity associated to a field id, name couple.

Parameters
[in]f_idassociated field id, or < 0
[in]nameassociated name if f_id < 0, or NULL
Returns
verbosity associated with field or name

◆ cs_sles_default_log_setup()

void cs_sles_default_log_setup ( void  )

◆ cs_sles_default_setup()

void cs_sles_default_setup ( void  )

Default setup for sparse linear equation solver API.

This includes setup logging.

◆ cs_sles_free_native()

void cs_sles_free_native ( int  f_id,
const char *  name 
)

Free sparse linear equation solver setup using native matrix arrays.

Parameters
[in]f_idassociated field id, or < 0
[in]nameassociated name if f_id < 0, or NULL

◆ cs_sles_setup_native_conv_diff()

void cs_sles_setup_native_conv_diff ( int  f_id,
const char *  name,
const int *  diag_block_size,
const int *  extra_diag_block_size,
const cs_real_t da,
const cs_real_t xa,
const cs_real_t da_conv,
const cs_real_t xa_conv,
const cs_real_t da_diff,
const cs_real_t xa_diff 
)

Call sparse linear equation solver setup for convection-diffusion systems.

Parameters
[in]f_idassociated field id, or < 0
[in]nameassociated name if f_id < 0, or NULL
[in]diag_block_sizeblock sizes for diagonal, or NULL
[in]extra_diag_block_sizeblock sizes for extra diagonal, or NULL
[in]dadiagonal values (NULL if zero)
[in]xaextradiagonal values (NULL if zero)
[in]da_convdiagonal values (NULL if zero)
[in]xa_convextradiagonal values (NULL if zero)
[in]da_diffdiagonal values (NULL if zero)
[in]xa_diffextradiagonal values (NULL if zero)

◆ cs_sles_setup_native_coupling()

void cs_sles_setup_native_coupling ( int  f_id,
const char *  name,
bool  symmetric,
const int *  diag_block_size,
const int *  extra_diag_block_size,
const cs_real_t da,
const cs_real_t xa 
)

Call sparse linear equation solver setup for systems with internal coupling.

Parameters
[in]f_idassociated field id, or < 0
[in]nameassociated name if f_id < 0, or NULL
[in]symmetricindicates if matrix coefficients are symmetric
[in]diag_block_sizeblock sizes for diagonal, or NULL
[in]extra_diag_block_sizeblock sizes for extra diagonal, or NULL
[in]dadiagonal values (NULL if zero)
[in]xaextradiagonal values (NULL if zero)

◆ cs_sles_solve_native()

cs_sles_convergence_state_t cs_sles_solve_native ( int  f_id,
const char *  name,
bool  symmetric,
const int *  diag_block_size,
const int *  extra_diag_block_size,
const cs_real_t da,
const cs_real_t xa,
cs_halo_rotation_t  rotation_mode,
double  precision,
double  r_norm,
int *  n_iter,
double *  residue,
const cs_real_t rhs,
cs_real_t vx 
)

Call sparse linear equation solver using native matrix arrays.

Parameters
[in]f_idassociated field id, or < 0
[in]nameassociated name if f_id < 0, or NULL
[in]symmetricindicates if matrix coefficients are symmetric
[in]diag_block_sizeblock sizes for diagonal, or NULL
[in]extra_diag_block_sizeblock sizes for extra diagonal, or NULL
[in]dadiagonal values (NULL if zero)
[in]xaextradiagonal values (NULL if zero)
[in]rotation_modehalo update option for rotational periodicity
[in]precisionsolver precision
[in]r_normresidue normalization
[out]n_iternumber of "equivalent" iterations
[out]residueresidue
[in]rhsright hand side
[in,out]vxsystem solution
Returns
convergence state