My Project
programmer's documentation
Functions
cs_flag_check.c File Reference
#include "cs_defs.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <math.h>
#include <mpi.h>
#include <ple_locator.h>
#include "bft_mem.h"
#include "bft_error.h"
#include "bft_printf.h"
#include "cs_base.h"
#include "cs_log.h"
#include "cs_map.h"
#include "cs_mesh.h"
#include "cs_mesh_location.h"
#include "cs_mesh_quantities.h"
#include "cs_parall.h"
#include "cs_post.h"
#include "cs_flag_check.h"
Include dependency graph for cs_flag_check.c:

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...
 

Detailed Description

Mesh element flag checking and error handling..

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

◆ 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