1 #ifndef __CS_EQUATION_H__ 2 #define __CS_EQUATION_H__ 52 typedef struct _cs_equation_t cs_equation_t;
void() cs_analytic_func_t(cs_real_t time, cs_lnum_t n_points, const cs_real_t *xyz, cs_real_t *retval)
Generic analytic function.
Definition: cs_cdo.h:170
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:606
Definition: cs_equation.h:57
void cs_equation_last_setup(const cs_cdo_connect_t *connect, cs_equation_t *eq)
Assign a set of pointer functions for managing the cs_equation_t structure during the computation...
Definition: cs_equation.c:802
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:2176
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:1774
void cs_equation_add_bc_by_value(cs_equation_t *eq, const cs_param_bc_type_t bc_type, const char *ml_name, const cs_get_t get)
Define and initialize a new structure to set a boundary condition related to the givan equation struc...
Definition: cs_equation.c:1465
Definition: cs_equation.h:73
Definition: cs_equation.h:58
void cs_equation_set_ic_by_qov(cs_equation_t *eq, const char *ml_name, double quantity)
Define the initial condition for the unknown related to this equation This definition can be done on ...
Definition: cs_equation.c:1388
Field descriptor.
Definition: cs_field.h:124
void cs_equation_summary(const cs_equation_t *eq)
Summary of a cs_equation_t structure.
Definition: cs_equation.c:735
Definition: cs_equation_param.h:100
void cs_equation_solve(cs_equation_t *eq)
Solve the linear system for this equation.
Definition: cs_equation.c:1878
size_t cs_equation_get_tmpbuf_size(void)
Get the allocation size of the temporary buffer.
Definition: cs_equation_common.c:869
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:2388
Definition: cs_equation.h:64
#define BEGIN_C_DECLS
Definition: cs_defs.h:451
cs_equation_key_t
Definition: cs_equation.h:55
cs_source_term_t * 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:1603
Definition: cs_equation.h:68
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:283
Definition: cs_cdo_connect.h:56
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...
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:2197
Definition: cs_param.h:51
double cs_real_t
Floating-point value.
Definition: cs_defs.h:297
Definition: cs_cdo_quantities.h:102
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:1820
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:1290
Definition: cs_equation.h:80
void cs_equation_add_bc_by_analytic(cs_equation_t *eq, const cs_param_bc_type_t bc_type, const char *ml_name, cs_analytic_func_t *analytic)
Define and initialize a new structure to set a boundary condition related to the givan equation struc...
Definition: cs_equation.c:1506
Definition: cs_equation.h:77
cs_space_scheme_t
Definition: cs_cdo.h:148
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:2136
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:855
void cs_equation_extra_post(const cs_equation_t *eq, const cs_time_step_t *ts, double dt)
Predefined extra-operations related to this equation.
Definition: cs_equation.c:2466
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:1545
Definition: cs_equation.h:63
Definition: cs_field_pointer.h:65
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:443
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:2156
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:934
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:309
cs_equation_type_t
Definition: cs_equation_param.h:61
cs_param_bc_type_t
Definition: cs_param.h:273
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:2315
void cs_equation_set_ic_by_value(cs_equation_t *eq, const char *ml_name, cs_get_t get)
Define the initial condition for the unknown related to this equation This definition can be done on ...
Definition: cs_equation.c:1347
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:2345
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:2237
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:2276
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:2295
Definition: cs_equation.h:75
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...
Definition: cs_equation.c:2430
Definition: cs_equation.h:70
#define END_C_DECLS
Definition: cs_defs.h:452
unsigned short int cs_flag_t
Definition: cs_defs.h:299
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:2112
Definition: cs_equation.h:79
void cs_equation_set_ic_by_analytic(cs_equation_t *eq, const char *ml_name, cs_analytic_func_t *analytic)
Define the initial condition for the unknown related to this equation This definition can be done on ...
Definition: cs_equation.c:1427
cs_param_var_type_t
Definition: cs_param.h:120
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:1690
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:2093
cs_source_term_t * 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:1649
void cs_equation_print_monitoring(const cs_equation_t *eq)
Print a synthesis of the monitoring information in the performance file.
Definition: cs_equation.c:719
Definition: cs_equation.h:74
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:758
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:2074
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. ...
Definition: cs_equation.c:2257
Definition: cs_property.h:66
Definition: cs_equation.h:78
Definition: cs_source_term.h:56
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:1837
cs_equation_t * cs_equation_free(cs_equation_t *eq)
Destroy a cs_equation_t structure.
Definition: cs_equation.c:682
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:2052