1 #ifndef __CS_EQUATION_H__ 2 #define __CS_EQUATION_H__ 52 typedef struct _cs_equation_t cs_equation_t;
308 cs_property_t *property,
cs_equation_t * cs_equation_create(const char *eqname, const char *varname, cs_equation_type_t eqtype, cs_param_var_type_t vartype, cs_param_bc_type_t default_bc)
Define and initialize a new structure to store parameters related to an equation. ...
Definition: cs_equation.c:476
Definition: cs_equation.h:57
time step descriptor
Definition: cs_time_step.h:51
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...
Definition: cs_equation.c:2246
void cs_equation_add_source_term_by_val(cs_equation_t *eq, const char *st_name, const char *ml_name, const void *val)
Define and initialize by value a new structure to store parameters related to a source term defined b...
Definition: cs_equation.c:1398
void cs_equation_init_system(const cs_mesh_t *mesh, cs_equation_t *eq)
Initialize the values of a field according to the initial condition related to its equation...
Definition: cs_equation.c:1728
Definition: cs_equation.h:74
Definition: cs_equation.h:58
void cs_equation_set_ic(cs_equation_t *eq, const char *ml_name, const char *def_key, void *val)
Define the initial condition of the unknown related to this equation This definition can be done by m...
Definition: cs_equation.c:1127
Field descriptor.
Definition: cs_field.h:121
void cs_equation_summary(const cs_equation_t *eq)
Summary of a cs_equation_t structure.
Definition: cs_equation.c:583
Definition: cs_equation_param.h:102
size_t cs_equation_get_tmpbuf_size(void)
Get the allocation size of the temporary buffer.
Definition: cs_equation_common.c:208
Definition: cs_equation.h:61
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 attach...
Definition: cs_equation.c:2432
Definition: cs_equation.h:64
#define BEGIN_C_DECLS
Definition: cs_defs.h:448
cs_equation_key_t
Definition: cs_equation.h:55
void cs_equation_add_gravity_source_term(cs_equation_t *eq, int ml_id, cs_desc_t array_desc, cs_real_t *array_values)
Define and initialize a new structure to store parameters related to a source term def_key among "val...
Definition: cs_equation.c:1337
cs_source_term_reduction_t
Definition: cs_source_term.h:65
Definition: cs_equation.h:68
void cs_equation_set_source_term_reduction(cs_equation_t *eq, const char *st_name, cs_source_term_reduction_t type)
Set the type of quadrature to use for computing a source term If st_name is NULL, all source terms of...
Definition: cs_equation.c:1592
void cs_equation_allocate_common_structures(const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *time_step, cs_flag_t scheme_flag)
Allocate a pointer to a buffer of size at least the 2*n_cells for managing temporary usage of memory ...
Definition: cs_equation_common.c:95
Definition: cs_cdo_connect.h:67
void() cs_analytic_func_t(cs_real_t time, const cs_real_3_t xyz, cs_get_t *retval)
Generic analytic function.
Definition: cs_cdo.h:154
Definition: cs_equation.h:67
void cs_equation_compute_diff_flux(const cs_equation_t *eq, cs_real_t *diff_flux)
Cellwise computation of the diffusive flux across all cell faces. Primal or dual faces are considered...
Definition: cs_equation.c:2471
cs_property_t * cs_equation_get_reaction_property(const cs_equation_t *eq, const char *r_name)
Return a pointer to the cs_property_t structure associated to the reaction term called r_name and rel...
Definition: cs_equation.c:2267
double cs_real_t
Floating-point value.
Definition: cs_defs.h:296
Definition: cs_cdo_quantities.h:100
Definition: cs_equation.h:71
bool cs_equation_needs_build(const cs_equation_t *eq)
Check if one has to build the linear system.
Definition: cs_equation.c:1789
Definition: cs_equation.h:62
Definition: cs_equation.h:76
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...
Definition: cs_equation.c:1076
void cs_equation_set_source_term_quadrature(cs_equation_t *eq, const char *st_name, cs_quadra_type_t quad_type)
Set the type of quadrature to use for computing a source term If st_name is NULL, all source terms of...
Definition: cs_equation.c:1539
Definition: cs_equation.h:80
Definition: cs_equation.h:77
cs_space_scheme_t
Definition: cs_cdo.h:99
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. ...
Definition: cs_equation.c:2206
cs_real_t * cs_equation_get_tmpbuf(void)
Retrieve a pointer to a buffer of size at least the 2*n_cells The size of the temporary buffer can be...
Definition: cs_equation_common.c:194
void cs_equation_last_setup(cs_equation_t *eq)
Assign a set of pointer functions for managing the cs_equation_t structure during the computation...
Definition: cs_equation.c:654
void cs_equation_add_linear_reaction(cs_equation_t *eq, cs_property_t *property, const char *r_name)
Define and initialize a new structure to store parameters related to a reaction term.
Definition: cs_equation.c:1279
Definition: cs_equation.h:63
Definition: cs_field_pointer.h:64
void cs_equation_free_common_structures(cs_flag_t scheme_flag)
Allocate a pointer to a buffer of size at least the 2*n_cells for managing temporary usage of memory ...
Definition: cs_equation_common.c:162
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...
Definition: cs_equation.c:2226
void cs_equation_extra_op(const cs_equation_t *eq, const cs_time_step_t *ts, double dt)
Predefined extra-operations related to this equation.
Definition: cs_equation.c:1991
Definition: cs_equation.h:69
Definition: cs_equation.h:65
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.
Definition: cs_equation.c:735
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:308
cs_equation_type_t
Definition: cs_equation_param.h:63
cs_param_bc_type_t
Definition: cs_param.h:259
void cs_equation_solve(cs_equation_t *eq, bool do_logcvg)
Solve the linear system for this equation.
Definition: cs_equation.c:1902
cs_quadra_type_t
Definition: cs_quadrature.h:40
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.
Definition: cs_equation.c:2365
void cs_equation_add_bc(cs_equation_t *eq, const char *ml_name, const char *bc_key, const char *def_key, const void *val)
Define and initialize a new structure to store parameters related to an equation bc_key among "dirich...
Definition: cs_equation.c:1191
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.
Definition: cs_equation.c:2392
Definition: cs_equation.h:72
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.
Definition: cs_equation.c:2307
cs_param_var_type_t cs_equation_get_var_type(const cs_equation_t *eq)
Return the type of variable solved by this equation.
Definition: cs_equation.c:2326
cs_equation_type_t cs_equation_get_type(const cs_equation_t *eq)
Return the type of equation for the given equation structure.
Definition: cs_equation.c:2345
Definition: cs_equation.h:75
Definition: cs_equation.h:70
#define END_C_DECLS
Definition: cs_defs.h:449
unsigned short int cs_flag_t
Definition: cs_defs.h:298
Definition: cs_equation.h:59
cs_flag_t cs_equation_get_flag(const cs_equation_t *eq)
Return the flag associated to an equation.
Definition: cs_equation.c:2182
Definition: cs_equation.h:79
cs_param_var_type_t
Definition: cs_param.h:109
void cs_equation_create_field(cs_equation_t *eq)
Create a field structure related to this cs_equation_t structure to an equation.
Definition: cs_equation.c:1643
cs_field_t * cs_equation_get_field(const cs_equation_t *eq)
Return the field structure associated to a cs_equation_t structure.
Definition: cs_equation.c:2163
Definition: cs_equation.h:73
Definition: cs_equation.h:60
void cs_equation_set_timer_stats(cs_equation_t *eq)
Create timer statistics structures to enable a "home-made" profiling.
Definition: cs_equation.c:605
const char * cs_equation_get_name(const cs_equation_t *eq)
Return the name related to the given cs_equation_t structure to an equation.
Definition: cs_equation.c:2144
Definition: cs_equation.h:78
void cs_equation_build_system(const cs_mesh_t *m, const cs_time_step_t *time_step, double dt_cur, cs_equation_t *eq)
Build the linear system for this equation.
Definition: cs_equation.c:1806
void cs_equation_add_source_term_by_analytic(cs_equation_t *eq, const char *st_name, const char *ml_name, cs_analytic_func_t *ana)
Define and initialize by an analytical function a new structure related to a source term defined by a...
Definition: cs_equation.c:1476
cs_equation_t * cs_equation_free(cs_equation_t *eq)
Destroy a cs_equation_t structure.
Definition: cs_equation.c:547
Definition: cs_equation.h:66
bool cs_equation_is_steady(const cs_equation_t *eq)
Return true is the given equation is steady otherwise false.
Definition: cs_equation.c:2122