9.0
general documentation
Loading...
Searching...
No Matches
cs_equation_param.cpp File Reference

Structure and functions handling the specific settings related to a cs_equation_t structure. More...

#include "base/cs_defs.h"
#include <assert.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include "bft/bft_error.h"
#include "bft/bft_mem.h"
#include "bft/bft_printf.h"
#include "alge/cs_saddle_solver_setup.h"
#include "alge/cs_param_sles_setup.h"
#include "base/cs_boundary_zone.h"
#include "base/cs_log.h"
#include "base/cs_volume_zone.h"
#include "cdo/cs_cdo_advection.h"
#include "cdo/cs_cdo_bc.h"
#include "cdo/cs_cdocb_priv.h"
#include "cdo/cs_hodge.h"
#include "cdo/cs_source_term.h"
#include "mesh/cs_mesh_location.h"
#include "cdo/cs_equation_param.h"
Include dependency graph for cs_equation_param.cpp:

Functions

static int _find_or_add_ic (cs_equation_param_t *eqp, int z_id)
 Find an existing "initial condition" definition related to the given zone id or add a new one.
static void _set_key (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.
cs_equation_param_tcs_equation_param_create (const char *name, cs_equation_type_t type, int dim, cs_param_bc_type_t default_bc)
 Create a cs_equation_param_t structure with the given parameters. The remaining parameters are set with default values;.
void cs_equation_param_copy_from (const cs_equation_param_t *ref, cs_equation_param_t *dst, bool copy_fld_id)
 Copy the settings from one cs_equation_param_t structure to another one. The name is not copied.
void cs_equation_param_copy_bc (const cs_equation_param_t *ref, cs_equation_param_t *dst)
 Copy only the part dedicated to the boundary conditions and the DoF (degrees of freedom) enforcement from one cs_equation_param_t structure to another one.
void cs_equation_param_clear (cs_equation_param_t *eqp)
 Free the contents of a cs_equation_param_t.
cs_equation_param_tcs_equation_param_free (cs_equation_param_t *eqp)
 Free a cs_equation_param_t.
void cs_equation_param_set (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.
cs_param_sles_tcs_equation_param_get_sles_param (cs_equation_param_t *eqp)
 Get the pointer to the set of parameters to handle the SLES solver associated to this set of equation parameters.
cs_param_saddle_tcs_equation_param_get_saddle_param (cs_equation_param_t *eqp)
 Get the pointer to the set of parameters to handle a saddle-point solver This is only useful if some cases (the momemtum equation when a monolithic coupling is considered or the solution of a scalar-valued CDO cell-based schemes)
void cs_equation_param_set_sles (cs_equation_param_t *eqp)
 Set parameters for initializing SLES structures used for the resolution of the linear system. Settings are related to this equation.
void cs_equation_param_set_quadrature_to_all (cs_equation_param_t *eqp, cs_quadrature_type_t qtype)
 Apply the given quadrature rule to all existing definitions under the cs_equation_param_t structure.
void cs_equation_param_lock_settings (cs_equation_param_t *eqp)
 Lock settings to prevent from unwanted modifications.
void cs_equation_param_unlock_settings (cs_equation_param_t *eqp)
 Unlock settings. Be sure that is really wanted (inconsistency between the setup logging and what is used may appear)
void cs_equation_param_ensure_consistent_settings (cs_equation_param_t *eqp)
 At this stage, the numerical settings should not be modified anymore by the user. One makes a last set of modifications if needed to ensure a consistent numerical settings.
void cs_equation_param_log (const cs_equation_param_t *eqp)
 Print the detail of a cs_equation_param_t structure.
bool cs_equation_param_has_robin_bc (const cs_equation_param_t *eqp)
 Ask if the parameter settings of the equation has requested the treatment of Robin boundary conditions.
cs_xdef_tcs_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 applies to a volume zone. By default, the unknown is set to zero everywhere. Here a constant value is set to all the unknows belonging to the given zone with name z_name If a definition already exists for the given zone name, then the previous definition is replaced.
cs_xdef_tcs_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 applies to a volume zone. By default, the unknown is set to zero everywhere. Here the value set to each unknown belonging to the given zone with name z_name is such that the integral over the cells of the zone returns the requested quantity If a definition already exists for the given zone name, then the previous definition is replaced.
cs_xdef_tcs_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 applies to a volume zone. By default, the unknown is set to zero everywhere. Here the initial value for each unknown associated to the zone with name z_name is set according to an analytical function If a definition already exists for the given zone name, then the previous definition is replaced.
cs_xdef_tcs_equation_add_ic_by_dof_func (cs_equation_param_t *eqp, const char *z_name, cs_flag_t loc_flag, cs_dof_func_t *func, void *input)
 Define the initial condition for the unknown related to this equation. This definition applies to a volume zone. By default, the unknown is set to zero everywhere. Case of a definition by a DoF function. If a definition already exists for the given zone name, then the previous definition is replaced.
void cs_equation_add_xdef_bc (cs_equation_param_t *eqp, cs_xdef_t *xdef)
 Set a boundary condition from an existing cs_xdef_t structure The lifecycle of the cs_xdef_t structure is now managed by the current cs_equation_param_t structure.
cs_xdef_tcs_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.
cs_xdef_tcs_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, bool is_owner, bool full_length)
 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.
cs_xdef_tcs_equation_add_bc_by_field (cs_equation_param_t *eqp, const cs_param_bc_type_t bc_type, const char *z_name, cs_field_t *field)
 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.
cs_xdef_tcs_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.
cs_xdef_tcs_equation_add_bc_by_time_func (cs_equation_param_t *eqp, const cs_param_bc_type_t bc_type, const char *z_name, cs_time_func_t *t_func, 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 Definition relying on a cs_time_func_t function pointer.
cs_xdef_tcs_equation_add_bc_by_dof_func (cs_equation_param_t *eqp, const cs_param_bc_type_t bc_type, const char *z_name, cs_flag_t loc_flag, cs_dof_func_t *func, void *input)
 Define and initialize a new structure to set a boundary condition related to the given cs_equation_param_t structure ml_name corresponds to the name of a pre-existing cs_mesh_location_t.
cs_xdef_tcs_equation_find_bc (cs_equation_param_t *eqp, const char *z_name)
 Return pointer to existing boundary condition definition structure for the given equation param structure and zone.
void cs_equation_remove_bc (cs_equation_param_t *eqp, const char *z_name)
 Remove boundary condition from the given equation param structure for a given zone.
void cs_equation_remove_ic (cs_equation_param_t *eqp, const char *z_name)
 Remove initial condition from the given equation param structure for a given zone.
void cs_equation_add_sliding_condition (cs_equation_param_t *eqp, const char *z_name)
 Define and initialize a new structure to set a sliding boundary condition related to the given equation structure z_name corresponds to the name of a pre-existing cs_zone_t.
void cs_equation_add_diffusion (cs_equation_param_t *eqp, cs_property_t *property)
 Associate a new term related to the Laplacian operator for the equation associated to the given cs_equation_param_t structure Laplacian means div-grad (either for vector-valued or scalar-valued equations)
void cs_equation_add_curlcurl (cs_equation_param_t *eqp, cs_property_t *property, int inversion)
 Associate a new term related to the curl-curl operator for the equation associated to the given cs_equation_param_t structure.
void cs_equation_add_graddiv (cs_equation_param_t *eqp, cs_property_t *property)
 Associate a new term related to the grad-div operator for the equation associated to the given cs_equation_param_t structure.
void cs_equation_add_time (cs_equation_param_t *eqp, cs_property_t *property)
 Associate a new term related to the time derivative operator for the equation associated to the given cs_equation_param_t structure.
void cs_equation_add_advection (cs_equation_param_t *eqp, cs_adv_field_t *adv_field)
 Associate a new term related to the advection operator for the equation associated to the given cs_equation_param_t structure.
void cs_equation_add_advection_scaling_property (cs_equation_param_t *eqp, cs_property_t *property)
 Associate a scaling property to the advection.
int cs_equation_add_reaction (cs_equation_param_t *eqp, cs_property_t *property)
 Associate a new term related to the reaction operator for the equation associated to the given cs_equation_param_t structure.
cs_xdef_tcs_equation_add_source_term_by_val (cs_equation_param_t *eqp, const char *z_name, cs_real_t *val)
 Add a new source term by initializing a cs_xdef_t structure. Case of a definition by a constant value.
cs_xdef_tcs_equation_add_source_term_by_analytic (cs_equation_param_t *eqp, const char *z_name, cs_analytic_func_t *func, void *input)
 Add a new source term by initializing a cs_xdef_t structure. Case of a definition by an analytical function.
cs_xdef_tcs_equation_add_source_term_by_dof_func (cs_equation_param_t *eqp, const char *z_name, cs_flag_t loc_flag, cs_dof_func_t *func, void *input)
 Add a new source term by initializing a cs_xdef_t structure. Case of a definition by a DoF function.
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, bool is_owner, bool full_length)
 Add a new source term by initializing a cs_xdef_t structure. Case of a definition by an array.
cs_xdef_tcs_equation_add_volume_mass_injection_by_value (cs_equation_param_t *eqp, const char *z_name, double *val)
 Add a new volume mass injection definition source term by initializing a cs_xdef_t structure, using a constant value.
cs_xdef_tcs_equation_add_volume_mass_injection_by_qov (cs_equation_param_t *eqp, const char *z_name, double *quantity)
 Add a new volume mass injection definition source term by initializing a cs_xdef_t structure, using a constant quantity distributed over the associated zone's volume.
cs_xdef_tcs_equation_add_volume_mass_injection_by_analytic (cs_equation_param_t *eqp, const char *z_name, cs_analytic_func_t *func, void *input)
 Add a new volume mass injection definition source term by initializing a cs_xdef_t structure, using an analytical function.
cs_xdef_tcs_equation_add_volume_mass_injection_by_dof_func (cs_equation_param_t *eqp, const char *z_name, cs_flag_t loc_flag, cs_dof_func_t *func, void *input)
 Add a new volume mass injection definition source term by initializing a cs_xdef_t structure, using a DoF function.
cs_xdef_tcs_equation_add_volume_mass_injection_by_array (cs_equation_param_t *eqp, const char *z_name, cs_flag_t loc_flag, cs_real_t *array, bool is_owner, bool full_length)
 Add a new volume mass injection definition source term by initializing a cs_xdef_t structure, using an array.
cs_enforcement_param_tcs_equation_add_vertex_dof_enforcement (cs_equation_param_t *eqp, cs_lnum_t n_vertices, const cs_lnum_t vertex_ids[], const cs_real_t ref_value[], const cs_real_t vtx_values[])
 Add an enforcement of the value of degrees of freedom located at the mesh vertices. The spatial discretization scheme for the given equation has to be CDO vertex-based or CDO vertex+cell-based schemes.
cs_enforcement_param_tcs_equation_add_edge_dof_enforcement (cs_equation_param_t *eqp, cs_lnum_t n_edges, const cs_lnum_t edge_ids[], const cs_real_t ref_value[], const cs_real_t edge_values[])
 Add an enforcement of the value of degrees of freedom located at the mesh edges. The spatial discretization scheme for the given equation has to be CDO edge-based schemes.
cs_enforcement_param_tcs_equation_add_face_dof_enforcement (cs_equation_param_t *eqp, cs_lnum_t n_faces, const cs_lnum_t face_ids[], const cs_real_t ref_value[], const cs_real_t face_values[])
 Add an enforcement of the value of degrees of freedom located at the mesh faces. The spatial discretization scheme for the given equation has to be CDO face-based schemes.
cs_enforcement_param_tcs_equation_add_cell_enforcement (cs_equation_param_t *eqp, cs_lnum_t n_cells, const cs_lnum_t cell_ids[], const cs_real_t ref_value[], const cs_real_t cell_values[])
 Add an enforcement of the value related to the degrees of freedom associated to the list of selected cells.
cs_enforcement_param_tcs_equation_add_or_replace_cell_enforcement (cs_equation_param_t *eqp, int enforcement_id, cs_lnum_t n_cells, const cs_lnum_t cell_ids[], const cs_real_t ref_value[], const cs_real_t cell_values[])
 Add a new enforcement if enforcement_id does not exist or replace it otherwise. Enforcement of the value related to the degrees of freedom associated to the list of selected cells.
void cs_equation_time_control_clear (cs_equation_param_t *eqp)
 Clear time_control data from the given equation param.
void cs_equation_time_control_add (cs_equation_param_t *eqp, cs_time_control_t *time_control, bool shallow_copy)
 Add a time control instance to an equation param structure.
void cs_equation_time_control_add_default (cs_equation_param_t *eqp)
 Add a time control instance to an equation param structure based on default values (hard copy).

Variables

static const cs_real_t _weak_pena_bc_coef_by_default = 100.
static const cs_real_t _strong_pena_bc_coef_by_default = 1e12
static const char _err_empty_eqp []

Detailed Description

Structure and functions handling the specific settings related to a cs_equation_t structure.

Function Documentation

◆ _find_or_add_ic()

int _find_or_add_ic ( cs_equation_param_t * eqp,
int z_id )
static

Find an existing "initial condition" definition related to the given zone id or add a new one.

Parameters
[in,out]eqppointer to a cs_equation_param_t structure
[in]z_idid related to a zone
Returns
the definition id

◆ _set_key()

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

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_add_advection()

void cs_equation_add_advection ( cs_equation_param_t * eqp,
cs_adv_field_t * adv_field )

Associate a new term related to the advection operator for the equation associated to the given cs_equation_param_t structure.

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

◆ cs_equation_add_advection_scaling_property()

void cs_equation_add_advection_scaling_property ( cs_equation_param_t * eqp,
cs_property_t * property )

Associate a scaling property to the advection.

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

◆ cs_equation_add_bc_by_analytic()

cs_xdef_t * 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 nullptr or "" if all cells are considered)
[in]analyticpointer to an analytic function defining the value
[in]inputnullptr or pointer to a structure cast on-the-fly
Returns
a pointer to the new cs_xdef_t structure

