9.0
general documentation
Loading...
Searching...
No Matches
cs_parameters_check.cpp File Reference
#include "base/cs_defs.h"
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "bft/bft_printf.h"
#include "bft/bft_error.h"
#include "atmo/cs_atmo.h"
#include "base/cs_1d_wall_thermal.h"
#include "base/cs_ale.h"
#include "base/cs_base.h"
#include "cfbl/cs_cf_model.h"
#include "base/cs_field.h"
#include "base/cs_field_default.h"
#include "base/cs_field_pointer.h"
#include "base/cs_ibm.h"
#include "lagr/cs_lagr.h"
#include "turb/cs_les_balance.h"
#include "base/cs_log.h"
#include "base/cs_math.h"
#include "base/cs_mem.h"
#include "mesh/cs_mesh_quantities.h"
#include "base/cs_parameters.h"
#include "base/cs_parall.h"
#include "base/cs_physical_constants.h"
#include "pprt/cs_physical_model.h"
#include "base/cs_porous_model.h"
#include "base/cs_porosity_from_scan.h"
#include "rayt/cs_rad_transfer.h"
#include "base/cs_restart_default.h"
#include "base/cs_thermal_model.h"
#include "base/cs_time_step.h"
#include "base/cs_turbomachinery.h"
#include "turb/cs_turbulence_model.h"
#include "base/cs_syr_coupling.h"
#include "base/cs_wall_functions.h"
#include "alge/cs_convection_diffusion.h"
#include "base/cs_velocity_pressure.h"
#include "base/cs_wall_distance.h"
#include "base/cs_vof.h"
#include "base/cs_mobile_structures.h"
#include "base/cs_parameters_check.h"
Include dependency graph for cs_parameters_check.cpp:

Functions

void cs_parameters_error (cs_parameter_error_behavior_t err_behavior, const char *section_desc, const char *format,...)
 Print general parameters error or warning info.
void cs_parameters_error_header (cs_parameter_error_behavior_t err_behavior, const char *section_desc)
 Print header for a given parameters error message type.
void cs_parameters_error_footer (cs_parameter_error_behavior_t err_behavior)
 Print footer for a given parameters error message type.
void cs_parameters_is_in_range_int (cs_parameter_error_behavior_t err_behavior, const char *section_desc, const char *param_name, int param_value, int range_l, int range_u)
 Check that a given integer keyword has values in a specified range.
void cs_parameters_is_not_in_range_int (cs_parameter_error_behavior_t err_behavior, const char *section_desc, const char *param_name, int param_value, int range_l, int range_u)
 Check that a given integer keyword has not values in a specified range.
void cs_parameters_is_in_list_int (cs_parameter_error_behavior_t err_behavior, const char *section_desc, const char *param_name, int param_value, int enum_size, const int *enum_values, const char *enum_names[])
 Check that a given integer keyword has values in a specified list.
void cs_parameters_is_not_in_list_int (cs_parameter_error_behavior_t err_behavior, const char *section_desc, const char *param_name, int param_value, int enum_size, const int *enum_values, const char *enum_names[])
 Check that a given integer keyword does not have values in a specified list.
void cs_parameters_is_equal_int (cs_parameter_error_behavior_t err_behavior, const char *section_desc, const char *param_name, int param_value, int std_value)
 Check that a given integer keyword is equal to a specified value.
void cs_parameters_is_not_equal_int (cs_parameter_error_behavior_t err_behavior, const char *section_desc, const char *param_name, int param_value, int fbd_value)
 Check that a given integer keyword is not equal to a specified value.
void cs_parameters_is_positive_int (cs_parameter_error_behavior_t err_behavior, const char *section_desc, const char *param_name, int param_value)
 Check that a given integer keyword is strictly positive.
void cs_parameters_is_greater_int (cs_parameter_error_behavior_t err_behavior, const char *section_desc, const char *param_name, int param_value, int ib_value)
 Check that a given int keyword is greater than a specified value.
void cs_parameters_is_in_range_double (cs_parameter_error_behavior_t err_behavior, const char *section_desc, const char *param_name, double param_value, double range_l, double range_u)
 Check that a given double keyword has values in a specified range.
void cs_parameters_is_in_list_double (cs_parameter_error_behavior_t err_behavior, const char *section_desc, const char *param_name, double param_value, int enum_size, const double *enum_values, const char *enum_names[])
 Check that a given double keyword has values in a specified list.
