![]() |
programmer's documentation
|
#include "cs_defs.h"
#include <assert.h>
#include <ctype.h>
#include <float.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <bft_mem.h>
#include "cs_base.h"
#include "cs_boundary_zone.h"
#include "cs_cdo.h"
#include "cs_cdovb_scaleq.h"
#include "cs_cdovcb_scaleq.h"
#include "cs_cdofb_scaleq.h"
#include "cs_equation_common.h"
#include "cs_evaluate.h"
#include "cs_hho_scaleq.h"
#include "cs_log.h"
#include "cs_mesh_location.h"
#include "cs_parall.h"
#include "cs_post.h"
#include "cs_range_set.h"
#include "cs_source_term.h"
#include "cs_sles.h"
#include "cs_timer_stats.h"
#include "cs_volume_zone.h"
#include "cs_equation.h"
Macros | |
#define | CS_EQUATION_DBG 1 |
Typedefs | |
typedef void *( | cs_equation_init_data_t )(const cs_equation_param_t *eqp, cs_equation_builder_t *eqb) |
Initialize a scheme data structure used during the building of the algebraic system. More... | |
typedef void *( | cs_equation_free_data_t )(void *scheme_data) |
Destroy a scheme data structure. More... | |
typedef void( | cs_equation_initialize_system_t )(const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *data, cs_matrix_t **system_matrix, cs_real_t **system_rhs) |
Create the matrix of the current algebraic system. Allocate and initialize the right-hand side associated to the given builder structure. More... | |
typedef void( | cs_equation_build_system_t )(const cs_mesh_t *mesh, const cs_real_t *field_val, double dt_cur, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *data, cs_real_t *rhs, cs_matrix_t *matrix) |
Build a linear system within the CDO framework. More... | |
typedef void( | cs_equation_prepare_solve_t )(void *eq_to_cast, cs_real_t *p_x[], cs_real_t *p_rhs[]) |
Carry out operations for allocating and/or initializing the solution array and the right hand side of the linear system to solve. Handle parallelism thanks to cs_range_set_t structure. More... | |
typedef void( | cs_equation_update_field_t )(const cs_real_t *solu, const cs_real_t *rhs, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *data, cs_real_t *field_val) |
Store solution(s) of the linear system into a field structure Update extra-field values if required (for hybrid discretization) More... | |
typedef void( | cs_equation_compute_source_t )(const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *builder) |
Compute the contribution of source terms for the current time. More... | |
typedef void( | cs_equation_flux_plane_t )(const cs_real_t normal[], const cs_real_t *pdi, int ml_id, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *data, double *d_flux, double *c_flux) |
Compute the diffusive and convective flux across a list of faces. More... | |
typedef void( | cs_equation_cell_difflux_t )(const cs_real_t *fvals, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *data, cs_flag_t location, cs_real_t *d_flux) |
Cellwise computation of the diffusive flux across all faces. Primal or dual faces are considered according to the space scheme. More... | |
typedef void( | cs_equation_extra_op_t )(const char *eqname, const cs_field_t *field, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *data) |
Extra-operation related to this equation. More... | |
typedef double *( | cs_equation_get_extra_values_t )(const void *scheme_data) |
Get the computed values at a different location than that of the field associated to this equation. More... | |
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... | |
static void | _initialize_field_from_ic (cs_equation_t *eq) |
Set the initial values for the variable related to an equation. More... | |
static void | _prepare_vb_solving (void *eq_to_cast, cs_real_t *p_x[], cs_real_t *p_rhs[]) |
Carry out operations for allocating and/or initializing the solution array and the right hand side of the linear system to solve. Handle parallelism thanks to cs_range_set_t structure. More... | |
static void | _prepare_fb_solving (void *eq_to_cast, cs_real_t *p_x[], cs_real_t *p_rhs[]) |
Carry out operations for allocating and/or initializing the solution array and the right hand side of the linear system to solve. Handle parallelism thanks to cs_range_set_t structure. More... | |
int | cs_equation_get_n_equations (void) |
Retrieve the number of equations. More... | |
cs_equation_t * | cs_equation_by_name (const char *eqname) |
Find the cs_equation_t structure with name eqname Return NULL if not find. More... | |
cs_equation_t * | cs_equation_by_id (int eq_id) |
Find the cs_equation_t structure with name eqname Return NULL if not find. More... | |
cs_equation_t * | cs_equation_add (const char *eqname, const char *varname, cs_equation_type_t eqtype, int dim, cs_param_bc_type_t default_bc) |
Add a new equation structure and set a first set of parameters. More... | |
cs_equation_t * | cs_equation_add_user (const char *eqname, const char *varname, int dim, cs_param_bc_type_t default_bc) |
Add a new user equation structure and set a first set of parameters. More... | |
void | cs_equation_destroy_all (void) |
Destroy all cs_equation_t structures. More... | |
void | cs_equation_log_monitoring (void) |
Print a synthesis of the monitoring information in the performance file. More... | |
void | cs_equation_log_setup (void) |
Summarize all cs_equation_t structures. More... | |
void | cs_equation_set_timer_stats (cs_equation_t *eq) |
Create timer statistics structures to enable a "home-made" profiling. More... | |
bool | cs_equation_finalize_setup (const cs_cdo_connect_t *connect, bool do_profiling) |
Assign a set of pointer functions for managing the cs_equation_t structure during the computation. More... | |
void | cs_equation_set_param (cs_equation_t *eq, cs_equation_key_t key, const char *keyval) |
Set a parameter in a cs_equation_t structure attached to keyname. More... | |
void | cs_equation_link (cs_equation_t *eq, const char *keyword, void *pointer) |
Associate a material property or an advection field with an equation for a given term (diffusion, time, convection) More... | |
void | cs_equation_add_ic_by_value (cs_equation_t *eq, 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_t *eq, 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_t *eq, 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_t *eq, 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_boundary_zone_t. More... | |
void | cs_equation_add_bc_by_array (cs_equation_t *eq, 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_boundary_zone_t. More... | |
void | cs_equation_add_bc_by_analytic (cs_equation_t *eq, 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 structure ml_name corresponds to the name of a pre-existing cs_mesh_location_t. More... | |
int | cs_equation_add_reaction (cs_equation_t *eq, cs_property_t *property) |
Define and initialize a new structure to store parameters related to a reaction term. More... | |
cs_xdef_t * | cs_equation_add_source_term_by_val (cs_equation_t *eq, const char *z_name, cs_real_t *val) |
Define a new source term structure and initialize it by value. More... | |
cs_xdef_t * | cs_equation_add_source_term_by_analytic (cs_equation_t *eq, 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... | |
void | cs_equation_create_fields (void) |
Create a field structure related to all cs_equation_t structures. More... | |
void | cs_equation_initialize (const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *ts) |
Allocate and initialize the builder of the algebraic system. Set the initialize condition to all variable fields associated to each cs_equation_t structure. Compute the initial source term. More... | |
bool | cs_equation_needs_build (const cs_equation_t *eq) |
Check if one has to build the linear system. More... | |
void | cs_equation_build_system (const cs_mesh_t *mesh, const cs_time_step_t *time_step, double dt_cur, cs_equation_t *eq) |
Build the linear system for this equation. More... | |
void | cs_equation_solve (cs_equation_t *eq) |
Solve the linear system for this equation. More... | |
bool | cs_equation_is_steady (const cs_equation_t *eq) |
Return true is the given equation is steady otherwise false. More... | |
const char * | cs_equation_get_name (const cs_equation_t *eq) |
Return the name related to the given cs_equation_t structure. More... | |
int | cs_equation_get_id (const cs_equation_t *eq) |
Return the id number related to the given cs_equation_t structure. More... | |
cs_field_t * | cs_equation_get_field (const cs_equation_t *eq) |
Return the field structure associated to a cs_equation_t structure. More... | |
cs_flag_t | cs_equation_get_flag (const cs_equation_t *eq) |
Return the flag associated to an equation. More... | |
const cs_equation_param_t * | cs_equation_get_param (const cs_equation_t *eq) |
Return the cs_equation_param_t structure associated to a cs_equation_t structure. More... | |
cs_property_t * | cs_equation_get_diffusion_property (const cs_equation_t *eq) |
Return a pointer to the cs_property_t structure associated to the diffusion term for this equation (NULL if not activated). More... | |
cs_property_t * | cs_equation_get_time_property (const cs_equation_t *eq) |
Return a pointer to the cs_property_t structure associated to the unsteady term for this equation (NULL if not activated). More... | |
cs_property_t * | cs_equation_get_reaction_property (const cs_equation_t *eq, const int reaction_id) |
Return a pointer to the cs_property_t structure associated to the reaction term called r_name and related to this equation. More... | |
cs_space_scheme_t | cs_equation_get_space_scheme (const cs_equation_t *eq) |
Return the type of numerical scheme used for the discretization in space. More... | |
int | cs_equation_get_space_poly_degree (const cs_equation_t *eq) |
Return the max. degree used in the polynomial basis for the space discretization. More... | |
int | cs_equation_get_var_dim (const cs_equation_t *eq) |
Return the dimension of the variable solved by this equation. More... | |
cs_equation_type_t | cs_equation_get_type (const cs_equation_t *eq) |
Return the type of equation for the given equation structure. More... | |
const cs_real_t * | cs_equation_get_face_values (const cs_equation_t *eq) |
Get the values at each face of the mesh for the field unknowns related to this equation. More... | |
const cs_real_t * | cs_equation_get_cell_values (const cs_equation_t *eq) |
Get the values at each cell centers for the field unknowns related to this equation. More... | |
void | cs_equation_compute_flux_across_plane (const cs_equation_t *eq, const char *ml_name, const cs_real_3_t direction, cs_real_t *diff_flux, cs_real_t *conv_flux) |
Compute the diffusive and convective flux accross a plane defined by a mesh location structure attached to the name ml_name. More... | |
void | cs_equation_compute_diff_flux_cellwise (const cs_equation_t *eq, cs_flag_t location, cs_real_t *diff_flux) |
Cellwise computation of the diffusive flux across all cell faces. Primal or dual faces are considered according to the space scheme. More... | |
void | cs_equation_compute_vtx_field_gradient (const cs_equation_t *eq, cs_real_t *v_gradient) |
Cellwise computation of the discrete gradient at vertices. More... | |
void | cs_equation_extra_post_all (const cs_time_step_t *ts, double dt) |
Predefined extra-operations related to all equations. More... | |
Variables | |
static int | _n_equations = 0 |
static int | _n_predef_equations = 0 |
static int | _n_user_equations = 0 |
static cs_equation_t ** | _equations = NULL |
static const char | _err_empty_eq [] |
#define CS_EQUATION_DBG 1 |
typedef void( cs_equation_build_system_t)(const cs_mesh_t *mesh, const cs_real_t *field_val, double dt_cur, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *data, cs_real_t *rhs, cs_matrix_t *matrix) |
Build a linear system within the CDO framework.
[in] | m | pointer to a cs_mesh_t structure |
[in] | field_val | pointer to the current value of the field |
[in] | dt_cur | current value of the time step |
[in] | eqp | pointer to a cs_equation_param_t structure |
[in,out] | eqb | pointer to a cs_equation_builder_t structure |
[in,out] | data | pointer to a scheme builder structure |
[in,out] | rhs | right-hand side to compute |
[in,out] | matrix | pointer to cs_matrix_t structure to compute |
typedef void( cs_equation_cell_difflux_t)(const cs_real_t *fvals, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *data, cs_flag_t location, cs_real_t *d_flux) |
Cellwise computation of the diffusive flux across all faces. Primal or dual faces are considered according to the space scheme.
[in] | fvals | pointer to an array of field values |
[in] | eqp | pointer to a cs_equation_param_t structure |
[in,out] | eqb | pointer to a cs_equation_builder_t structure |
[in,out] | data | pointer to a generic data structure |
[in,out] | location | where the flux is defined |
[in,out] | diff_flux | pointer to the value of the diffusive flux |
typedef void( cs_equation_compute_source_t)(const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *builder) |
Compute the contribution of source terms for the current time.
[in] | eqp | pointer to a cs_equation_param_t structure |
[in,out] | eqb | pointer to a cs_equation_builder_t structure |
[in,out] | data | pointer to a scheme data structure which is cast on-the-fly |
typedef void( cs_equation_extra_op_t)(const char *eqname, const cs_field_t *field, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *data) |
Extra-operation related to this equation.
[in] | eqname | name of the equation |
[in] | field | pointer to a field structure |
[in] | eqp | pointer to a cs_equation_param_t structure |
[in,out] | eqb | pointer to a cs_equation_builder_t structure |
[in,out] | data | pointer to a generic data structure |
typedef void( cs_equation_flux_plane_t)(const cs_real_t normal[], const cs_real_t *pdi, int ml_id, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *data, double *d_flux, double *c_flux) |
Compute the diffusive and convective flux across a list of faces.
[in] | normal | indicate in which direction flux is > 0 |
[in] | pdi | pointer to an array of field values |
[in] | ml_id | id related to a cs_mesh_location_t struct. |
[in] | eqp | pointer to a cs_equation_param_t structure |
[in,out] | eqb | pointer to a cs_equation_builder_t structure |
[in,out] | data | pointer to data specific for this scheme |
[in,out] | d_flux | pointer to the value of the diffusive flux |
[in,out] | c_flux | pointer to the value of the convective flux |
typedef void*( cs_equation_free_data_t)(void *scheme_data) |
Destroy a scheme data structure.
[in,out] | scheme_data | pointer to a builder structure |
typedef double*( cs_equation_get_extra_values_t)(const void *scheme_data) |
Get the computed values at a different location than that of the field associated to this equation.
[in] | scheme_data | pointer to a data structure cast on-the-fly |
typedef void*( cs_equation_init_data_t)(const cs_equation_param_t *eqp, cs_equation_builder_t *eqb) |
Initialize a scheme data structure used during the building of the algebraic system.
[in] | eqp | pointer to a cs_equation_param_t structure |
[in,out] | eqb | pointer to a cs_equation_builder_t structure |
typedef void( cs_equation_initialize_system_t)(const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *data, cs_matrix_t **system_matrix, cs_real_t **system_rhs) |
Create the matrix of the current algebraic system. Allocate and initialize the right-hand side associated to the given builder structure.
[in] | eqp | pointer to a cs_equation_param_t structure |
[in,out] | eqb | pointer to a cs_equation_builder_t structure |
[in,out] | data | pointer to generic data structure |
[in,out] | system_matrix | pointer of pointer to a cs_matrix_t struct. |
[in,out] | system_rhs | pointer of pointer to an array of double |
Carry out operations for allocating and/or initializing the solution array and the right hand side of the linear system to solve. Handle parallelism thanks to cs_range_set_t structure.
[in,out] | eq_cast | pointer to generic builder structure |
[in,out] | p_x | pointer of pointer to the solution array |
[in,out] | p_rhs | pointer of pointer to the RHS array |
typedef void( cs_equation_update_field_t)(const cs_real_t *solu, const cs_real_t *rhs, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *data, cs_real_t *field_val) |
Store solution(s) of the linear system into a field structure Update extra-field values if required (for hybrid discretization)
[in] | solu | solution array |
[in] | rhs | rhs associated to this solution array |
[in] | eqp | pointer to a cs_equation_param_t structure |
[in,out] | eqb | pointer to a cs_equation_builder_t structure |
[in,out] | data | pointer to a data structure |
[in,out] | field_val | pointer to the current value of the field |
|
inlinestatic |
Retrieve the boundary zone if from the zone name (If name = NULL or has an empty length, all entities are selected)
[in] | z_name | name of the zone |
|
inlinestatic |
Retrieve the volume zone if from the zone name (If name = NULL or has an empty length, all entities are selected)
[in] | z_name | name of the zone |
|
static |
Set the initial values for the variable related to an equation.
[in,out] | eq | pointer to a cs_equation_t structure |
|
static |
Carry out operations for allocating and/or initializing the solution array and the right hand side of the linear system to solve. Handle parallelism thanks to cs_range_set_t structure.
[in,out] | eq_cast | pointer to generic builder structure |
[in,out] | p_x | pointer of pointer to the solution array |
[in,out] | p_rhs | pointer of pointer to the RHS array |
|
static |
Carry out operations for allocating and/or initializing the solution array and the right hand side of the linear system to solve. Handle parallelism thanks to cs_range_set_t structure.
[in,out] | eq_cast | pointer to generic builder structure |
[in,out] | p_x | pointer of pointer to the solution array |
[in,out] | p_rhs | pointer of pointer to the RHS array |
cs_equation_t* cs_equation_add | ( | const char * | eqname, |
const char * | varname, | ||
cs_equation_type_t | eqtype, | ||
int | dim, | ||
cs_param_bc_type_t | default_bc | ||
) |
Add a new equation structure and set a first set of parameters.
[in] | eqname | name of the equation |
[in] | varname | name of the variable associated to this equation |
[in] | eqtype | type of equation (user, predefined...) |
[in] | dim | dimension of the unknow attached to this equation |
[in] | default_bc | type of boundary condition set by default |
void cs_equation_add_bc_by_analytic | ( | cs_equation_t * | eq, |
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 structure ml_name corresponds to the name of a pre-existing cs_mesh_location_t.
[in,out] | eq | pointer to a cs_equation_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 |
void cs_equation_add_bc_by_array | ( | cs_equation_t * | eq, |
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_boundary_zone_t.
[in,out] | eq | pointer to a cs_equation_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] | index | optional pointer to the array index |
void cs_equation_add_bc_by_value | ( | cs_equation_t * | eq, |
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_boundary_zone_t.
[in,out] | eq | pointer to a cs_equation_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 |
void cs_equation_add_ic_by_analytic | ( | cs_equation_t * | eq, |
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.
[in,out] | eq | pointer to a cs_equation_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 | pointer to a structure cast on-the-fly (may be NULL) |
void cs_equation_add_ic_by_qov | ( | cs_equation_t * | eq, |
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.
[in,out] | eq | pointer to a cs_equation_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 |
void cs_equation_add_ic_by_value | ( | cs_equation_t * | eq, |
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.
[in,out] | eq | pointer to a cs_equation_t structure |
[in] | z_name | name of the associated zone (if NULL or "" all cells are considered) |
[in] | val | pointer to the value |
int cs_equation_add_reaction | ( | cs_equation_t * | eq, |
cs_property_t * | property | ||
) |
Define and initialize a new structure to store parameters related to a reaction term.
[in,out] | eq | pointer to a cs_equation_t structure |
[in] | property | pointer to a cs_property_t structure |
cs_xdef_t* cs_equation_add_source_term_by_analytic | ( | cs_equation_t * | eq, |
const char * | z_name, | ||
cs_analytic_func_t * | ana, | ||
void * | input | ||
) |
Define a new source term structure and initialize it by an analytical function.
[in,out] | eq | pointer to a cs_equation_t structure |
[in] | z_name | name of the associated zone (if NULL or "" if all cells are considered) |
[in] | ana | 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_val | ( | cs_equation_t * | eq, |
const char * | z_name, | ||
cs_real_t * | val | ||
) |
Define a new source term structure and initialize it by value.
[in,out] | eq | pointer to a cs_equation_t structure |
[in] | z_name | name of the associated zone (if NULL or "" all cells are considered) |
[in] | val | pointer to the value |
cs_equation_t* cs_equation_add_user | ( | const char * | eqname, |
const char * | varname, | ||
int | dim, | ||
cs_param_bc_type_t | default_bc | ||
) |
Add a new user equation structure and set a first set of parameters.
[in] | eqname | name of the equation |
[in] | varname | name of the variable associated to this equation |
[in] | dim | dimension of the unknow attached to this equation |
[in] | default_bc | type of boundary condition set by default |
void cs_equation_build_system | ( | const cs_mesh_t * | mesh, |
const cs_time_step_t * | time_step, | ||
double | dt_cur, | ||
cs_equation_t * | eq | ||
) |
Build the linear system for this equation.
[in] | m | pointer to a cs_mesh_t structure |
[in] | time_step | pointer to a time step structure |
[in] | dt_cur | value of the current time step |
[in,out] | eq | pointer to a cs_equation_t structure |
cs_equation_t* cs_equation_by_id | ( | int | eq_id | ) |
Find the cs_equation_t structure with name eqname Return NULL if not find.
[in] | eq_id | id of the equation to find |
cs_equation_t* cs_equation_by_name | ( | const char * | eqname | ) |
Find the cs_equation_t structure with name eqname Return NULL if not find.
[in] | eqname | name of the equation to find |
void cs_equation_compute_diff_flux_cellwise | ( | const cs_equation_t * | eq, |
cs_flag_t | location, | ||
cs_real_t * | diff_flux | ||
) |
Cellwise computation of the diffusive flux across all cell faces. Primal or dual faces are considered according to the space scheme.
[in] | eq | pointer to a cs_equation_t structure |
[in] | location | indicate where the flux has to be computed |
[in,out] | diff_flux | value of the diffusive flux |
void cs_equation_compute_flux_across_plane | ( | const cs_equation_t * | eq, |
const char * | ml_name, | ||
const cs_real_3_t | direction, | ||
cs_real_t * | diff_flux, | ||
cs_real_t * | conv_flux | ||
) |
Compute the diffusive and convective flux accross a plane defined by a mesh location structure attached to the name ml_name.
[in] | eq | pointer to a cs_equation_t structure |
[in] | ml_name | name of the related mesh location |
[in] | direction | vector indicating in which direction flux is > 0 |
[in,out] | diff_flux | value of the diffusive part of the flux |
[in,out] | conv_flux | value of the convective part of the flux |
void cs_equation_compute_vtx_field_gradient | ( | const cs_equation_t * | eq, |
cs_real_t * | v_gradient | ||
) |
Cellwise computation of the discrete gradient at vertices.
[in] | eq | pointer to a cs_equation_t structure |
[in,out] | v_gradient | gradient at vertices |
void cs_equation_create_fields | ( | void | ) |
Create a field structure related to all cs_equation_t structures.
void cs_equation_destroy_all | ( | void | ) |
Destroy all cs_equation_t structures.
void cs_equation_extra_post_all | ( | const cs_time_step_t * | ts, |
double | dt | ||
) |
Predefined extra-operations related to all equations.
[in] | ts | pointer to a cs_time_step_t struct. |
[in] | dt | value of the current time step |
bool cs_equation_finalize_setup | ( | const cs_cdo_connect_t * | connect, |
bool | do_profiling | ||
) |
Assign a set of pointer functions for managing the cs_equation_t structure during the computation.
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | do_profiling | true or false |
const cs_real_t* cs_equation_get_cell_values | ( | const cs_equation_t * | eq | ) |
Get the values at each cell centers for the field unknowns related to this equation.
[in] | eq | pointer to a cs_equation_t structure |
cs_property_t* cs_equation_get_diffusion_property | ( | const cs_equation_t * | eq | ) |
Return a pointer to the cs_property_t structure associated to the diffusion term for this equation (NULL if not activated).
[in] | eq | pointer to a cs_equation_t structure |
const cs_real_t* cs_equation_get_face_values | ( | const cs_equation_t * | eq | ) |
Get the values at each face of the mesh for the field unknowns related to this equation.
[in] | eq | pointer to a cs_equation_t structure |
cs_field_t* cs_equation_get_field | ( | const cs_equation_t * | eq | ) |
Return the field structure associated to a cs_equation_t structure.
[in] | eq | pointer to a cs_equation_t structure |
cs_flag_t cs_equation_get_flag | ( | const cs_equation_t * | eq | ) |
Return the flag associated to an equation.
[in] | eq | pointer to a cs_equation_t structure |
int cs_equation_get_id | ( | const cs_equation_t * | eq | ) |
Return the id number related to the given cs_equation_t structure.
[in] | eq | pointer to a cs_equation_t structure |
int cs_equation_get_n_equations | ( | void | ) |
Retrieve the number of equations.
const char* cs_equation_get_name | ( | const cs_equation_t * | eq | ) |
Return the name related to the given cs_equation_t structure.
[in] | eq | pointer to a cs_equation_t structure |
const cs_equation_param_t* cs_equation_get_param | ( | const cs_equation_t * | eq | ) |
Return the cs_equation_param_t structure associated to a cs_equation_t structure.
[in] | eq | pointer to a cs_equation_t structure |
cs_property_t* cs_equation_get_reaction_property | ( | const cs_equation_t * | eq, |
const int | reaction_id | ||
) |
Return a pointer to the cs_property_t structure associated to the reaction term called r_name and related to this equation.
[in] | eq | pointer to a cs_equation_t structure |
[in] | reaction_id | id related to this reaction term |
int cs_equation_get_space_poly_degree | ( | const cs_equation_t * | eq | ) |
Return the max. degree used in the polynomial basis for the space discretization.
[in] | eq | pointer to a cs_equation_t structure |
cs_space_scheme_t cs_equation_get_space_scheme | ( | const cs_equation_t * | eq | ) |
Return the type of numerical scheme used for the discretization in space.
[in] | eq | pointer to a cs_equation_t structure |
cs_property_t* cs_equation_get_time_property | ( | const cs_equation_t * | eq | ) |
Return a pointer to the cs_property_t structure associated to the unsteady term for this equation (NULL if not activated).
[in] | eq | pointer to a cs_equation_t structure |
cs_equation_type_t cs_equation_get_type | ( | const cs_equation_t * | eq | ) |
Return the type of equation for the given equation structure.
[in] | eq | pointer to a cs_equation_t structure |
int cs_equation_get_var_dim | ( | const cs_equation_t * | eq | ) |
Return the dimension of the variable solved by this equation.
[in] | eq | pointer to a cs_equation_t structure |
void cs_equation_initialize | ( | const cs_mesh_t * | mesh, |
const cs_cdo_connect_t * | connect, | ||
const cs_cdo_quantities_t * | quant, | ||
const cs_time_step_t * | ts | ||
) |
Allocate and initialize the builder of the algebraic system. Set the initialize condition to all variable fields associated to each cs_equation_t structure. Compute the initial source term.
[in] | mesh | pointer to a cs_mesh_t structure |
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | quant | pointer to a cs_cdo_quantities_t structure |
[in] | ts | pointer to a cs_time_step_t structure |
bool cs_equation_is_steady | ( | const cs_equation_t * | eq | ) |
Return true is the given equation is steady otherwise false.
[in] | eq | pointer to a cs_equation_t structure |
void cs_equation_link | ( | cs_equation_t * | eq, |
const char * | keyword, | ||
void * | pointer | ||
) |
Associate a material property or an advection field with an equation for a given term (diffusion, time, convection)
[in,out] | eq | pointer to a cs_equation_t structure |
[in] | keyword | "time", "diffusion", "advection" |
[in] | pointer | pointer to a given structure |
void cs_equation_log_monitoring | ( | void | ) |
Print a synthesis of the monitoring information in the performance file.
void cs_equation_log_setup | ( | void | ) |
Summarize all cs_equation_t structures.
bool cs_equation_needs_build | ( | const cs_equation_t * | eq | ) |
Check if one has to build the linear system.
[in] | eq | pointer to a cs_equation_t structure |
void cs_equation_set_param | ( | cs_equation_t * | eq, |
cs_equation_key_t | key, | ||
const char * | keyval | ||
) |
Set a parameter in a cs_equation_t structure attached to keyname.
[in,out] | eq | pointer to a cs_equation_t structure |
[in] | key | key related to the member of eq to set |
[in] | keyval | accessor to the value to set |
void cs_equation_set_timer_stats | ( | cs_equation_t * | eq | ) |
Create timer statistics structures to enable a "home-made" profiling.
[in,out] | eq | pointer to a cs_equation_t structure |
void cs_equation_solve | ( | cs_equation_t * | eq | ) |
Solve the linear system for this equation.
[in,out] | eq | pointer to a cs_equation_t structure |
|
static |
|
static |
|
static |
|
static |
|
static |