programmer's documentation
Functions | Variables
cs_equation_param.c File Reference
#include "cs_defs.h"
#include <assert.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <bft_error.h>
#include <bft_mem.h>
#include "cs_boundary_zone.h"
#include "cs_cdo_bc.h"
#include "cs_log.h"
#include "cs_mesh_location.h"
#include "cs_multigrid.h"
#include "cs_source_term.h"
#include "cs_volume_zone.h"
#include "cs_equation_param.h"
Include dependency graph for cs_equation_param.c:

Functions

static int _get_vzone_id (const char *z_name)
 Retrieve the volume zone if from the zone name (If name = NULL or has an empty length, all entities are selected) More...
 
static int _get_bzone_id (const char *z_name)
 Retrieve the boundary zone if from the zone name (If name = NULL or has an empty length, all entities are selected) More...
 
cs_equation_param_tcs_equation_create_param (cs_equation_type_t type, int dim, cs_param_bc_type_t default_bc)
 Create a cs_equation_param_t. More...
 
cs_equation_param_tcs_equation_free_param (cs_equation_param_t *eqp)
 Free a cs_equation_param_t. More...
 
void cs_equation_set_param (cs_equation_param_t *eqp, cs_equation_key_t key, const char *keyval)
 Set a parameter attached to a keyname in a cs_equation_param_t structure. More...
 
void cs_equation_param_set_sles (const char *eqname, cs_equation_param_t *eqp, int field_id)
 Set parameters for initializing SLES structures used for the resolution of the linear system. Settings are related to this equation. More...
 
void cs_equation_summary_param (const char *eqname, const cs_equation_param_t *eqp)
 Summary of a cs_equation_param_t structure. More...
 
void cs_equation_add_ic_by_value (cs_equation_param_t *eqp, const char *z_name, cs_real_t *val)
 Define the initial condition for the unknown related to this equation This definition can be done on a specified mesh location. By default, the unknown is set to zero everywhere. Here a constant value is set to all the entities belonging to the given mesh location. More...
 
void cs_equation_add_ic_by_qov (cs_equation_param_t *eqp, const char *z_name, double quantity)
 Define the initial condition for the unknown related to this equation This definition can be done on a specified mesh location. By default, the unknown is set to zero everywhere. Here the value related to all the entities belonging to the given mesh location is such that the integral over these cells returns the requested quantity. More...
 
void cs_equation_add_ic_by_analytic (cs_equation_param_t *eqp, const char *z_name, cs_analytic_func_t *analytic, void *input)
 Define the initial condition for the unknown related to this equation. This definition can be done on a specified mesh location. By default, the unknown is set to zero everywhere. Here the initial value is set according to an analytical function. More...
 
void cs_equation_add_bc_by_value (cs_equation_param_t *eqp, const cs_param_bc_type_t bc_type, const char *z_name, cs_real_t *values)
 Define and initialize a new structure to set a boundary condition related to the given equation structure z_name corresponds to the name of a pre-existing cs_zone_t. More...
 
void cs_equation_add_bc_by_array (cs_equation_param_t *eqp, const cs_param_bc_type_t bc_type, const char *z_name, cs_flag_t loc, cs_real_t *array, cs_lnum_t *index)
 Define and initialize a new structure to set a boundary condition related to the given equation structure z_name corresponds to the name of a pre-existing cs_zone_t. More...
 
void cs_equation_add_bc_by_analytic (cs_equation_param_t *eqp, const cs_param_bc_type_t bc_type, const char *z_name, cs_analytic_func_t *analytic, void *input)
 Define and initialize a new structure to set a boundary condition related to the given equation param structure ml_name corresponds to the name of a pre-existing cs_mesh_location_t. More...
 
void cs_equation_add_diffusion (cs_equation_param_t *eqp, cs_property_t *property)
 Define and initialize a new structure to store parameters related to a diffusion term. More...
 
void cs_equation_add_time (cs_equation_param_t *eqp, cs_property_t *property)
 Define and initialize a new structure to store parameters related to an unsteady term. More...
 
void cs_equation_add_advection (cs_equation_param_t *eqp, cs_adv_field_t *adv_field)
 Define and initialize a new structure to store parameters related to an advection term. More...
 
int cs_equation_add_reaction (cs_equation_param_t *eqp, cs_property_t *property)
 Define and initialize a new structure to store parameters related to a reaction term. More...
 
cs_xdef_tcs_equation_add_source_term_by_val (cs_equation_param_t *eqp, const char *z_name, cs_real_t *val)
 Define a new source term structure and initialize it by value. More...
 
cs_xdef_tcs_equation_add_source_term_by_analytic (cs_equation_param_t *eqp, const char *z_name, cs_analytic_func_t *ana, void *input)
 Define a new source term structure and initialize it by an analytical function. More...
 
