8.3
general documentation
cs_dbg.h File Reference
#include <float.h>
#include "cs_base.h"
#include "cs_cdo_bc.h"
#include "cs_cdo_local.h"
#include "cs_defs.h"
#include "cs_equation_param.h"
#include "cs_math.h"
#include "cs_matrix.h"
+ Include dependency graph for cs_dbg.h:

Go to the source code of this file.

Functions

static void cs_dbg_check_hmg_dirichlet_cw (const char *fname, const cs_cell_sys_t *csys)
 Check if there is no invalid setting for a homogeneous Dirichlet. More...
 
bool cs_dbg_cw_test (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_cell_sys_t *csys)
 Function used to select which element deserves a dump or specific treatment during a debugging stage. More...
 
void cs_dbg_array_fprintf (FILE *fp, const char *fname, cs_real_t thd, cs_lnum_t n_elts, const cs_real_t array[], int n_cols)
 Print an array. Print into the file f if given otherwise open a new file named fname if given otherwise print into the standard output The usage of threshold allows one to compare more easier arrays. without taking into account numerical roundoff. More...
 
void cs_dbg_fprintf_system (const char *eqname, int id, int level, const cs_real_t *sol, const cs_real_t *rhs, cs_lnum_t size)
 In debug mode, print into a file the solution and its right-hand side. More...
 
void cs_dbg_darray_to_listing (const char *header, const cs_lnum_t size, const cs_real_t array[], int n_cols)
 In debug mode, dump an array of double into the log. More...
 
void cs_dbg_iarray_to_listing (const char *header, const cs_lnum_t size, const cs_lnum_t array[], int n_cols)
 In debug mode, dump an array of integer into the log. More...
 
void cs_dbg_dump_local_scalar_msr_matrix (const char *name, const cs_matrix_t *matrix)
 In debug mode, dump a linear system. Case of scalar-valued entries. More...
 
void cs_dbg_print_local_scalar_msr_matrix (const char *name, const cs_matrix_t *matrix)
 Print a linear system. Case of scalar-valued entries. More...
 
void cs_dbg_dump_msr_system (const char *eqname, cs_lnum_t size, int verbosity, const cs_real_t x[], const cs_real_t b[], const cs_lnum_t row_index[], const cs_lnum_t col_id[], const cs_real_t xval[], const cs_real_t dval[])
 In debug mode, dump a linear system stored in a MSR format into the listing file (should be a small system) More...
 
void cs_dbg_binary_dump_system (const char *basename, const cs_matrix_t *matrix, const cs_real_t *rhs, const cs_real_t *sol)
 Binary dump (matrix, rhs and solution) of a matrix, its right-hand side and the solution array. More...
 

Function Documentation

◆ cs_dbg_array_fprintf()

void cs_dbg_array_fprintf ( FILE *  fp,
const char *  fname,
cs_real_t  thd,
cs_lnum_t  n_elts,
const cs_real_t  array[],
int  n_cols 
)

Print an array. Print into the file f if given otherwise open a new file named fname if given otherwise print into the standard output The usage of threshold allows one to compare more easier arrays. without taking into account numerical roundoff.

Parameters
[in]fppointer to a file structure or null
[in]fnamefilename or null
[in]thdthreshold (below this value --> set 0)
[in]n_eltssize of the array
[in]arraylist of values to dump
[in]n_colsprint array with n_cols columns

Print an array. Print into the file f if given otherwise open a new file named fname if given otherwise print into the standard output The usage of threshold allows one to compare more easier arrays. without taking into account numerical roundoff.

Parameters
[in]fppointer to a file structure or nullptr
[in]fnamefilename or nullptr
[in]thdthreshold (below this value --> set 0)
[in]n_eltssize of the array
[in]arraylist of values to dump
[in]n_colsprint array with n_cols columns

◆ cs_dbg_binary_dump_system()