◆ cs_equation_add_bc_by_array()

cs_xdef_t * 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,
bool is_owner,
bool full_length )

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]is_ownertransfer the lifecycle to the cs_xdef_t struct. (true or false)
[in]full_lengthif true, size of "array" should be allocated to the total numbers of entities related to the given location. If false, a new list is allocated and filled with the related subset indirection.
Returns
a pointer to the new allocated cs_xdef_t structure

◆ cs_equation_add_bc_by_dof_func()

cs_xdef_t * cs_equation_add_bc_by_dof_func ( cs_equation_param_t * eqp,
const cs_param_bc_type_t bc_type,
const char * z_name,
cs_flag_t loc_flag,
cs_dof_func_t * func,
void * input )

Define and initialize a new structure to set a boundary condition related to the given cs_equation_param_t 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 nullptr or "" if all cells are considered)
[in]loc_flaglocation where values are computed
[in]funcpointer to cs_dof_func_t function
[in]inputnullptr or pointer to a structure cast on-the-fly
Returns
a pointer to the new cs_xdef_t structure

◆ cs_equation_add_bc_by_field()

cs_xdef_t * cs_equation_add_bc_by_field ( cs_equation_param_t * eqp,
const cs_param_bc_type_t bc_type,
const char * z_name,
cs_field_t * field )

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]fieldpointer to a cs_field_t structure
Returns
a pointer to the new allocated cs_xdef_t structure