cs_xdef_tcs_equation_add_source_term_by_array (cs_equation_param_t *eqp, const char *z_name, cs_flag_t loc, cs_real_t *array, cs_lnum_t *index)
 Define a new source term defined by an array. More...
 

Variables

static cs_param_itsol_t _itsol_info_by_default
 
static const char _err_empty_eqp []
 

Function Documentation

◆ _get_bzone_id()

static int _get_bzone_id ( const char *  z_name)
inlinestatic

Retrieve the boundary zone if from the zone name (If name = NULL or has an empty length, all entities are selected)

Parameters
[in]z_namename of the zone
Returns
the id of the related zone

◆ _get_vzone_id()

static int _get_vzone_id ( const char *  z_name)
inlinestatic

Retrieve the volume zone if from the zone name (If name = NULL or has an empty length, all entities are selected)

Parameters
[in]z_namename of the zone
Returns
the id of the related zone

◆ cs_equation_add_advection()

void cs_equation_add_advection ( cs_equation_param_t eqp,
cs_adv_field_t adv_field 
)

Define and initialize a new structure to store parameters related to an advection term.

Parameters
[in,out]eqppointer to a cs_equation_param_t structure
[in]adv_fieldpointer to a cs_adv_field_t structure

◆ cs_equation_add_bc_by_analytic()

void cs_equation_add_bc_by_analytic ( cs_equation_param_t eqp,
const cs_param_bc_type_t  bc_type,
const char *  z_name,
cs_analytic_func_t analytic,
void *  input 
)

Define and initialize a new structure to set a boundary condition related to the given equation param structure ml_name corresponds to the name of a pre-existing cs_mesh_location_t.

Parameters
[in,out]eqppointer to a cs_equation_param_t structure
[in]bc_typetype of boundary condition to add
[in]z_namename of the associated zone (if NULL or "" if all cells are considered)
[in]analyticpointer to an analytic function defining the value
[in]inputNULL or pointer to a structure cast on-the-fly

◆ cs_equation_add_bc_by_array()

void cs_equation_add_bc_by_array ( cs_equation_param_t eqp,
const cs_param_bc_type_t  bc_type,
const char *  z_name,
cs_flag_t  loc,
cs_real_t array,
cs_lnum_t index 
)

Define and initialize a new structure to set a boundary condition related to the given equation structure z_name corresponds to the name of a pre-existing cs_zone_t.

Parameters
[in,out]eqppointer to a cs_equation_param_t structure
[in]bc_typetype of boundary condition to add
[in]z_namename of the related boundary zone
[in]locinformation to know where are located values
[in]arraypointer to an array
[in]indexoptional pointer to the array index

◆ cs_equation_add_bc_by_value()

void cs_equation_add_bc_by_value ( cs_equation_param_t eqp,
const cs_param_bc_type_t  bc_type,
const char *  z_name,
cs_real_t values 
)

Define and initialize a new structure to set a boundary condition related to the given equation structure z_name corresponds to the name of a pre-existing cs_zone_t.

Parameters
[in,out]eqppointer to a cs_equation_param_t structure
[in]bc_typetype of boundary condition to add
[in]z_namename of the related boundary zone
[in]valuespointer to a array storing the values

◆ cs_equation_add_diffusion()

void cs_equation_add_diffusion ( cs_equation_param_t eqp,
cs_property_t property 
)

Define and initialize a new structure to store parameters related to a diffusion term.

Parameters
[in,out]eqppointer to a cs_equation_param_t structure
[in]propertypointer to a cs_property_t structure

◆ cs_equation_add_ic_by_analytic()

void cs_equation_add_ic_by_analytic ( cs_equation_param_t eqp,
const char *  z_name,
cs_analytic_func_t analytic,
void *  input 
)

Define the initial condition for the unknown related to this equation. This definition can be done on a specified mesh location. By default, the unknown is set to zero everywhere. Here the initial value is set according to an analytical function.

Parameters
[in,out]eqppointer to a cs_equation_param_t structure
[in]z_namename of the associated zone (if NULL or "" if all cells are considered)
[in]analyticpointer to an analytic function
[in]inputNULL or pointer to a structure cast on-the-fly

◆ cs_equation_add_ic_by_qov()

void cs_equation_add_ic_by_qov ( cs_equation_param_t eqp,
const char *  z_name,
double  quantity 
)

Define the initial condition for the unknown related to this equation This definition can be done on a specified mesh location. By default, the unknown is set to zero everywhere. Here the value related to all the entities belonging to the given mesh location is such that the integral over these cells returns the requested quantity.

Parameters
[in,out]eqppointer to a cs_equation_param_t structure
[in]z_namename of the associated zone (if NULL or "" all cells are considered)
[in]quantityquantity to distribute over the mesh location

◆ cs_equation_add_ic_by_value()

void cs_equation_add_ic_by_value ( cs_equation_param_t eqp,
const char *  z_name,
cs_real_t val 
)

