1 #ifndef __CS_EQUATION_COMMON_H__ 2 #define __CS_EQUATION_COMMON_H__ 65 #define CS_EQUATION_SYNC_ZERO_VALUE 1 66 #define CS_EQUATION_SYNC_MEAN_VALUE 2 94 const void *eq_context,
253 cs_equation_cell_mesh_flag(
cs_flag_t cell_flag,
256 cs_eflag_t _flag = eqb->msh_flag | eqb->st_msh_flag;
259 _flag |= eqb->bd_msh_flag;
358 double *normalization);
int cs_equation_solve_scalar_system(cs_lnum_t n_scatter_dofs, const cs_param_sles_t *slesp, const cs_matrix_t *matrix, const cs_range_set_t *rset, cs_real_t normalization, bool rhs_redux, cs_sles_t *sles, cs_real_t *x, cs_real_t *b)
Solve a linear system arising from CDO schemes with scalar-valued degrees of freedom.
Definition: cs_equation_common.c:601
Store common elements used when building an algebraic system related to an equation.
time step descriptor
Definition: cs_time_step.h:64
cs_timer_counter_t tcs
Definition: cs_equation_common.h:206
Definition: cs_equation_common.h:106
bool diff_pty_uniform
Definition: cs_equation_common.h:132
cs_param_resnorm_type_t
Definition: cs_param_types.h:722
unsigned char cs_mask_t
Definition: cs_flag.h:143
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources...
Definition: cs_equation_param.h:202
void cs_equation_free_builder(cs_equation_builder_t **p_builder)
Free a cs_equation_builder_t structure.
Definition: cs_equation_common.c:357
cs_source_term_cellwise_t * compute_source[CS_N_MAX_SOURCE_TERMS]
Definition: cs_equation_common.h:154
Definition: cs_mesh_adjacencies.h:67
cs_real_t * boundary_term
Definition: cs_equation_common.h:233
#define BEGIN_C_DECLS
Definition: cs_defs.h:495
cs_real_t * balance
Definition: cs_equation_common.h:225
int cs_equation_solve_scalar_cell_system(cs_lnum_t n_dofs, const cs_param_sles_t *slesp, const cs_matrix_t *matrix, cs_real_t normalization, cs_sles_t *sles, cs_real_t *x, cs_real_t *b)
Solve a linear system arising with scalar-valued cell-based DoFs.
Definition: cs_equation_common.c:533
cs_lnum_t size
Definition: cs_equation_common.h:224
Set of local quantities and connectivities related to a mesh cell This is a key structure for all cel...
Definition: cs_cdo_local.h:159
bool graddiv_pty_uniform
Definition: cs_equation_common.h:134
void cs_equation_init_reaction_properties(const cs_equation_param_t *eqp, const cs_equation_builder_t *eqb, cs_real_t t_eval, cs_cell_builder_t *cb)
Initialize all reaction properties. This function is shared across all CDO schemes. The cs_cell_builder_t structure stores the computed property values.
Definition: cs_equation_common.c:726
void cs_equation_init_properties(const cs_equation_param_t *eqp, const cs_equation_builder_t *eqb, cs_hodge_t *diffusion_hodge, cs_cell_builder_t *cb)
Initialize all properties potentially useful to build the algebraic system. This function is shared a...
Definition: cs_equation_common.c:794
cs_equation_balance_t * cs_equation_balance_create(cs_flag_t location, cs_lnum_t size)
Allocate a cs_equation_balance_t structure.
Definition: cs_equation_common.c:1150
void cs_equation_sync_rhs_normalization(cs_param_resnorm_type_t type, cs_lnum_t rhs_size, const cs_real_t rhs[], double *normalization)
Compute the value of the renormalization coefficient for the the residual norm of the linear system A...
Definition: cs_equation_common.c:393
cs_flag_t location
Definition: cs_equation_common.h:223
Definition: cs_cdo_connect.h:76
cs_mask_t * source_mask
Definition: cs_equation_common.h:145
Structure associated to a discrete Hodge operator.
Definition: cs_hodge.h:189
void cs_equation_enforced_internal_dofs(const cs_equation_param_t *eqp, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
Take into account the enforcement of internal DoFs. Apply an algebraic manipulation.
Definition: cs_equation_common.c:919
double cs_real_t
Floating-point value.
Definition: cs_defs.h:307
Definition: cs_cdo_quantities.h:124
void matrix(const int *iconvp, const int *idiffp, const int *ndircp, const int *isym, const cs_real_t *thetap, const int *imucpp, const cs_real_t coefbp[], const cs_real_t cofbfp[], const cs_real_t rovsdt[], const cs_real_t i_massflux[], const cs_real_t b_massflux[], const cs_real_t i_visc[], const cs_real_t b_visc[], const cs_real_t xcpp[], cs_real_t da[], cs_real_t xa[])
Definition: cs_matrix_building.c:112
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:107
cs_real_t * advection_term
Definition: cs_equation_common.h:231
struct _cs_matrix_t cs_matrix_t
Definition: cs_matrix.h:94
bool reac_pty_uniform[CS_CDO_N_MAX_REACTIONS]
Definition: cs_equation_common.h:136
cs_flag_t sys_flag
Definition: cs_equation_common.h:124
cs_real_t * source_term
Definition: cs_equation_common.h:232
struct _cs_sles_t cs_sles_t
Definition: cs_sles.h:68
Definition: cs_equation_common.h:220
bool time_pty_uniform
Definition: cs_equation_common.h:135
void cs_equation_common_init(const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *time_step, cs_flag_t eb_flag, cs_flag_t fb_flag, cs_flag_t vb_flag, cs_flag_t vcb_flag, cs_flag_t hho_flag)
Allocate a pointer to a buffer of size at least the n_cells for managing temporary usage of memory wh...
Definition: cs_equation_common.c:123
cs_real_t * reaction_term
Definition: cs_equation_common.h:229
cs_equation_builder_t * cs_equation_init_builder(const cs_equation_param_t *eqp, const cs_mesh_t *mesh)
Allocate a new structure to handle the building of algebraic system related to an cs_equation_t struc...
Definition: cs_equation_common.c:267
Definition: cs_cdo_bc.h:88
cs_eflag_t st_msh_flag
Definition: cs_equation_common.h:121
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:1119
cs_cdo_bc_face_t * face_bc
Definition: cs_equation_common.h:192
Definition: cs_range_set.h:57
void cs_equation_build_dof_enforcement(cs_lnum_t n_x, const cs_adjacency_t *c2x, const cs_equation_param_t *eqp, cs_lnum_t *p_dof_ids[])
Build the list of degrees of freedom (DoFs) related to an internal enforcement. If set to NULL...
Definition: cs_equation_common.c:848
Set of local and temporary buffers useful for building the algebraic system with a cellwise process...
Definition: cs_cdo_local.h:69
Structure storing medata for defining a quantity in a very flexible way.
Definition: cs_xdef.h:154
bool curlcurl_pty_uniform
Definition: cs_equation_common.h:133
cs_eflag_t bd_msh_flag
Definition: cs_equation_common.h:118
void cs_equation_balance_reset(cs_equation_balance_t *b)
Reset a cs_equation_balance_t structure.
Definition: cs_equation_common.c:1186
cs_eflag_t msh_flag
Definition: cs_equation_common.h:115
cs_equation_user_hook_t * user_hook_function
Definition: cs_equation_common.h:177
#define CS_CDO_N_MAX_REACTIONS
Definition: cs_param_cdo.h:70
cs_real_t * diffusion_term
Definition: cs_equation_common.h:230
void cs_equation_write_monitoring(const char *eqname, const cs_equation_builder_t *eqb)
Print a message in the performance output file related to the monitoring of equation.
Definition: cs_equation_common.c:689
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:301
void cs_equation_balance_sync(const cs_cdo_connect_t *connect, cs_equation_balance_t *b)
Synchronize balance terms if this is a parallel computation.
Definition: cs_equation_common.c:1211
void cs_equation_prepare_system(int stride, cs_lnum_t x_size, const cs_matrix_t *matrix, const cs_range_set_t *rset, bool rhs_redux, cs_real_t *x, cs_real_t *b)
Prepare a linear system and synchronize buffers to handle parallelism. Transfer a mesh-based descript...
Definition: cs_equation_common.c:449
#define END_C_DECLS
Definition: cs_defs.h:496
unsigned short int cs_flag_t
Definition: cs_defs.h:309
void cs_equation_sync_vertex_mean_values(const cs_cdo_connect_t *connect, int dim, int *counter, cs_real_t *values)
Compute the mean-value across ranks at each vertex.
Definition: cs_equation_common.c:1558
void cs_equation_sync_vol_def_at_edges(const cs_cdo_connect_t *connect, int n_defs, cs_xdef_t **defs, cs_lnum_t def2e_idx[], cs_lnum_t def2e_ids[])
Synchronize the volumetric definitions to consider at each edge.
Definition: cs_equation_common.c:1365
#define CS_N_MAX_SOURCE_TERMS
Definition: cs_source_term.h:49
cs_real_t * unsteady_term
Definition: cs_equation_common.h:228
bool init_step
Definition: cs_equation_common.h:108
unsigned int cs_eflag_t
Definition: cs_flag.h:166
size_t cs_equation_get_tmpbuf_size(void)
Get the allocation size of the temporary buffer.
Definition: cs_equation_common.c:1133
void cs_equation_sync_vol_def_at_faces(const cs_cdo_connect_t *connect, int n_defs, cs_xdef_t **defs, cs_lnum_t def2f_idx[], cs_lnum_t def2f_ids[])
Synchronize the volumetric definitions to consider at each face.
Definition: cs_equation_common.c:1462
void * user_hook_context
Definition: cs_equation_common.h:176
void() cs_equation_user_hook_t(const cs_equation_param_t *eqp, const cs_equation_builder_t *eqb, const void *eq_context, const cs_cell_mesh_t *cm, 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_common.h:92
void cs_equation_sync_vol_def_at_vertices(const cs_cdo_connect_t *connect, int n_defs, cs_xdef_t **defs, cs_lnum_t def2v_idx[], cs_lnum_t def2v_ids[])
Synchronize the volumetric definitions to consider at each vertex.
Definition: cs_equation_common.c:1268
void cs_equation_balance_destroy(cs_equation_balance_t **p_balance)
Free a cs_equation_balance_t structure.
Definition: cs_equation_common.c:1242
Structure and routines handling the specific settings related to a cs_equation_t structure.
void cs_equation_common_finalize(void)
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:245
void cs_equation_enforced_internal_block_dofs(const cs_equation_param_t *eqp, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
Take into account the enforcement of internal DoFs. Case of matrices defined by blocks. Apply an algebraic manipulation.
Definition: cs_equation_common.c:1006
cs_timer_counter_t tcb
Definition: cs_equation_common.h:204
Structure storing all metadata related to the resolution of a linear system with an iterative solver...
Definition: cs_param_sles.h:62
void cs_equation_set_reaction_properties_cw(const cs_equation_param_t *eqp, const cs_equation_builder_t *eqb, const cs_cell_mesh_t *cm, cs_cell_builder_t *cb)
Initialize all reaction properties. This function is shared across all CDO schemes. The cs_cell_builder_t structure stores the computed property values. If the property is uniform, a first call to the function cs_equation_init_reaction_properties or to the function cs_equation_init_properties has to be done before the loop on cells.
Definition: cs_equation_common.c:761
void() cs_source_term_cellwise_t(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values...
Definition: cs_source_term.h:85
Definition: cs_timer.h:57
double precision, save b
Definition: cs_fuel_incl.f90:146
cs_timer_counter_t tce
Definition: cs_equation_common.h:208
#define CS_FLAG_BOUNDARY_CELL_BY_FACE
(= 1) boundary cell with at least one border face
Definition: cs_flag.h:62