◆ cs_equation_add_bc_by_time_func()

cs_xdef_t * cs_equation_add_bc_by_time_func ( cs_equation_param_t * eqp,
const cs_param_bc_type_t bc_type,
const char * z_name,
cs_time_func_t * t_func,
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 Definition relying on a cs_time_func_t function pointer.

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 nullptr or "" if all cells are considered)
[in]t_funcpointer to an analytic function defining the value
[in]inputnullptr or pointer to a structure cast on-the-fly
Returns
a pointer to the new cs_xdef_t structure

◆ cs_equation_add_bc_by_value()

cs_xdef_t * 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
Returns
a pointer to the new cs_xdef_t structure

◆ cs_equation_add_cell_enforcement()

cs_enforcement_param_t * cs_equation_add_cell_enforcement ( cs_equation_param_t * eqp,
cs_lnum_t n_cells,
const cs_lnum_t cell_ids[],
const cs_real_t ref_value[],
const cs_real_t cell_values[] )

Add an enforcement of the value related to the degrees of freedom associated to the list of selected cells.

One assumes that values are interlaced if eqp->dim > 1 ref_value or elt_values has to be defined. If both parameters are defined, one keeps the definition in elt_values

Parameters
[in,out]eqppointer to a cs_equation_param_t structure
[in]n_cellsnumber of selected cells
[in]cell_idslist of cell ids
[in]ref_valueignored if nullptr
[in]cell_valueslist of associated values, ignored if nullptr
Returns
a pointer to a cs_enforcement_param_t structure