void cs_dbg_binary_dump_system ( const char *  basename,
const cs_matrix_t matrix,
const cs_real_t rhs,
const cs_real_t sol 
)

Binary dump (matrix, rhs and solution) of a matrix, its right-hand side and the solution array.

Parameters
[in]basenamename of the system
[in]matrixmatrix to dump
[in]bright-hand side to dump or null
[in]xsolution array to dump or null
[in]basenamename of the system
[in]matrixmatrix to dump
[in]bright-hand side to dump
[in]xsolution array to dump

◆ cs_dbg_check_hmg_dirichlet_cw()

static void cs_dbg_check_hmg_dirichlet_cw ( const char *  fname,
const cs_cell_sys_t csys 
)
inlinestatic

Check if there is no invalid setting for a homogeneous Dirichlet.

Parameters
[in]fnamename of the calling function
[in]csyspointer to a cs_cell_mesh_t structure

◆ cs_dbg_cw_test()

bool cs_dbg_cw_test ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
const cs_cell_sys_t csys 
)

Function used to select which element deserves a dump or specific treatment during a debugging stage.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in]csyspointer to a cs_cell_sys_t structure

◆ cs_dbg_darray_to_listing()

void cs_dbg_darray_to_listing ( const char *  header,
const cs_lnum_t  size,
const cs_real_t  array[],
int  n_cols 
)

In debug mode, dump an array of double into the log.

Parameters
[in]headerheader message to write
[in]sizenumber of elements in array
[in]arraypointer to the array of values
[in]n_colsprint array with n_cols columns

◆ cs_dbg_dump_local_scalar_msr_matrix()

void cs_dbg_dump_local_scalar_msr_matrix ( const char *  name,
const cs_matrix_t matrix 
)

In debug mode, dump a linear system. Case of scalar-valued entries.

Parameters
[in]namename of the equation related to the current system
[in]matrixpointer to the matrix to dump

◆ cs_dbg_dump_msr_system()

void cs_dbg_dump_msr_system ( const char *  eqname,
cs_lnum_t  size,
int  verbosity,
const cs_real_t  x[],
const cs_real_t  b[],
const cs_lnum_t  row_index[],
const cs_lnum_t  col_id[],
const cs_real_t  xval[],
const cs_real_t  dval[] 
)

In debug mode, dump a linear system stored in a MSR format into the listing file (should be a small system)

Parameters
[in]eqnamename of the equation related to the current system
[in]sizenumber of elements in array
[in]verbositylevel of display
[in]xsolution array
[in]bright-hand side
[in]row_indexindex on row entries (column id and extra-diag values)
[in]col_idlist of column id
[in]xvalarray of extra-diagonal values
[in]dvalarray of diagonal values

◆ cs_dbg_fprintf_system()

void cs_dbg_fprintf_system ( const char *  eqname,
int  id,
int  level,
const cs_real_t sol,
const cs_real_t rhs,
cs_lnum_t  size 
)

In debug mode, print into a file the solution and its right-hand side.

Parameters
[in]eqnamename of the related equation
[in]idid number
[in]levellevel of debug
[in]solsolution array
[in]rhsrhs array
[in]sizesize of the array to print

◆ cs_dbg_iarray_to_listing()

void cs_dbg_iarray_to_listing ( const char *  header,
const cs_lnum_t  size,
const cs_lnum_t  array[],
int  n_cols 
)

In debug mode, dump an array of integer into the log.

Parameters
[in]headerheader message to write
[in]sizenumber of elements in array
[in]arraypointer to the array of values
[in]n_colsprint array with n_cols columns

◆ cs_dbg_print_local_scalar_msr_matrix()

void cs_dbg_print_local_scalar_msr_matrix ( const char *  name,
const cs_matrix_t matrix 
)

Print a linear system. Case of scalar-valued entries.

Parameters
[in]namename of the equation related to the current system
[in]matrixpointer to the matrix to dump