9.0
general documentation
Loading...
Searching...
No Matches
cs_cdo_solve.cpp File Reference
#include "base/cs_defs.h"
#include <assert.h>
#include <stdlib.h>
#include <float.h>
#include "bft/bft_mem.h"
#include "base/cs_array.h"
#include "alge/cs_blas.h"
#include "base/cs_math.h"
#include "base/cs_parall.h"
#include "base/cs_parameters.h"
#include "cdo/cs_cdo_solve.h"
Include dependency graph for cs_cdo_solve.cpp:

Functions

void cs_cdo_solve_sync_rhs_norm (cs_param_resnorm_type_t type, double vol_tot, cs_lnum_t rhs_size, const cs_real_t rhs[], double *normalization)
 Compute the value of the rhs norm used as a renormalization coefficient for the residual norm when solving the linear system. A pre-computation performed during the cellwise building of the algebraic has been done before this call according to the requested type of renormalization.
void cs_cdo_solve_prepare_system (int stride, bool interlace, cs_lnum_t x_size, const cs_range_set_t *rset, bool rhs_redux, cs_real_t *x, cs_real_t *b)
 Prepare a linear system and synchronize buffers in case of parallel or periodic computations. Transfer a mesh-based description of arrays x0 and rhs into an algebraic description for the linear system in x and b (scatter/gather views).
int cs_cdo_solve_scalar_cell_system (cs_lnum_t n_dofs, const cs_param_sles_t *slesp, const cs_matrix_t *matrix, cs_real_t normalization, cs_sles_t *sles, cs_real_t *x, cs_real_t *b)
 Solve a linear system arising with scalar-valued cell-based DoFs* No rotation is taken into account when synchronizing halo.
int cs_cdo_solve_scalar_system (cs_lnum_t n_scatter_dofs, const cs_param_sles_t *slesp, const cs_matrix_t *matrix, const cs_range_set_t *rset, cs_real_t normalization, bool rhs_redux, cs_sles_t *sles, cs_real_t *x, cs_real_t *b)
 Solve a linear system arising from CDO schemes with scalar-valued degrees of freedom.
int cs_cdo_solve_vector_system (cs_lnum_t n_scatter_elts, bool interlace, const cs_param_sles_t *slesp, const cs_matrix_t *matrix, const cs_range_set_t *rset, cs_real_t normalization, bool rhs_redux, cs_sles_t *sles, cs_real_t *x, cs_real_t *b)
 Solve a linear system arising from CDO schemes with vector-valued degrees of freedom (DoFs). Number of DoFs is equal to 3*n_scatter_elts.

Function Documentation

◆ cs_cdo_solve_prepare_system()

void cs_cdo_solve_prepare_system ( int stride,
bool interlace,
cs_lnum_t x_size,
const cs_range_set_t * rset,
bool rhs_redux,
cs_real_t * x,
cs_real_t * b )

Prepare a linear system and synchronize buffers in case of parallel or periodic computations. Transfer a mesh-based description of arrays x0 and rhs into an algebraic description for the linear system in x and b (scatter/gather views).

Parameters
[in]stridestride to apply to the range set operations
[in]interlaceis data interlaced or not
[in]x_sizesize of the vector unknowns (scatter view)
[in]rsetpointer to a range set structure
[in]rhs_reduxdo or not a parallel sum reduction on the RHS
[in,out]xarray of unknowns (in: initial guess)
[in,out]bright-hand side

◆ cs_cdo_solve_scalar_cell_system()

int cs_cdo_solve_scalar_cell_system ( cs_lnum_t n_dofs,
const cs_param_sles_t * slesp,
const cs_matrix_t * matrix,
cs_real_t normalization,
cs_sles_t * sles,
cs_real_t * x,
cs_real_t * b )

Solve a linear system arising with scalar-valued cell-based DoFs* No rotation is taken into account when synchronizing halo.

Solve a linear system arising with scalar-valued cell-based DoFs No rotation is taken into account when synchronizing halo.

Parameters
[in]n_dofslocal number of DoFs
[in]slesppointer to a cs_param_sles_t structure
[in]matrixpointer to a cs_matrix_t structure
[in]normalizationvalue used for the residual normalization
[in,out]slespointer to a cs_sles_t structure
[in,out]xsolution of the linear system (in: initial guess)
[in,out]bright-hand side (scatter/gather if needed)
Returns
the number of iterations of the linear solver

◆ cs_cdo_solve_scalar_system()

int cs_cdo_solve_scalar_system ( cs_lnum_t n_scatter_dofs,
const cs_param_sles_t * slesp,
const cs_matrix_t * matrix,
const cs_range_set_t * rset,
cs_real_t normalization,
bool rhs_redux,
cs_sles_t * sles,
cs_real_t * x,
cs_real_t * b )

Solve a linear system arising from CDO schemes with scalar-valued degrees of freedom.

Parameters
[in]n_scatter_dofslocal number of DoFs (may be != n_gather_elts)
[in]slesppointer to a cs_param_sles_t structure
[in]matrixpointer to a cs_matrix_t structure
[in]rsetpointer to a cs_range_set_t structure
[in]normalizationvalue used for the residual normalization
[in]rhs_reduxdo or not a parallel sum reduction on the RHS
[in,out]slespointer to a cs_sles_t structure
[in,out]xsolution of the linear system (in: initial guess)
[in,out]bright-hand side (scatter/gather if needed)
Returns
the number of iterations of the linear solver

◆ cs_cdo_solve_sync_rhs_norm()

void cs_cdo_solve_sync_rhs_norm ( cs_param_resnorm_type_t type,
double vol_tot,
cs_lnum_t rhs_size,
const cs_real_t rhs[],
double * normalization )

Compute the value of the rhs norm used as a renormalization coefficient for the residual norm when solving the linear system. A pre-computation performed during the cellwise building of the algebraic has been done before this call according to the requested type of renormalization.

Parameters
[in]typetype of renormalization
[in]vol_tottotal volume of the computational domain
[in]rhs_sizesize of the rhs array
[in]rhsarray related to the right-hand side
[in,out]normalizationvalue of the residual normalization

◆ cs_cdo_solve_vector_system()

int cs_cdo_solve_vector_system ( cs_lnum_t n_scatter_elts,
bool interlace,
const cs_param_sles_t * slesp,
const cs_matrix_t * matrix,
const cs_range_set_t * rset,
cs_real_t normalization,
bool rhs_redux,
cs_sles_t * sles,
cs_real_t * x,
cs_real_t * b )

Solve a linear system arising from CDO schemes with vector-valued degrees of freedom (DoFs). Number of DoFs is equal to 3*n_scatter_elts.

Parameters
[in]n_scatter_eltslocal number of elements (may be != n_gather_elts)
[in]interlaceway to arrange data (true/false)
[in]slesppointer to a cs_param_sles_t structure
[in]matrixpointer to a cs_matrix_t structure
[in]rsetpointer to a cs_range_set_t structure
[in]normalizationvalue used for the residual normalization
[in]rhs_reduxdo or not a parallel sum reduction on the RHS
[in,out]slespointer to a cs_sles_t structure
[in,out]xsolution of the linear system (in: initial guess)
[in,out]bright-hand side (scatter/gather if needed)
Returns
the number of iterations of the linear solver