Define the initial condition for the unknown related to this equation This definition can be done on a specified mesh location. By default, the unknown is set to zero everywhere. Here a constant value is set to all the entities belonging to the given mesh location.

Parameters
[in,out]eqppointer to a cs_equation_param_t structure
[in]z_namename of the associated zone (if NULL or "" all cells are considered)
[in]valpointer to the value

◆ cs_equation_add_reaction()

int cs_equation_add_reaction ( cs_equation_param_t eqp,
cs_property_t property 
)

Define and initialize a new structure to store parameters related to a reaction term.

Parameters
[in,out]eqppointer to a cs_equation_param_t structure
[in]propertypointer to a cs_property_t structure
Returns
the id related to the reaction term

◆ cs_equation_add_source_term_by_analytic()

cs_xdef_t* cs_equation_add_source_term_by_analytic ( cs_equation_param_t eqp,
const char *  z_name,
cs_analytic_func_t ana,
void *  input 
)

Define a new source term structure and initialize it by an analytical function.

Parameters
[in,out]eqppointer to a cs_equation_param_t structure
[in]z_namename of the associated zone (if NULL or "" if all cells are considered)
[in]anapointer to an analytical function
[in]inputNULL or pointer to a structure cast on-the-fly
Returns
a pointer to the new cs_source_term_t structure

◆ cs_equation_add_source_term_by_array()

cs_xdef_t* cs_equation_add_source_term_by_array ( cs_equation_param_t eqp,
const char *  z_name,
cs_flag_t  loc,
cs_real_t array,
cs_lnum_t index 
)

Define a new source term defined by an array.

Parameters
[in,out]eqppointer to a cs_equation_param_t structure
[in]z_namename of the associated zone (if NULL or "" if all cells are considered)
[in]locinformation to know where are located values
[in]arraypointer to an array
[in]indexoptional pointer to the array index
Returns
a pointer to the new cs_source_term_t structure

◆ cs_equation_add_source_term_by_val()

cs_xdef_t* cs_equation_add_source_term_by_val ( cs_equation_param_t eqp,
const char *  z_name,
cs_real_t val 
)

Define a new source term structure and initialize it by value.

Parameters
[in,out]eqppointer to a cs_equation_param_t structure
[in]z_namename of the associated zone (if NULL or "" all cells are considered)
[in]valpointer to the value
Returns
a pointer to the new cs_xdef_t structure

◆ cs_equation_add_time()

void cs_equation_add_time ( cs_equation_param_t eqp,
cs_property_t property 
)

Define and initialize a new structure to store parameters related to an unsteady term.

Parameters
[in,out]eqppointer to a cs_equation_param_t structure
[in]propertypointer to a cs_property_t structure

◆ cs_equation_create_param()

cs_equation_param_t* cs_equation_create_param ( cs_equation_type_t  type,
int  dim,
cs_param_bc_type_t  default_bc 
)

Create a cs_equation_param_t.

Parameters
[in]typetype of equation
[in]dimdim of the variable associated to this equation
[in]default_bctype of boundary condition set by default
Returns
a pointer to a new allocated cs_equation_param_t structure

◆ cs_equation_free_param()

cs_equation_param_t* cs_equation_free_param ( cs_equation_param_t eqp)

Free a cs_equation_param_t.

Parameters
[in,out]eqppointer to a cs_equation_param_t
Returns
a NULL pointer

◆ cs_equation_param_set_sles()

void cs_equation_param_set_sles ( const char *  eqname,
cs_equation_param_t eqp,
int  field_id 
)

Set parameters for initializing SLES structures used for the resolution of the linear system. Settings are related to this equation.

Parameters
[in]eqnamepointer to an cs_equation_t structure
[in]eqppointer to a cs_equation_param_t struct.
[in]field_idid of the cs_field_t struct. for this equation

◆ cs_equation_set_param()

void cs_equation_set_param ( cs_equation_param_t eqp,
cs_equation_key_t  key,
const char *  keyval 
)

Set a parameter attached to a keyname in a cs_equation_param_t structure.

Parameters
[in,out]eqppointer to a cs_equation_param_t structure
[in]keykey related to the member of eq to set
[in]keyvalaccessor to the value to set

◆ cs_equation_summary_param()

void cs_equation_summary_param ( const char *  eqname,
const cs_equation_param_t eqp 
)

Summary of a cs_equation_param_t structure.

Parameters
[in]eqnamename of the related equation
[in]eqppointer to a cs_equation_param_t structure

Variable Documentation

◆ _err_empty_eqp

const char _err_empty_eqp[]
static
Initial value:
=
N_(" Stop setting an empty cs_equation_param_t structure.\n"
" Please check your settings.\n")
#define N_(String)
Definition: cs_defs.h:56

◆ _itsol_info_by_default

cs_param_itsol_t _itsol_info_by_default
static
Initial value:
= {
2500,
1e-12,
false
}
Definition: cs_param.h:335
Definition: cs_param.h:357