My Project
programmer's documentation
|
#include "cs_defs.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <math.h>
#include "bft_mem.h"
#include "bft_error.h"
#include "bft_printf.h"
#include "cs_base.h"
#include "cs_field.h"
#include "cs_grid.h"
#include "cs_halo.h"
#include "cs_internal_coupling.h"
#include "cs_log.h"
#include "cs_mesh.h"
#include "cs_matrix.h"
#include "cs_matrix_default.h"
#include "cs_matrix_util.h"
#include "cs_multigrid.h"
#include "cs_parameters.h"
#include "cs_sles.h"
#include "cs_sles_it.h"
#include "cs_sles_pc.h"
#include "cs_timer.h"
#include "cs_sles_default.h"
Functions | |
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... | |
void | cs_sles_default_finalize (void) |
Default finalization 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_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... | |
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... | |
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... | |
void cs_sles_default | ( | int | f_id, |
const char * | name, | ||
const cs_matrix_t * | a | ||
) |
Default definition of a sparse linear equation solver.
[in] | f_id | associated field id, or < 0 |
[in] | name | associated name if f_id < 0, or NULL |
[in] | a | matrix |
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.
[in,out] | sles | pointer to solver object |
[in] | state | convergence status |
[in] | a | matrix |
[in] | rotation_mode | halo update option for rotational periodicity |
[in] | rhs | right hand side |
[in,out] | vx | system solution |
void cs_sles_default_finalize | ( | void | ) |
Default finalization for sparse linear equation solver API.
This includes performance data logging output.
int cs_sles_default_get_verbosity | ( | int | f_id, |
const char * | name | ||
) |
Return default verbosity associated to a field id, name couple.
[in] | f_id | associated field id, or < 0 |
[in] | name | associated name if f_id < 0, or NULL |
void cs_sles_default_setup | ( | void | ) |
Default setup for sparse linear equation solver API.
This includes setup logging.
void cs_sles_free_native | ( | int | f_id, |
const char * | name | ||
) |
Free sparse linear equation solver setup using native matrix arrays.
[in] | f_id | associated field id, or < 0 |
[in] | name | associated name if f_id < 0, or NULL |
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.
[in] | f_id | associated field id, or < 0 |
[in] | name | associated name if f_id < 0, or NULL |
[in] | diag_block_size | block sizes for diagonal, or NULL |
[in] | extra_diag_block_size | block sizes for extra diagonal, or NULL |
[in] | da | diagonal values (NULL if zero) |
[in] | xa | extradiagonal values (NULL if zero) |
[in] | da_conv | diagonal values (NULL if zero) |
[in] | xa_conv | extradiagonal values (NULL if zero) |
[in] | da_diff | diagonal values (NULL if zero) |
[in] | xa_diff | extradiagonal values (NULL if zero) |
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.
[in] | f_id | associated field id, or < 0 |
[in] | name | associated name if f_id < 0, or NULL |
[in] | symmetric | indicates if matrix coefficients are symmetric |
[in] | diag_block_size | block sizes for diagonal, or NULL |
[in] | extra_diag_block_size | block sizes for extra diagonal, or NULL |
[in] | da | diagonal values (NULL if zero) |
[in] | xa | extradiagonal values (NULL if zero) |
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.
[in] | f_id | associated field id, or < 0 |
[in] | name | associated name if f_id < 0, or NULL |
[in] | symmetric | indicates if matrix coefficients are symmetric |
[in] | diag_block_size | block sizes for diagonal, or NULL |
[in] | extra_diag_block_size | block sizes for extra diagonal, or NULL |
[in] | da | diagonal values (NULL if zero) |
[in] | xa | extradiagonal values (NULL if zero) |
[in] | rotation_mode | halo update option for rotational periodicity |
[in] | precision | solver precision |
[in] | r_norm | residue normalization |
[out] | n_iter | number of "equivalent" iterations |
[out] | residue | residue |
[in] | rhs | right hand side |
[in,out] | vx | system solution |