programmer's documentation
Functions
cs_parameters.c File Reference
#include "cs_defs.h"
#include <assert.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include "bft_mem.h"
#include "bft_error.h"
#include "bft_printf.h"
#include "cs_field.h"
#include "cs_log.h"
#include "cs_map.h"
#include "cs_parall.h"
#include "cs_restart.h"
#include "cs_restart_default.h"
#include "cs_mesh_location.h"
#include "cs_parameters.h"
Include dependency graph for cs_parameters.c:

Functions

cs_piso_tcs_get_glob_piso (void)
 Provide acces to cs_glob_piso. More...
 
void cs_parameters_define_field_keys (void)
 Define general field keys. More...
 
void cs_parameters_define_field_key_gas_mix (void)
 Define field key for condensation. More...
 
void cs_parameters_read_restart_info (void)
 Read general restart info. More...
 
void cs_parameters_add_variable (const char *name, int dim)
 Define a user variable. More...
 
void cs_parameters_add_variable_variance (const char *name, const char *variable_name)
 Define a user variable which is a variance of another variable. More...
 
void cs_parameters_add_property (const char *name, int dim, int location_id)
 Define a user property. More...
 
int cs_parameters_n_added_variables (void)
 Return the number of defined user variables not added yet. More...
 
int cs_parameters_n_added_properties (void)
 Return the number of defined user properties not added yet. More...
 
void cs_parameters_create_added_variables (void)
 Create previously added user variables. More...
 
void cs_parameters_create_added_properties (void)
 Create previously added user properties. More...
 
cs_field_tcs_parameters_add_boundary_values (cs_field_t *f)
 Define a boundary values field for a variable field. More...
 
cs_field_tcs_parameters_add_boundary_temperature (void)
 Define a boundary values field for temperature, if applicable. More...
 
cs_var_cal_opt_t cs_parameters_var_cal_opt_default (void)
 Return a local variable calculation options structure, with default options. More...
 
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. More...
 
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. More...
 
void cs_parameters_error_footer (cs_parameter_error_behavior_t err_behavior)
 Print footer for a given parameters error message type. More...
 
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. More...
 
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 range. More...
 
void cs_parameters_error_barrier (void)
 Abort if the the parameter errors count is nonzero. More...
 

Detailed Description

General parameters and options management.

Function Documentation

◆ cs_get_glob_piso()

cs_piso_t* cs_get_glob_piso ( void  )

Provide acces to cs_glob_piso.

needed to initialize structure with GUI

Returns
piso information structure

◆ cs_parameters_add_boundary_temperature()

cs_field_t* cs_parameters_add_boundary_temperature ( void  )

Define a boundary values field for temperature, if applicable.

Returns
pointer to boundary values field, or NULL if not applicable

◆ cs_parameters_add_boundary_values()

cs_field_t* cs_parameters_add_boundary_values ( cs_field_t f)

Define a boundary values field for a variable field.

Parameters
[in,out]fpointer to field structure
Returns
pointer to boundary values field, or NULL if not applicable

◆ cs_parameters_add_property()

void cs_parameters_add_property ( const char *  name,
int  dim,
int  location_id 
)

Define a user property.

Parameters
[in]namename of property and associated field
[in]dimproperty dimension
[in]location_idid of associated mesh location

◆ cs_parameters_add_variable()

void cs_parameters_add_variable ( const char *  name,
int  dim 
)

Define a user variable.

Solved variables are always defined on cells.

Solved variables are always defined on cells.

Parameters
[in]namename of variable and associated field
[in]dimvariable dimension

◆ cs_parameters_add_variable_variance()

void cs_parameters_add_variable_variance ( const char *  name,
const char *  variable_name 
)

Define a user variable which is a variance of another variable.

Only variances of thermal or user-defined variables are currently handled.

Parameters
[in]namename of variance and associated field
[in]variable_namename of associated variable

◆ cs_parameters_create_added_properties()

void cs_parameters_create_added_properties ( void  )

Create previously added user properties.

◆ cs_parameters_create_added_variables()

void cs_parameters_create_added_variables ( void  )

Create previously added user variables.

◆ cs_parameters_define_field_key_gas_mix()

void cs_parameters_define_field_key_gas_mix ( void  )

Define field key for condensation.

Note: this should be moved in the future to a condensation-specific file.

◆ cs_parameters_define_field_keys()

void cs_parameters_define_field_keys ( void  )

Define general field keys.

A recommened practice for different submodules would be to use "cs_<module>_key_init() functions to define keys specific to those modules.

◆ 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 NULL
[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 NULL

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

Parameters
[in]err_behaviorwarn or abort ?
[in]section_descoptional description of code section containing this parameter, or NULL
[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 NULL (in which case {0, ... enum_sizes-1} assumed
[in]enum_namesoptional list of value names, or NULL

◆ 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 NULL
[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_n_added_properties()

int cs_parameters_n_added_properties ( void  )

Return the number of defined user properties not added yet.

Returns
number of defined user properties

◆ cs_parameters_n_added_variables()

int cs_parameters_n_added_variables ( void  )

Return the number of defined user variables not added yet.

This number is reset to 0 when cs_parameters_create_added_variables is called.

Returns
number of defined user variables

◆ cs_parameters_read_restart_info()

void cs_parameters_read_restart_info ( void  )

Read general restart info.

This updates the previous time step info.

◆ cs_parameters_var_cal_opt_default()

cs_var_cal_opt_t cs_parameters_var_cal_opt_default ( void  )

Return a local variable calculation options structure, with default options.

Returns
variable calculations options structure