void cs_parameters_is_equal_double (cs_parameter_error_behavior_t err_behavior, const char *section_desc, const char *param_name, double param_value, double std_value)
 Check that a given double keyword is equal to a specified value.
void cs_parameters_is_greater_double (cs_parameter_error_behavior_t err_behavior, const char *section_desc, const char *param_name, double param_value, double ib_value)
 Check that a given double keyword is greater than a specified value.
void cs_parameters_error_barrier (void)
 Abort if the the parameter errors count is nonzero.
void cs_parameters_check (void)
 Check computation parameters after user modification.

Detailed Description

Parameters and options management check.

Function Documentation

◆ cs_parameters_check()

void cs_parameters_check ( void )

Check computation parameters after user modification.

◆ cs_parameters_error()

void cs_parameters_error ( cs_parameter_error_behavior_t err_behavior,
const char * section_desc,
const char * format,
... )

Print general parameters error or warning info.

Parameters
[in]err_behaviorwarn or abort ?
[in]section_descoptional description of code section containing this parameter, or nullptr
[in]formatformat string, as printf() and family.
[in]...variable arguments based on format string.

◆ cs_parameters_error_barrier()

void cs_parameters_error_barrier ( void )

Abort if the the parameter errors count is nonzero.

◆ cs_parameters_error_footer()

void cs_parameters_error_footer ( cs_parameter_error_behavior_t err_behavior)

Print footer for a given parameters error message type.

Parameters
[in]err_behaviorwarn or abort ?

◆ cs_parameters_error_header()

void cs_parameters_error_header ( cs_parameter_error_behavior_t err_behavior,
const char * section_desc )

Print header for a given parameters error message type.

Parameters
[in]err_behaviorwarn or abort ?
[in]section_descoptional description of code section containing this parameter, or nullptr

◆ cs_parameters_is_equal_double()

void cs_parameters_is_equal_double ( cs_parameter_error_behavior_t err_behavior,
const char * section_desc,
const char * param_name,
double param_value,
double std_value )

Check that a given double keyword is equal to a specified value.

Parameters
[in]err_behaviorwarn or abort ?
[in]section_descoptional description of code section containing this parameter, or nullptr
[in]param_namename of parameter whose value we are checking
[in]param_valueparameter's current_value
[in]std_valuecompulsory or recommended parameter's value

◆ cs_parameters_is_equal_int()

void cs_parameters_is_equal_int ( cs_parameter_error_behavior_t err_behavior,
const char * section_desc,
const char * param_name,
int param_value,
int std_value )

Check that a given integer keyword is equal to a specified value.

Parameters
[in]err_behaviorwarn or abort ?
[in]section_descoptional description of code section containing this parameter, or nullptr
[in]param_namename of parameter whose value we are checking
[in]param_valueparameter's current_value
[in]std_valuecompulsory or recommended parameter's value

◆ cs_parameters_is_greater_double()

void cs_parameters_is_greater_double ( cs_parameter_error_behavior_t err_behavior,
const char * section_desc,
const char * param_name,
double param_value,
double ib_value )

Check that a given double keyword is greater than a specified value.

Parameters
[in]err_behaviorwarn or abort ?
[in]section_descoptional description of code section containing this parameter, or nullptr
[in]param_namename of parameter whose value we are checking
[in]param_valueparameter's current_value
[in]ib_valueinferior bound value

◆ cs_parameters_is_greater_int()

void cs_parameters_is_greater_int ( cs_parameter_error_behavior_t err_behavior,
const char * section_desc,
const char * param_name,
int param_value,
int ib_value )

Check that a given int keyword is greater than a specified value.

Parameters
[in]err_behaviorwarn or abort ?
[in]section_descoptional description of code section containing this parameter, or nullptr
[in]param_namename of parameter whose value we are checking
[in]param_valueparameter's current_value
[in]ib_valueinferior bound value

◆ cs_parameters_is_in_list_double()

void cs_parameters_is_in_list_double ( cs_parameter_error_behavior_t err_behavior,
const char * section_desc,
const char * param_name,
double param_value,
int enum_size,
const double * enum_values,
const char * enum_names[] )

Check that a given double keyword has values in a specified list.

Parameters
[in]err_behaviorwarn or abort ?
[in]section_descoptional description of code section containing this parameter, or nullptr
[in]param_namename of parameter whose value we are checking
[in]param_valueparameter's current_value
[in]enum_sizesize of possible enumeration
[in]enum_valueslist of enumerated values
[in]enum_namesoptional list of value names, or nullptr

