1 #ifndef __CS_EQUATION_H__ 2 #define __CS_EQUATION_H__ 52 typedef struct _cs_equation_t cs_equation_t;
625 const int reaction_id);
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 struc...
Definition: cs_equation.c:1990
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 (NU...
Definition: cs_equation.c:2628
Definition: cs_equation.h:73
Definition: cs_equation.h:58
Field descriptor.
Definition: cs_field.h:124
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 vari...
Definition: cs_equation.c:2247
Definition: cs_equation_param.h:101
void cs_equation_solve(cs_equation_t *eq)
Solve the linear system for this equation.
Definition: cs_equation.c:2358
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:2831
Definition: cs_equation.h:64
#define BEGIN_C_DECLS
Definition: cs_defs.h:453
cs_equation_key_t
Definition: cs_equation.h:55
Definition: cs_equation.h:68
Definition: cs_cdo_connect.h:55
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.
Definition: cs_equation.c:2120
Definition: cs_equation.h:67
double cs_real_t
Floating-point value.
Definition: cs_defs.h:297
Definition: cs_cdo_quantities.h:89
Definition: cs_equation.h:71
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.
Definition: cs_equation.c:2313
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 ...
Definition: cs_equation.c:1795
bool cs_equation_needs_build(const cs_equation_t *eq)
Check if one has to build the linear system.
Definition: cs_equation.c:2296
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 rel...
Definition: cs_equation.c:2650
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:1694
cs_equation_t * cs_equation_by_id(int eq_id)
Find the cs_equation_t structure with name eqname Return NULL if not find.
Definition: cs_equation.c:820
Definition: cs_equation.h:80
Definition: cs_equation.h:77
cs_space_scheme_t
Definition: cs_cdo.h:138
void cs_equation_log_setup(void)
Summarize all cs_equation_t structures.
Definition: cs_equation.c:1056
void() cs_analytic_func_t(cs_real_t time, cs_lnum_t n_elts, const cs_lnum_t *elt_ids, const cs_real_t *coords, bool compact, void *input, cs_real_t *retval)
Generic function pointer for an analytic function elt_ids is optional. If not NULL, it enables to access in coords at the right location and the same thing to fill retval if compact is set to false.
Definition: cs_cdo.h:169
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:2588
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...
Definition: cs_equation.c:1145
Definition: cs_equation.h:63
Definition: cs_field_pointer.h:65
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.
Definition: cs_equation.c:2037
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 ...
Definition: cs_equation.c:1838
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 ...
Definition: cs_equation.c:1751
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.
Definition: cs_equation.c:2920
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 (N...
Definition: cs_equation.c:2608
int cs_equation_get_id(const cs_equation_t *eq)
Return the id number related to the given cs_equation_t structure.
Definition: cs_equation.c:2526
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:1334
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.
Definition: cs_equation.c:950
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:62
cs_param_bc_type_t
Definition: cs_param.h:161
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.
Definition: cs_equation.c:2071
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:2753
void cs_equation_create_fields(void)
Create a field structure related to all cs_equation_t structures.
Definition: cs_equation.c:2167
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:2785
Definition: cs_equation.h:72
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:293
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:2675
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:2733
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:2880
Definition: cs_equation.h:70
#define END_C_DECLS
Definition: cs_defs.h:454
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:2564
Definition: cs_equation.h:79
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:2545
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.
Definition: cs_equation.c:843
int cs_equation_get_var_dim(const cs_equation_t *eq)
Return the dimension of the variable solved by this equation.
Definition: cs_equation.c:2714
void cs_equation_destroy_all(void)
Destroy all cs_equation_t structures.
Definition: cs_equation.c:985
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:1099
const char * cs_equation_get_name(const cs_equation_t *eq)
Return the name related to the given cs_equation_t structure.
Definition: cs_equation.c:2507
void cs_equation_extra_post_all(const cs_time_step_t *ts, double dt)
Predefined extra-operations related to all equations.
Definition: cs_equation.c:2958
cs_equation_t * cs_equation_by_name(const char *eqname)
Find the cs_equation_t structure with name eqname Return NULL if not find.
Definition: cs_equation.c:789
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:2695
Definition: cs_property.h:62
int cs_equation_get_n_equations(void)
Retrieve the number of equations.
Definition: cs_equation.c:772
Definition: cs_equation.h:78
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 struc...
Definition: cs_equation.c:1883
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 struc...
Definition: cs_equation.c:1930
void cs_equation_log_monitoring(void)
Print a synthesis of the monitoring information in the performance file.
Definition: cs_equation.c:1031
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:2486