◆ cs_equation_add_curlcurl()

void cs_equation_add_curlcurl ( cs_equation_param_t * eqp,
cs_property_t * property,
int inversion )

Associate a new term related to the curl-curl operator for the equation associated to the given cs_equation_param_t structure.

Parameters
[in,out]eqppointer to a cs_equation_param_t structure
[in]propertypointer to a cs_property_t structure
[in]inversion> 0: true, false otherwise

◆ cs_equation_add_diffusion()

void cs_equation_add_diffusion ( cs_equation_param_t * eqp,
cs_property_t * property )

Associate a new term related to the Laplacian operator for the equation associated to the given cs_equation_param_t structure Laplacian means div-grad (either for vector-valued or scalar-valued equations)

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

◆ cs_equation_add_edge_dof_enforcement()

cs_enforcement_param_t * cs_equation_add_edge_dof_enforcement ( cs_equation_param_t * eqp,
cs_lnum_t n_edges,
const cs_lnum_t edge_ids[],
const cs_real_t ref_value[],
const cs_real_t edge_values[] )

Add an enforcement of the value of degrees of freedom located at the mesh edges. The spatial discretization scheme for the given equation has to be CDO edge-based schemes.

One assumes that values are interlaced if eqp->dim > 1 ref_value or elt_values has to be defined. If both parameters are defined, one keeps the definition in elt_values

