Structure and functions handling the specific settings related to a cs_equation_t structure. More...
#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 <bft_printf.h>
#include "cs_boundary_zone.h"
#include "cs_cdo_advection.h"
#include "cs_cdo_bc.h"
#include "cs_hodge.h"
#include "cs_log.h"
#include "cs_mesh_location.h"
#include "cs_sles.h"
#include "cs_source_term.h"
#include "cs_volume_zone.h"
#include "cs_equation_param.h"
Functions | |
static cs_param_sles_class_t | _get_petsc_or_hypre (const cs_param_sles_t *slesp, const char *keyname) |
Check if PETSc or HYPRE is available and return the possible solver class. More... | |
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. More... | |
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;. More... | |
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. More... | |
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. More... | |
void | cs_equation_param_clear (cs_equation_param_t *eqp) |
Free the contents of a cs_equation_param_t. More... | |
cs_equation_param_t * | cs_equation_param_free (cs_equation_param_t *eqp) |
Free a cs_equation_param_t. More... | |
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. More... | |
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. More... | |
void | cs_equation_param_lock_settings (cs_equation_param_t *eqp) |
Lock settings to prevent from unwanted modifications. More... | |
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) More... | |
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. More... | |
void | cs_equation_param_log (const cs_equation_param_t *eqp) |
Print the detail of a cs_equation_param_t structure. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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) More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
void | cs_equation_add_advection_scaling_property (cs_equation_param_t *eqp, cs_property_t *property) |
Associate a scaling property to the advection. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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 [] |
Structure and functions handling the specific settings related to a cs_equation_t structure.
|
static |
Check if PETSc or HYPRE is available and return the possible solver class.
[in] | slesp | pointer to a cs_param_sles_t structure |
[in] | keyname | name of the key to handle |
|
static |
Set a parameter attached to a keyname in a cs_equation_param_t structure.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | key | key related to the member of eq to set |
[in] | keyval | accessor to the value to set |
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.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | adv_field | pointer to a cs_adv_field_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.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | property | pointer to a cs_property_t structure |
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.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | bc_type | type of boundary condition to add |
[in] | z_name | name of the associated zone (if NULL or "" if all cells are considered) |
[in] | analytic | pointer to an analytic function defining the value |
[in] | input | NULL or pointer to a structure cast on-the-fly |
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.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | bc_type | type of boundary condition to add |
[in] | z_name | name of the related boundary zone |
[in] | loc | information to know where are located values |
[in] | array | pointer to an array |
[in] | is_owner | transfer the lifecycle to the cs_xdef_t struct. (true or false) |
[in] | full_length | if 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. |
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.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | bc_type | type of boundary condition to add |
[in] | z_name | name of the associated zone (if NULL or "" if all cells are considered) |
[in] | loc_flag | location where values are computed |
[in] | func | pointer to cs_dof_func_t function |
[in] | input | NULL or pointer to a structure cast on-the-fly |
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.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | bc_type | type of boundary condition to add |
[in] | z_name | name of the related boundary zone |
[in] | field | pointer to a cs_field_t structure |
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.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | bc_type | type of boundary condition to add |
[in] | z_name | name of the related boundary zone |
[in] | values | pointer to a array storing the values |
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
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | n_cells | number of selected cells |
[in] | cell_ids | list of cell ids |
[in] | ref_value | ignored if NULL |
[in] | cell_values | list of associated values, ignored if NULL |
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.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | property | pointer to a cs_property_t structure |
[in] | inversion | > 0: true, false otherwise |
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)
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | property | pointer to a cs_property_t structure |
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
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | n_edges | number of edges to enforce |
[in] | edge_ids | list of edges |
[in] | ref_value | default values or ignored (may be NULL) |
[in] | edge_values | list of associated values, ignored if NULL |
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
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | n_faces | number of faces to enforce |
[in] | face_ids | list of faces |
[in] | ref_value | default values or ignored (may be NULL) |
[in] | face_values | list of associated values, ignored if NULL |
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.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | property | pointer to a cs_property_t structure |
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.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | z_name | name of the associated zone (if NULL or "" if all cells are considered) |
[in] | analytic | pointer to an analytic function |
[in] | input | NULL or pointer to a structure cast on-the-fly |
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.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | z_name | name of the associated zone (if NULL or "" if all cells are considered) |
[in] | loc_flag | where information is computed |
[in] | func | pointer to a DoF function |
[in] | input | NULL or pointer to a structure cast on-the-fly |
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.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | z_name | name of the associated zone (if NULL or "" all cells are considered) |
[in] | quantity | quantity to distribute over the mesh location |
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.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | z_name | name of the associated zone (if NULL or "" all cells are considered) |
[in] | val | pointer to the value |
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
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | enforcement_id | id of the enforcement to handle |
[in] | n_cells | number of selected cells |
[in] | cell_ids | list of cell ids |
[in] | ref_value | ignored if NULL |
[in] | cell_values | list of associated values, ignored if NULL |
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.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | property | pointer to a cs_property_t structure |
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.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | z_name | name of the related boundary zone |
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.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | z_name | name of the associated zone (if NULL or "" if all cells are considered) |
[in] | func | pointer to an analytical function |
[in] | input | NULL or pointer to a structure cast on-the-fly |
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.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | z_name | name of the associated zone (if NULL or "" if all cells are considered) |
[in] | loc | information to know where are located values |
[in] | array | pointer to an array |
[in] | is_owner | transfer the lifecycle to the cs_xdef_t struct. (true or false) |
[in] | full_length | if 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. |
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.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | z_name | name of the associated zone (if NULL or "" if all cells are considered) |
[in] | loc_flag | location of element ids given as parameter |
[in] | func | pointer to a DoF function |
[in] | input | NULL or pointer to a structure cast on-the-fly |
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.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | z_name | name of the associated zone (if NULL or "" all cells are considered) |
[in] | val | pointer to the value |
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.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | property | pointer to a cs_property_t structure |
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
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | n_vertices | number of vertices to enforce |
[in] | vertex_ids | list of vertices |
[in] | ref_value | default values or ignored (may be NULL) |
[in] | vtx_values | list of associated values, ignored if NULL |
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.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | z_name | name of the associated zone (if NULL or "" if all cells are considered) |
[in] | func | pointer to an analytical function |
[in] | input | NULL or pointer to a structure cast on-the-fly |
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.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | z_name | name of the associated zone (if NULL or "" if all cells are considered) |
[in] | loc_flag | where information is computed |
[in] | func | pointer to an analytical function |
[in] | input | NULL or pointer to a structure cast on-the-fly |
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.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | z_name | name of the associated zone (if NULL or "" if all cells are considered) |
[in] | quantity | pointer to quantity to distribute over the zone |
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.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | z_name | name of the associated zone (if NULL or "" if all cells are considered) |
[in] | val | pointer to the value |
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.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | xdef | pointer to the cs_xdef_t structure to transfer |
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.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | z_name | name of the associated zone (if NULL or "" if all cells are considered) |
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.
[in,out] | eqp | pointer to a cs_equation_param_t |
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.
[in] | ref | pointer to the reference cs_equation_param_t |
[in,out] | dst | pointer to the cs_equation_param_t to update |
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.
[in] | ref | pointer to the reference cs_equation_param_t |
[in,out] | dst | pointer to the cs_equation_param_t to update |
[in] | copy_fld_id | copy also the field id or not |
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.
[in] | name | name of the equation |
[in] | type | type of equation |
[in] | dim | dim of the variable associated to this equation |
[in] | default_bc | type of boundary condition set by default |
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.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
cs_equation_param_t* cs_equation_param_free | ( | cs_equation_param_t * | eqp | ) |
Free a cs_equation_param_t.
[in,out] | eqp | pointer to a cs_equation_param_t |
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.
[in] | eqp | pointer to a cs_equation_param_t |
void cs_equation_param_lock_settings | ( | cs_equation_param_t * | eqp | ) |
Lock settings to prevent from unwanted modifications.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
void cs_equation_param_log | ( | const cs_equation_param_t * | eqp | ) |
Print the detail of a cs_equation_param_t structure.
[in] | eqp | pointer to a cs_equation_param_t structure |
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.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | key | key related to the member of eq to set |
[in] | keyval | accessor to the value to set |
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.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
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)
[in,out] | eqp | pointer to a cs_equation_param_t structure |
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.
[in,out] | eqp | pointer to a cs_equation_param_t structure |
[in] | z_name | name of the associated zone (if NULL or "" if all cells are considered) |
|
static |
|
static |
|
static |