◆ cs_parameters_is_in_list_int()

void cs_parameters_is_in_list_int ( cs_parameter_error_behavior_t err_behavior,
const char * section_desc,
const char * param_name,
int param_value,
int enum_size,
const int * enum_values,
const char * enum_names[] )

Check that a given integer keyword has values in a specified list.

Check that a given integer keyword has values in a specified range.

Parameters
[in]err_behaviorwarn or abort ?
[in]section_descoptional description of code section containing this parameter, or nullptr
[in]param_namename of parameter whose value we are checking
[in]param_valueparameter's current_value
[in]enum_sizesize of possible enumeration
[in]enum_valuesoptional list of enumerated values, or nullptr (in which case {0, ... enum_sizes-1} assumed
[in]enum_namesoptional list of value names, or nullptr

◆ cs_parameters_is_in_range_double()

void cs_parameters_is_in_range_double ( cs_parameter_error_behavior_t err_behavior,
const char * section_desc,
const char * param_name,
double param_value,
double range_l,
double range_u )

Check that a given double keyword has values in a specified range.

Parameters
[in]err_behaviorwarn or abort ?
[in]section_descoptional description of code section containing this parameter, or nullptr
[in]param_namename of parameter whose value we are checking
[in]param_valueparameter's current_value
[in]range_lrange lower bound (included)
[in]range_urange upper bound (included)

◆ cs_parameters_is_in_range_int()

void cs_parameters_is_in_range_int ( cs_parameter_error_behavior_t err_behavior,
const char * section_desc,
const char * param_name,
int param_value,
int range_l,
int range_u )

Check that a given integer keyword has values in a specified range.

Parameters
[in]err_behaviorwarn or abort ?
[in]section_descoptional description of code section containing this parameter, or nullptr
[in]param_namename of parameter whose value we are checking
[in]param_valueparameter's current_value
[in]range_lrange lower bound (included)
[in]range_urange upper bound (excluded)

◆ cs_parameters_is_not_equal_int()

void cs_parameters_is_not_equal_int ( cs_parameter_error_behavior_t err_behavior,
const char * section_desc,
const char * param_name,
int param_value,
int fbd_value )

Check that a given integer keyword is not equal to a specified value.

Parameters
[in]err_behaviorwarn or abort ?
[in]section_descoptional description of code section containing this parameter, or nullptr
[in]param_namename of parameter whose value we are checking
[in]param_valueparameter's current_value
[in]fbd_valueforbidden value

◆ cs_parameters_is_not_in_list_int()

void cs_parameters_is_not_in_list_int ( cs_parameter_error_behavior_t err_behavior,
const char * section_desc,
const char * param_name,
int param_value,
int enum_size,
const int * enum_values,
const char * enum_names[] )

Check that a given integer keyword does not have values in a specified list.

Parameters
[in]err_behaviorwarn or abort ?
[in]section_descoptional description of code section containing this parameter, or nullptr
[in]param_namename of parameter whose value we are checking
[in]param_valueparameter's current_value
[in]enum_sizesize of possible enumeration
[in]enum_valuesoptional list of enumerated values, or nullptr (in which case {0, ... enum_sizes-1} assumed
[in]enum_namesoptional list of value names, or nullptr

◆ cs_parameters_is_not_in_range_int()

void cs_parameters_is_not_in_range_int ( cs_parameter_error_behavior_t err_behavior,
const char * section_desc,
const char * param_name,
int param_value,
int range_l,
int range_u )

Check that a given integer keyword has not values in a specified range.

Parameters
[in]err_behaviorwarn or abort ?
[in]section_descoptional description of code section containing this parameter, or nullptr
[in]param_namename of parameter whose value we are checking
[in]param_valueparameter's current_value
[in]range_lrange lower bound (included)
[in]range_urange upper bound (excluded)

◆ cs_parameters_is_positive_int()

void cs_parameters_is_positive_int ( cs_parameter_error_behavior_t err_behavior,
const char * section_desc,
const char * param_name,
int param_value )

Check that a given integer keyword is strictly positive.

Parameters
[in]err_behaviorwarn or abort ?
[in]section_descoptional description of code section containing this parameter, or nullptr
[in]param_namename of parameter whose value we are checking
[in]param_valueparameter's current_value