Parameters
[in,out]eqppointer to a cs_equation_param_t structure
[in]n_edgesnumber of edges to enforce
[in]edge_idslist of edges
[in]ref_valuedefault values or ignored (may be nullptr)
[in]edge_valueslist of associated values, ignored if nullptr
Returns
a pointer to a cs_enforcement_param_t structure

◆ cs_equation_add_face_dof_enforcement()

cs_enforcement_param_t * cs_equation_add_face_dof_enforcement ( cs_equation_param_t * eqp,
cs_lnum_t n_faces,
const cs_lnum_t face_ids[],
const cs_real_t ref_value[],
const cs_real_t face_values[] )

Add an enforcement of the value of degrees of freedom located at the mesh faces. The spatial discretization scheme for the given equation has to be CDO face-based schemes.

One assumes that values are interlaced if eqp->dim > 1 ref_value or elt_values has to be defined. If both parameters are defined, one keeps the definition in elt_values

Parameters
[in,out]eqppointer to a cs_equation_param_t structure
[in]n_facesnumber of faces to enforce
[in]face_idslist of faces
[in]ref_valuedefault values or ignored (may be nullptr)
[in]face_valueslist of associated values, ignored if nullptr
Returns
a pointer to a cs_enforcement_param_t structure

◆ cs_equation_add_graddiv()

void cs_equation_add_graddiv ( cs_equation_param_t * eqp,
cs_property_t * property )

Associate a new term related to the grad-div operator for the equation associated to the given cs_equation_param_t structure.

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()

cs_xdef_t * 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 applies to a volume zone. By default, the unknown is set to zero everywhere. Here the initial value for each unknown associated to the zone with name z_name is set according to an analytical function If a definition already exists for the given zone name, then the previous definition is replaced.

Define the initial condition for the unknown related to this equation. This definition applies to a volume zone. By default, the unknown is set to zero everywhere. Here the initial value for each unknown associated to the zone with name z_name 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
Returns
a pointer to the new cs_xdef_t structure

◆ cs_equation_add_ic_by_dof_func()

cs_xdef_t * cs_equation_add_ic_by_dof_func ( cs_equation_param_t * eqp,
const char * z_name,
cs_flag_t loc_flag,
cs_dof_func_t * func,
void * input )

Define the initial condition for the unknown related to this equation. This definition applies to a volume zone. By default, the unknown is set to zero everywhere. Case of a definition by a DoF function. If a definition already exists for the given zone name, then the previous definition is replaced.

Define the initial condition for the unknown related to this equation. This definition applies to a volume zone. By default, the unknown is set to zero everywhere. Case of a definition by a DoF function.

Parameters
[in,out]eqppointer to a cs_equation_param_t structure
[in]z_namename of the associated zone (if nullptr or "" if all cells are considered)
[in]loc_flagwhere information is computed
[in]funcpointer to a DoF function
[in]inputnullptr or pointer to a structure cast on-the-fly
Returns
a pointer to the new cs_xdef_t structure

◆ cs_equation_add_ic_by_qov()

cs_xdef_t * 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 applies to a volume zone. By default, the unknown is set to zero everywhere. Here the value set to each unknown belonging to the given zone with name z_name is such that the integral over the cells of the zone returns the requested quantity If a definition already exists for the given zone name, then the previous definition is replaced.

Define the initial condition for the unknown related to this equation. This definition applies to a volume zone. By default, the unknown is set to zero everywhere. Here the value set to each unknown belonging to the given zone with name z_name is such that the integral over the cells of the zone 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
Returns
a pointer to the new cs_xdef_t structure

◆ cs_equation_add_ic_by_value()

cs_xdef_t * 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 applies to a volume zone. By default, the unknown is set to zero everywhere. Here a constant value is set to all the unknows belonging to the given zone with name z_name If a definition already exists for the given zone name, then the previous definition is replaced.

Define the initial condition for the unknown related to this equation. This definition applies to a volume zone. By default, the unknown is set to zero everywhere. Here a constant value is set to all the unknows belonging to the given zone with name z_name.

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_or_replace_cell_enforcement()

cs_enforcement_param_t * cs_equation_add_or_replace_cell_enforcement ( cs_equation_param_t * eqp,
int enforcement_id,
cs_lnum_t n_cells,
const cs_lnum_t cell_ids[],
const cs_real_t ref_value[],
const cs_real_t cell_values[] )

Add a new enforcement if enforcement_id does not exist or replace it otherwise. Enforcement of the value related to the degrees of freedom associated to the list of selected cells.

One assumes that values are interlaced if eqp->dim > 1 ref_value or elt_values has to be defined. If both parameters are defined, one keeps the definition in elt_values

