My Project
programmer's documentation
Functions
cs_flag_check.h File Reference
#include "cs_base.h"
#include "cs_mesh_location.h"
Include dependency graph for cs_flag_check.h:

Go to the source code of this file.

Functions

int cs_flag_check (const char *err_elt_descr, const char *flag_descr, const char *flag_label, const char *error_mesh_name, const char *valid_mesh_name, int location_id, int min_flag, const int elt_flag[])
 Check for and handle errors with an associated element flag. More...
 
void cs_flag_check_error_info (const char *err_elt_descr, const char *flag_descr, const char *flag_label, const char *error_mesh_name, const char *valid_mesh_name, int location_id, int min_flag, const int elt_flag[])
 Handle an error with an associated element flag. More...
 

Function Documentation

◆ cs_flag_check()

int cs_flag_check ( const char *  err_elt_descr,
const char *  flag_descr,
const char *  flag_label,
const char *  error_mesh_name,
const char *  valid_mesh_name,
int  location_id,
int  min_flag,
const int  elt_flag[] 
)

Check for and handle errors with an associated element flag.

It is assumed that element flags are usually positive integers, and that in case of a detected error, their signs have been set to a negative value.

A minimum allowed value may be specified, so for example 0 may be considered a valid or invalid flag depending on that minimum.

This function exits silently if no such marked elements are present in the computational domain.

Otherwise, it logs information on the first detected error location, and outputs postprocessing visualization information to assist debugging.

If the error status (i.e. negative flag) is known locally but not globally, use cs_flag_check.

Currently supported locations are CS_MESH_LOCATION_CELLS and CS_MESH_LOCATION_BOUNDARY_FACES.

Parameters
[in]err_elt_descrdescription fro first element with error
[in]flag_descrflag type description
[in]flag_labelfield label for flag postprocessing
[in]error_mesh_namepostprocessing mesh name for elements with error
[in]valid_mesh_namepostprocessing mesh name for valid elements
[in]location_idassociated mesh location
[in]min_flagminimum allowed flag
[in]elt_flagcurrent element flag
Returns
0 in case no error was detected, 1 in case of errors.

It is assumed that element flags are usually positive integers, and that in case of a detected error, their signs have been set to a negative value.

A minimum allowed value may be specified, so for example 0 may be considered a valid or invalid flag depending on that minimum.

This function exits silently if no such marked elements are present in the computational domain.

Otherwise, it logs information on the first detected error location, and outputs postprocessing visualization information to assist debugging.

If the error status (i.e. negative flag) is known locally but not globally, use cs_flag_check.

Currently supported locations are CS_MESH_LOCATION_CELLS and CS_MESH_LOCATION_BOUNDARY_FACES.

Parameters
[in]err_elt_descrdescription fro first element with error
[in]flag_descrflag type description
[in]flag_labelfield label for flag postprocessing
[in]error_mesh_namepostprocessing mesh name for elements with error
[in]valid_mesh_namepostprocessing mesh name for valid elements
[in]location_idassociated mesh location
[in]min_flagminimum allowed flag
[in]elt_flagcurrent element flag

◆ cs_flag_check_error_info()

void cs_flag_check_error_info ( const char *  err_elt_descr,
const char *  flag_descr,
const char *  flag_label,
const char *  error_mesh_name,
const char *  valid_mesh_name,
int  location_id,
int  min_flag,
const int  elt_flag[] 
)

Handle an error with an associated element flag.

This function logs information on the first detected error location, and outputs postprocessing visualization information to assist debugging.

It is assumed that element flags are usually positive integers, and that in case of a detected error, their signs have been set to a negative value.

A minimum allowed value may be specified, so for example 0 may be considered a valid or invalid flag depending on that minimum.

This function should be called when the error status has been previously checked, and all ranks know that an error is present.

If the error status (i.e. negative flag) is known locally but not globally, use cs_flag_check.

Currently supported locations are CS_MESH_LOCATION_CELLS and CS_MESH_LOCATION_BOUNDARY_FACES.

Parameters
[in]err_elt_descrdescription fro first element with error
[in]flag_descrflag type description
[in]flag_labelfield label for flag postprocessing
[in]error_mesh_namepostprocessing mesh name for elements with error
[in]valid_mesh_namepostprocessing mesh name for valid elements
[in]location_idassociated mesh location
[in]min_flagminimum allowed flag
[in]elt_flagcurrent element flag