1 #ifndef __CS_EQUATION_H__
2 #define __CS_EQUATION_H__
148 const char *fld_name);
548 int *n_predef_equations,
549 int *n_user_equations);
859 const int reaction_id);
1106 const char *ml_name,
#define BEGIN_C_DECLS
Definition: cs_defs.h:514
double cs_real_t
Floating-point value.
Definition: cs_defs.h:319
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:334
unsigned long cs_gnum_t
global mesh entity number
Definition: cs_defs.h:298
#define END_C_DECLS
Definition: cs_defs.h:515
unsigned short int cs_flag_t
Definition: cs_defs.h:321
void cs_equation_add_build_hook(cs_equation_t *eq, void *context, cs_equation_build_hook_t *func)
Add a hook function to enable an advanced control during the cellwise system building....
Definition: cs_equation.c:1372
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:516
void cs_equation_define_builders(const cs_mesh_t *mesh)
Allocate and define the builder structure.
Definition: cs_equation.c:2698
void cs_equation_predefined_create_field(int n_previous, cs_equation_t *eq)
Create a field structure related to the predefined equation given as parameter. This includes an equa...
Definition: cs_equation.c:2642
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 with id equal to reac...
Definition: cs_equation.c:1090
cs_equation_core_t cs_equation_get_core_structure(const cs_equation_t *eq)
Return a pointer to a structure useful to handle low-level operations for the given equation.
Definition: cs_equation.c:963
cs_real_t * cs_equation_get_cell_values(const cs_equation_t *eq, bool previous)
For a given equation, retrieve an array of values related to each cell of the mesh for the unknowns.
Definition: cs_equation.c:3170
void cs_equation_lock_settings(void)
After this call, parameters related to an equation are set once for all.
Definition: cs_equation.c:2597
void cs_equation_extra_post(void)
Predefined extra-operations related to equations according to the type of numerical scheme (for the s...
Definition: cs_equation.c:4108
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:1476
cs_equation_t * cs_equation_by_field_name(const char *field_name)
Return the pointer to a cs_equation_t structure thanks to the field name of the variable field associ...
Definition: cs_equation.c:550
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:1606
void cs_equation_write_extra_restart(cs_restart_t *restart)
Write into the restart file additionnal arrays (not defined as fields) but useful for the checkpoint/...
Definition: cs_equation.c:3908
void cs_equation_finalize_sharing(cs_flag_t cb_scheme_flag, cs_flag_t eb_scheme_flag, cs_flag_t fb_scheme_flag, cs_flag_t vb_scheme_flag, cs_flag_t vcb_scheme_flag, cs_flag_t hho_scheme_flag)
Free shared local structures among the discretization schemes.
Definition: cs_equation.c:2008
void cs_equation_post_balance(const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *cdoq, const cs_time_step_t *ts)
Predefined extra-operations related to all equations.
Definition: cs_equation.c:3933
void cs_equation_set_default_param(cs_equation_key_t key, const char *keyval)
Set a parameter attached to a keyname for the default settigns.
Definition: cs_equation.c:1858
bool cs_equation_set_functions(void)
Assign a set of pointer functions for managing the cs_equation_t structure during the computation Aft...
Definition: cs_equation.c:2055
void cs_equation_read_extra_restart(cs_restart_t *restart)
Write into the restart file additionnal arrays (not defined as fields) but useful for the checkpoint/...
Definition: cs_equation.c:3885
void cs_equation_set_sles(void)
Setup the linear algebra requirements.
Definition: cs_equation.c:1888
void cs_equation_solve(bool cur2prev, const cs_mesh_t *mesh, cs_equation_t *eq)
Build and then solve the linear system for an equation with an unsteady term.
Definition: cs_equation.c:3002
void cs_equation_set_flag(cs_equation_t *eq, cs_flag_t flag)
Redefine the flag associated to an equation.
Definition: cs_equation.c:1348
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:1208
bool cs_equation_needs_steady_state_solve(void)
Check if a steady-state computation is requested according to the setting.
Definition: cs_equation.c:1735
void cs_equation_solve_steady_state(const cs_mesh_t *mesh, cs_equation_t *eq)
Build and then solve the linear system for this equation when the goal is to find the steady state.
Definition: cs_equation.c:2966
cs_real_t * cs_equation_get_face_values(const cs_equation_t *eq, bool previous)
For a given equation, retrieve an array of values related to each face of the mesh for the unknowns.
Definition: cs_equation.c:3196
cs_flag_t cs_equation_get_flag(const cs_equation_t *eq)
Return the flag associated to an equation.
Definition: cs_equation.c:1326
cs_param_time_scheme_t cs_equation_get_time_scheme(const cs_equation_t *eq)
Return the type of numerical scheme used for the discretization in time.
Definition: cs_equation.c:1115
cs_real_t * cs_equation_get_source_term_array(const cs_equation_t *eq)
Return a pointer to an array of values corresponding to the values of the source terms (cumulated val...
Definition: cs_equation.c:992
cs_param_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:1186
void cs_equation_get_count(int *n_equations, int *n_predef_equations, int *n_user_equations)
Get the count of equations of each macro type.
Definition: cs_equation.c:1806
bool cs_equation_uses_new_mechanism(const cs_equation_t *eq)
Return true is the given equation follows the new mechanism otherwise false.
Definition: cs_equation.c:1438
cs_real_t * cs_equation_get_edge_values(const cs_equation_t *eq, bool previous)
For a given equation, retrieve an array of values related to each edge of the mesh for the unknowns.
Definition: cs_equation.c:3222
void cs_equation_define_context_structures(void)
Allocate and define the context structure associated to each equation.
Definition: cs_equation.c:2727
cs_field_t * cs_equation_get_boundary_flux(const cs_equation_t *eq)
Return the field structure for the (normal) boundary flux associated to a cs_equation_t structure.
Definition: cs_equation.c:901
void cs_equation_log_monitoring(void)
Print a synthesis of the monitoring information in the performance file.
Definition: cs_equation.c:1757
cs_equation_param_t * cs_equation_param_by_name(const char *eqname)
Return the cs_equation_param_t structure associated to a cs_equation_t structure based on the equatio...
Definition: cs_equation.c:614
void cs_equation_define_core_structure(const cs_equation_t *eq, cs_equation_core_t **p_core)
Build a pointer to a core structure. If the input core structure is not allocated,...
Definition: cs_equation.c:2774
cs_equation_t * cs_equation_by_id(int eq_id)
Find the cs_equation_t structure with id eq_id Return NULL if not find.
Definition: cs_equation.c:693
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:1044
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:673
cs_equation_builder_t * cs_equation_get_builder(const cs_equation_t *eq)
Return the cs_equation_builder_t structure associated to a cs_equation_t structure....
Definition: cs_equation.c:923
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:3795
cs_real_t * cs_equation_get_vertex_values(const cs_equation_t *eq, bool previous)
For a given equation, retrieve an array of values related to each vertex of the mesh for the unknowns...
Definition: cs_equation.c:3248
cs_equation_param_t * cs_equation_param_by_field_name(const char *field_name)
Return the cs_equation_param_t structure related to a cs_equation_t structure thanks to the field nam...
Definition: cs_equation.c:648
void cs_equation_init_field_values(const cs_mesh_t *mesh, const cs_time_step_t *ts)
Set the initialize condition to all variable fields associated to each cs_equation_t structure.
Definition: cs_equation.c:2803
void cs_equation_solve_wrapper(bool cur2prev, const char *eqname)
Build and then solve the linear system for an equation with an unsteady term. This is wrapper for the...
Definition: cs_equation.c:3077
cs_gnum_t cs_equation_get_global_n_dofs(const cs_equation_t *eq, const cs_cdo_quantities_t *cdoq)
Return the global number of degrees of freedom associated to this cs_equation_t structure.
Definition: cs_equation.c:829
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:1066
void cs_equation_compute_diffusive_flux(const cs_equation_t *eq, const cs_equation_param_t *eqp, const cs_property_t *diff_pty, const cs_real_t *dof_vals, const cs_real_t *cell_vals, cs_flag_t location, cs_real_t t_eval, cs_real_t *diff_flux)
Computation of the diffusive flux across the requested location. If the location is not the "natural"...
Definition: cs_equation.c:3579
bool cs_equation_is_steady(const cs_equation_t *eq)
Return true is the given equation is steady otherwise false.
Definition: cs_equation.c:1413
bool cs_equation_has_field_name(const cs_equation_t *eq, const char *fld_name)
Check if the asociated field to a cs_equation_t structure has name equal to fld_name.
Definition: cs_equation.c:582
void cs_equation_compute_boundary_diff_flux(cs_real_t t_eval, const cs_equation_t *eq, cs_real_t *diff_flux)
Compute the diffusive flux across all boundary faces According to the space discretization scheme,...
Definition: cs_equation.c:3391
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 across a plane defined by a mesh location structure attache...
Definition: cs_equation.c:3476
void cs_equation_current_to_previous(const cs_equation_t *eq)
Apply the current to previous to all fields (and potentially arrays) related to an equation....
Definition: cs_equation.c:3114
void cs_equation_integrate_variable(const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *cdoq, const cs_equation_t *eq, cs_real_t *result)
Compute the integral over the domain of the variable field associated to the given equation....
Definition: cs_equation.c:3276
void cs_equation_build_system(const cs_mesh_t *mesh, cs_equation_t *eq)
Build the linear system for this equation (deprecated)
Definition: cs_equation.c:2854
void cs_equation_apply_stiffness(cs_equation_t *eq, const cs_property_t *property, const cs_real_t *pot, cs_flag_t loc_res, cs_real_t *res)
Compute the cellwise stiffness matrix associated to the property given as a parameter and apply it to...
Definition: cs_equation.c:4061
void cs_equation_destroy_all(void)
Destroy all cs_equation_t structures.
Definition: cs_equation.c:1691
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:713
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:753
void cs_equation_get_cellwise_builders(const cs_equation_t *eq, cs_cell_sys_t **csys, cs_cell_builder_t **cb)
For a given equation, retrieve the related cellwise builder structures: cs_cell_builder_t and cs_cell...
Definition: cs_equation.c:3143
void cs_equation_log_setup(void)
Summarize all cs_equation_t structures.
Definition: cs_equation.c:1822
void cs_equation_user_create_fields(void)
Create a field structure related to all user-defined equations.
Definition: cs_equation.c:2669
cs_real_t cs_equation_get_theta_time_val(const cs_equation_t *eq)
Return the value of the theta parameter in theta time scheme discretization.
Definition: cs_equation.c:1138
void * cs_equation_get_scheme_context(const cs_equation_t *eq)
Return a pointer to a structure useful to handle low-level operations for the given equation.
Definition: cs_equation.c:943
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:733
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:1250
cs_equation_t * cs_equation_add_user_tracer(const char *eqname, const char *varname, int dim, cs_param_bc_type_t default_bc, cs_property_t *time_pty, cs_adv_field_t *adv, cs_property_t *diff_pty)
Add a new user transport equation and set a first set of parameters If time_pty is NULL,...
Definition: cs_equation.c:1655
void cs_equation_init_sharing(const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *cdoq, const cs_time_step_t *time_step, cs_flag_t cb_scheme_flag, cs_flag_t eb_scheme_flag, cs_flag_t fb_scheme_flag, cs_flag_t vb_scheme_flag, cs_flag_t vcb_scheme_flag, cs_flag_t hho_scheme_flag)
Set shared pointers to the main structures. Associate these structures among the activated class of d...
Definition: cs_equation.c:1930
void cs_equation_solve_steady_state_wrapper(const char *eqname)
Build and then solve the linear system for a steady-state equation. This is wrapper for the FORTRAN i...
Definition: cs_equation.c:3039
double cs_equation_get_time_eval(const cs_time_step_t *ts, const cs_equation_t *eq)
Estimate the time at which the evaluation of properties related to the different terms of an equation...
Definition: cs_equation.c:1273
int cs_equation_get_field_id(const cs_equation_t *eq)
Return the id related to the variable field structure associated to the cs_equation_t structure.
Definition: cs_equation.c:773
const cs_range_set_t * cs_equation_get_range_set(const cs_equation_t *eq)
Return the range set structure associated to a cs_equation_t structure. One assumes that there is onl...
Definition: cs_equation.c:795
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:1229
int cs_equation_get_n_equations(void)
Retrieve the number of equations.
Definition: cs_equation.c:499
void cs_equation_compute_peclet(const cs_equation_t *eq, const cs_time_step_t *ts, cs_real_t peclet[])
Compute and post-process Peclet number if requested.
Definition: cs_equation.c:3835
void cs_equation_solve_deprecated(cs_equation_t *eq)
Solve the linear system for this equation (deprecated)
Definition: cs_equation.c:2881
void() cs_equation_build_hook_t(const cs_equation_param_t *eqp, const cs_equation_builder_t *eqb, const void *eqc, const cs_cell_mesh_t *cm, void *context, cs_hodge_t *mass_hodge, cs_hodge_t *diff_hodge, cs_cell_sys_t *csys, cs_cell_builder_t *cb)
Generic function prototype for a hook during the cellwise building of the linear system Enable an adv...
Definition: cs_equation_builder.h:76
cs_equation_key_t
List of available keys for setting the parameters of an equation.
Definition: cs_equation_param.h:1212
cs_equation_type_t
Type of equations managed by the solver.
Definition: cs_equation_param.h:171
cs_param_space_scheme_t
Type of numerical scheme for the discretization in space.
Definition: cs_param_types.h:211
cs_param_bc_type_t
Definition: cs_param_types.h:476
cs_param_time_scheme_t
Definition: cs_param_types.h:274
struct _cs_restart_t cs_restart_t
Definition: cs_restart.h:95
Definition: cs_equation_priv.h:321
Definition: cs_advection_field.h:150
Definition: cs_cdo_connect.h:61
Definition: cs_cdo_quantities.h:137
Set of local and temporary buffers.
Definition: cs_cdo_local.h:60
Set of arrays and local (small) dense matrices related to a mesh cell This is a key structure for bui...
Definition: cs_cdo_local.h:147
Store common elements used when building an algebraic system related to an equation.
Main structures on which an equation structure relies.
Definition: cs_equation.h:82
void * scheme_context
Definition: cs_equation.h:86
cs_equation_builder_t * builder
Definition: cs_equation.h:85
cs_equation_param_t * param
Definition: cs_equation.h:84
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources.
Definition: cs_equation_param.h:192
Main structure to handle the discretization and the resolution of an equation.
Field descriptor.
Definition: cs_field.h:131
Structure associated to the definition of a property relying on the cs_xdef_t structure.
Definition: cs_range_set.h:57
time step descriptor
Definition: cs_time_step.h:64