Parameters
[in,out]eqppointer to a cs_equation_param_t structure
[in]enforcement_idid of the enforcement to handle
[in]n_cellsnumber of selected cells
[in]cell_idslist of cell ids
[in]ref_valueignored if nullptr
[in]cell_valueslist of associated values, ignored if nullptr
Returns
a pointer to a cs_enforcement_param_t structure

◆ cs_equation_add_reaction()

int cs_equation_add_reaction ( cs_equation_param_t * eqp,
cs_property_t * property )

Associate a new term related to the reaction operator for the equation associated to the given cs_equation_param_t structure.

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_sliding_condition()

void cs_equation_add_sliding_condition ( cs_equation_param_t * eqp,
const char * z_name )

Define and initialize a new structure to set a sliding 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]z_namename of the related boundary zone

◆ 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 * func,
void * input )

Add a new source term by initializing a cs_xdef_t structure. Case of a definition by an analytical function.

Parameters
[in,out]eqppointer to a cs_equation_param_t structure
[in]z_namename of the associated zone (if nullptr or "" if all cells are considered)
[in]funcpointer to an analytical function
[in]inputnullptr or pointer to a structure cast on-the-fly
Returns
a pointer to the new cs_xdef_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,
bool is_owner,
bool full_length )

Add a new source term by initializing a cs_xdef_t structure. Case of a definition by an array.

Parameters
[in,out]eqppointer to a cs_equation_param_t structure
[in]z_namename of the associated zone (if nullptr or "" if all cells are considered)
[in]locinformation to know where are located values
[in]arraypointer to an array
[in]is_ownertransfer the lifecycle to the cs_xdef_t struct. (true or false)
[in]full_lengthif true, the size of "array" should be allocated to the total numbers of entities related to the given location. If false, a new list is allocated and filled with the related subset indirection.
Returns
a pointer to the new cs_xdef_t structure

◆ cs_equation_add_source_term_by_dof_func()

cs_xdef_t * cs_equation_add_source_term_by_dof_func ( cs_equation_param_t * eqp,
const char * z_name,
cs_flag_t loc_flag,
cs_dof_func_t * func,
void * input )

Add a new source term by initializing a cs_xdef_t structure. Case of a definition by a DoF function.

Parameters
[in,out]eqppointer to a cs_equation_param_t structure
[in]z_namename of the associated zone (if nullptr or "" if all cells are considered)
[in]loc_flaglocation of element ids given as parameter
[in]funcpointer to a DoF function
[in]inputnullptr or pointer to a structure cast on-the-fly
Returns
a pointer to the new cs_xdef_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 )

Add a new source term by initializing a cs_xdef_t structure. Case of a definition by a constant value.

Parameters
[in,out]eqppointer to a cs_equation_param_t structure
[in]z_namename of the associated zone (if nullptr 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 )

Associate a new term related to the time derivative operator for the equation associated to the given cs_equation_param_t structure.

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

◆ cs_equation_add_vertex_dof_enforcement()

cs_enforcement_param_t * cs_equation_add_vertex_dof_enforcement ( cs_equation_param_t * eqp,
cs_lnum_t n_vertices,
const cs_lnum_t vertex_ids[],
const cs_real_t ref_value[],
const cs_real_t vtx_values[] )

Add an enforcement of the value of degrees of freedom located at the mesh vertices. The spatial discretization scheme for the given equation has to be CDO vertex-based or CDO vertex+cell-based schemes.

One assumes that values are interlaced if eqp->dim > 1 ref_value or elt_values has to be defined. If both parameters are defined, one keeps the definition in elt_values

Parameters
[in,out]eqppointer to a cs_equation_param_t structure
[in]n_verticesnumber of vertices to enforce
[in]vertex_idslist of vertices
[in]ref_valuedefault values or ignored (may be nullptr)
[in]vtx_valueslist of associated values, ignored if nullptr
Returns
a pointer to a cs_enforcement_param_t structure

◆ cs_equation_add_volume_mass_injection_by_analytic()

cs_xdef_t * cs_equation_add_volume_mass_injection_by_analytic ( cs_equation_param_t * eqp,
const char * z_name,
cs_analytic_func_t * func,
void * input )

Add a new volume mass injection definition source term by initializing a cs_xdef_t structure, using an analytical function.

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

◆ cs_equation_add_volume_mass_injection_by_array()

cs_xdef_t * cs_equation_add_volume_mass_injection_by_array ( cs_equation_param_t * eqp,
const char * z_name,
cs_flag_t loc_flag,
cs_real_t * array,
bool is_owner,
bool full_length )

Add a new volume mass injection definition source term by initializing a cs_xdef_t structure, using an array.

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]is_ownertransfer the lifecycle to the cs_xdef_t struct. (true or false)
[in]full_lengthif true, size of "array" should be allocated to the total numbers of entities related to the given location. If false, a new list is allocated and filled with the related subset indirection.
Returns
a pointer to the new allocated cs_xdef_t structure

◆ cs_equation_add_volume_mass_injection_by_dof_func()

cs_xdef_t * cs_equation_add_volume_mass_injection_by_dof_func ( cs_equation_param_t * eqp,
const char * z_name,
cs_flag_t loc_flag,
cs_dof_func_t * func,
void * input )

Add a new volume mass injection definition source term by initializing a cs_xdef_t structure, using a DoF function.

Parameters
[in,out]eqppointer to a cs_equation_param_t structure
[in]z_namename of the associated zone (if nullptr or "" if all cells are considered)
[in]loc_flagwhere information is computed
[in]funcpointer to an analytical function
[in]inputnullptr or pointer to a structure cast on-the-fly
Returns
a pointer to the new cs_xdef_t structure

◆ cs_equation_add_volume_mass_injection_by_qov()

cs_xdef_t * cs_equation_add_volume_mass_injection_by_qov ( cs_equation_param_t * eqp,
const char * z_name,
double * quantity )

Add a new volume mass injection definition source term by initializing a cs_xdef_t structure, using a constant quantity distributed over the associated zone's volume.

Parameters
[in,out]eqppointer to a cs_equation_param_t structure
[in]z_namename of the associated zone (if nullptr or "" if all cells are considered)
[in]quantitypointer to quantity to distribute over the zone
Returns
a pointer to the new cs_xdef_t structure

◆ cs_equation_add_volume_mass_injection_by_value()

cs_xdef_t * cs_equation_add_volume_mass_injection_by_value ( cs_equation_param_t * eqp,
const char * z_name,
double * val )

Add a new volume mass injection definition source term by initializing a cs_xdef_t structure, using a constant value.

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

◆ cs_equation_add_xdef_bc()

void cs_equation_add_xdef_bc ( cs_equation_param_t * eqp,
cs_xdef_t * xdef )

Set a boundary condition from an existing cs_xdef_t structure The lifecycle of the cs_xdef_t structure is now managed by the current cs_equation_param_t structure.

Parameters
[in,out]eqppointer to a cs_equation_param_t structure
[in]xdefpointer to the cs_xdef_t structure to transfer

◆ cs_equation_find_bc()

cs_xdef_t * cs_equation_find_bc ( cs_equation_param_t * eqp,
const char * z_name )

Return pointer to existing boundary condition definition structure for the given equation param structure and zone.

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

◆ cs_equation_param_clear()

void cs_equation_param_clear ( cs_equation_param_t * eqp)

Free the contents of a cs_equation_param_t.

The cs_equation_param_t structure itself is not freed, but all its sub-structures are freed.

This is useful for equation parameters which are accessed through field keywords.

Parameters
[in,out]eqppointer to a cs_equation_param_t

◆ cs_equation_param_copy_bc()

void cs_equation_param_copy_bc ( const cs_equation_param_t * ref,
cs_equation_param_t * dst )

Copy only the part dedicated to the boundary conditions and the DoF (degrees of freedom) enforcement from one cs_equation_param_t structure to another one.

Parameters
[in]refpointer to the reference cs_equation_param_t
[in,out]dstpointer to the cs_equation_param_t to update

◆ cs_equation_param_copy_from()

void cs_equation_param_copy_from ( const cs_equation_param_t * ref,
cs_equation_param_t * dst,
bool copy_fld_id )

Copy the settings from one cs_equation_param_t structure to another one. The name is not copied.

Parameters
[in]refpointer to the reference cs_equation_param_t
[in,out]dstpointer to the cs_equation_param_t to update
[in]copy_fld_idcopy also the field id or not

◆ cs_equation_param_create()

cs_equation_param_t * cs_equation_param_create ( const char * name,
cs_equation_type_t type,
int dim,
cs_param_bc_type_t default_bc )

Create a cs_equation_param_t structure with the given parameters. The remaining parameters are set with default values;.

Create a cs_equation_param_t structure.

Parameters
[in]namename of the equation
[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_param_ensure_consistent_settings()

void cs_equation_param_ensure_consistent_settings ( cs_equation_param_t * eqp)

At this stage, the numerical settings should not be modified anymore by the user. One makes a last set of modifications if needed to ensure a consistent numerical settings.

Parameters
[in,out]eqppointer to a cs_equation_param_t structure

◆ cs_equation_param_free()

cs_equation_param_t * cs_equation_param_free ( 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_get_saddle_param()

cs_param_saddle_t * cs_equation_param_get_saddle_param ( cs_equation_param_t * eqp)

Get the pointer to the set of parameters to handle a saddle-point solver This is only useful if some cases (the momemtum equation when a monolithic coupling is considered or the solution of a scalar-valued CDO cell-based schemes)

Get the pointer to the set of parameters to handle the SLES solver associated to this set of equation parameters.

Parameters
[in]eqppointer to a cs_equation_param_t structure
Returns
a pointer to a cs_param_saddle_t structure

◆ cs_equation_param_get_sles_param()

cs_param_sles_t * cs_equation_param_get_sles_param ( cs_equation_param_t * eqp)

Get the pointer to the set of parameters to handle the SLES solver associated to this set of equation parameters.

Parameters
[in]eqppointer to a cs_equation_param_t structure
Returns
a pointer to a cs_param_sles_t structure

◆ cs_equation_param_has_robin_bc()

bool cs_equation_param_has_robin_bc ( const cs_equation_param_t * eqp)

Ask if the parameter settings of the equation has requested the treatment of Robin boundary conditions.

Parameters
[in]eqppointer to a cs_equation_param_t
Returns
true or false

◆ cs_equation_param_lock_settings()

void cs_equation_param_lock_settings ( cs_equation_param_t * eqp)

Lock settings to prevent from unwanted modifications.

Parameters
[in,out]eqppointer to a cs_equation_param_t structure

◆ cs_equation_param_log()

void cs_equation_param_log ( const cs_equation_param_t * eqp)

Print the detail of a cs_equation_param_t structure.

Parameters
[in]eqppointer to a cs_equation_param_t structure

◆ cs_equation_param_set()

void cs_equation_param_set ( 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_param_set_quadrature_to_all()

void cs_equation_param_set_quadrature_to_all ( cs_equation_param_t * eqp,
cs_quadrature_type_t qtype )

Apply the given quadrature rule to all existing definitions under the cs_equation_param_t structure.

Apply the given quadrature rule to all existing definitions under the cs_equation_param_t structure. To get a more detailed control of the quadrature rule, please consider the function cs_xdef_set_quadrature.

If the default quadrature has been modified by the code, this function set the value of the quadrture to the given parameter whatever was the previous value.

To get a more detailed control of the quadrature rule, please consider the function cs_xdef_set_quadrature

Parameters
[in,out]eqppointer to a cs_equation_param_t structure
[in]qtypetype of quadrature to apply

◆ cs_equation_param_set_sles()

void cs_equation_param_set_sles ( cs_equation_param_t * eqp)

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

Parameters
[in,out]eqppointer to a cs_equation_param_t structure

◆ cs_equation_param_unlock_settings()

void cs_equation_param_unlock_settings ( cs_equation_param_t * eqp)

Unlock settings. Be sure that is really wanted (inconsistency between the setup logging and what is used may appear)

Parameters
[in,out]eqppointer to a cs_equation_param_t structure

◆ cs_equation_remove_bc()

void cs_equation_remove_bc ( cs_equation_param_t * eqp,
const char * z_name )

Remove boundary condition from the given equation param structure for a given zone.

If no matching boundary condition is found, the function returns silently.

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

◆ cs_equation_remove_ic()

void cs_equation_remove_ic ( cs_equation_param_t * eqp,
const char * z_name )

Remove initial condition from the given equation param structure for a given zone.

If no matching boundary condition is found, the function returns silently.

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

◆ cs_equation_time_control_add()

void cs_equation_time_control_add ( cs_equation_param_t * eqp,
cs_time_control_t * time_control,
bool shallow_copy )

Add a time control instance to an equation param structure.

Parameters
[in]eqppointer to equation param structure
[in]time_controlpointer to cs_time_control to add.
[in]shallow_copyshould the addition be only a shallow copy (pointer) or a real copy (data copy).

◆ cs_equation_time_control_add_default()

void cs_equation_time_control_add_default ( cs_equation_param_t * eqp)

Add a time control instance to an equation param structure based on default values (hard copy).

Parameters
[in]eqppointer to equation param structure

◆ cs_equation_time_control_clear()

void cs_equation_time_control_clear ( cs_equation_param_t * eqp)

Clear time_control data from the given equation param.

Parameters
[in,out]eqpEquation param instance

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:68

◆ _strong_pena_bc_coef_by_default

const cs_real_t _strong_pena_bc_coef_by_default = 1e12
static

◆ _weak_pena_bc_coef_by_default

const cs_real_t _weak_pena_bc_coef_by_default = 100.
static