1 #ifndef __CS_CDOFB_VECTEQ_H__ 2 #define __CS_CDOFB_VECTEQ_H__ 216 const cs_cdofb_vecteq_t *eqc,
262 const cs_cdofb_vecteq_t *eqc,
285 const cs_cdofb_vecteq_t *eqc,
329 const short int _off = 3*cm->
n_fc;
330 csys->
rhs[_off ] += coef * csys->
source[_off ];
331 csys->
rhs[_off + 1] += coef * csys->
source[_off + 1];
332 csys->
rhs[_off + 2] += coef * csys->
source[_off + 2];
376 const bool has_sourceterm,
377 cs_cdofb_vecteq_t *eqc,
384 const short int n_f_dofs = 3*cm->
n_fc;
387 eqc->assemble(csys, rs, eqa, mav);
390 # pragma omp critical 392 for (
short int f = 0; f < n_f_dofs; f++)
398 if (has_sourceterm) {
400 for (
int k = 0;
k < 3;
k++)
555 void *scheme_context);
571 void *scheme_context);
Definition: cs_field_pointer.h:70
void * cs_cdofb_vecteq_init_context(const cs_equation_param_t *eqp, int var_id, int bflux_id, cs_equation_builder_t *eqb)
Initialize a cs_cdofb_vecteq_t structure storing data useful for building and managing such a scheme...
Definition: cs_cdofb_vecteq.c:1451
Store common elements used when building an algebraic system related to an equation.
Definition: cs_equation_common.h:61
time step descriptor
Definition: cs_time_step.h:51
Field descriptor.
Definition: cs_field.h:124
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources...
Definition: cs_equation_param.h:148
void cs_cdofb_vecteq_solve_theta(const cs_mesh_t *mesh, const int field_id, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context)
Build and solve the linear system arising from a vector diffusion equation with a CDO-Fb scheme and a...
Definition: cs_cdofb_vecteq.c:1045
struct _cs_matrix_assembler_values_t cs_matrix_assembler_values_t
Definition: cs_matrix_assembler.h:65
void cs_cdofb_vecteq_write_restart(cs_restart_t *restart, const char *eqname, void *scheme_context)
Write additional arrays (not defined as fields) but useful for the checkpoint/restart process...
Definition: cs_cdofb_vecteq.c:1991
double * source
Definition: cs_cdo_local.h:105
cs_lnum_t * dof_ids
Definition: cs_cdo_local.h:100
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
struct _cs_equation_assemble_t cs_equation_assemble_t
Definition: cs_equation_assemble.h:52
void * cs_cdofb_vecteq_free_context(void *data)
Destroy a cs_cdofb_vecteq_t structure.
Definition: cs_cdofb_vecteq.c:1677
Set of local quantities and connectivities related to a mesh cell This is a key structure for all cel...
Definition: cs_cdo_local.h:146
const cs_matrix_structure_t * cs_cdofb_vecteq_matrix_structure(void)
Get the pointer to the related cs_matrix_structure_t.
Definition: cs_cdofb_vecteq.c:1378
Definition: cs_cdo_connect.h:74
bool cs_cdofb_vecteq_is_initialized(void)
Check if the generic structures for building a CDO-Fb scheme are allocated.
Definition: cs_cdofb_vecteq.c:1296
double cs_real_t
Floating-point value.
Definition: cs_defs.h:302
Definition: cs_cdo_quantities.h:94
void cs_cdofb_vecteq_finalize_common(void)
Free work buffer and general structure related to CDO face-based schemes.
Definition: cs_cdofb_vecteq.c:1415
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:111
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:93
void cs_cdofb_vecteq_read_restart(cs_restart_t *restart, const char *eqname, void *scheme_context)
Read additional arrays (not defined as fields) but useful for the checkpoint/restart process...
Definition: cs_cdofb_vecteq.c:1910
struct _cs_matrix_t cs_matrix_t
Definition: cs_matrix.h:90
int n_dofs
Definition: cs_cdo_local.h:98
void cs_cdofb_vecteq_solve_implicit(const cs_mesh_t *mesh, const int field_id, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context)
Build and solve the linear system arising from a vector diffusion equation with a CDO-Fb scheme and a...
Definition: cs_cdofb_vecteq.c:829
double * rhs
Definition: cs_cdo_local.h:104
struct _cs_sles_t cs_sles_t
Definition: cs_sles.h:68
void cs_cdofb_vecteq_diffusion(double time_eval, const cs_equation_param_t *eqp, const cs_equation_builder_t *eqb, const cs_cdofb_vecteq_t *eqc, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_cell_sys_t *csys, cs_cell_builder_t *cb)
Build the local matrices arising from the diffusion, advection, reaction terms in CDO-Fb schemes...
Definition: cs_cdofb_vecteq.c:391
Definition: cs_field_pointer.h:134
cs_lnum_t c_id
Definition: cs_cdo_local.h:157
cs_xdef_t ** source_terms
Definition: cs_equation_param.h:353
short int n_fc
Definition: cs_cdo_local.h:175
void cs_cdofb_vecteq_init_values(cs_real_t t_eval, const int field_id, const cs_mesh_t *mesh, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context)
Set the initial values of the variable field taking into account the boundary conditions. Case of vector-valued CDO-Fb schemes.
Definition: cs_cdofb_vecteq.c:1711
void cs_cdofb_vecteq_advection_diffusion(double time_eval, const cs_equation_param_t *eqp, const cs_cdofb_vecteq_t *eqc, const cs_cell_mesh_t *cm, cs_cell_sys_t *csys, cs_cell_builder_t *cb)
Build the local matrices arising from the diffusion, advection, reaction terms in CDO-Fb schemes...
Definition: cs_cdofb_vecteq.c:455
struct _cs_restart_t cs_restart_t
Definition: cs_restart.h:87
Definition: cs_range_set.h:57
void cs_cdofb_vecteq_init_common(const cs_cdo_quantities_t *quant, const cs_cdo_connect_t *connect, const cs_time_step_t *time_step, const cs_matrix_structure_t *ms)
Allocate work buffer and general structures related to CDO vector-valued face-based schemes...
Definition: cs_cdofb_vecteq.c:1318
Set of local and temporary buffers useful for building the algebraic system with a cellwise process...
Definition: cs_cdo_local.h:56
Structure storing medata for defining a quantity in a very flexible way.
Definition: cs_xdef.h:126
int n_source_terms
Definition: cs_equation_param.h:352
void cs_cdofb_vecteq_solve_steady_state(const cs_mesh_t *mesh, const int field_id, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context)
Build and solve the linear system arising from a vector steady-state diffusion equation with a CDO-Fb...
Definition: cs_cdofb_vecteq.c:638
void cs_cdofb_vecteq_extra_op(const char *eqname, const cs_field_t *field, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *data)
Predefined extra-operations related to this equation.
Definition: cs_cdofb_vecteq.c:1812
static void cs_cdofb_vecteq_assembly(const cs_cell_sys_t *csys, const cs_range_set_t *rs, const cs_cell_mesh_t *cm, const bool has_sourceterm, cs_cdofb_vecteq_t *eqc, cs_equation_assemble_t *eqa, cs_matrix_assembler_values_t *mav, cs_real_t rhs[])
Perform the assembly stage for a vector-valued system obtained with CDO-Fb scheme.
Definition: cs_cdofb_vecteq.h:373
void cs_cdofb_vecteq_init_cell_system(const cs_flag_t cell_flag, const cs_cell_mesh_t *cm, const cs_equation_param_t *eqp, const cs_equation_builder_t *eqb, const cs_cdofb_vecteq_t *eqc, const cs_real_t dir_values[], const cs_real_t field_tn[], cs_real_t t_eval, cs_cell_sys_t *csys, cs_cell_builder_t *cb)
Initialize the local structure for the current cell.
Definition: cs_cdofb_vecteq.c:303
double precision, dimension(:,:), allocatable solu
Definition: atincl.f90:265
#define END_C_DECLS
Definition: cs_defs.h:468
unsigned short int cs_flag_t
Definition: cs_defs.h:304
void cs_cdofb_vecteq_get(cs_cell_sys_t **csys, cs_cell_builder_t **cb)
Retrieve work buffers used for building a CDO system cellwise.
Definition: cs_cdofb_vecteq.c:1393
static void cs_cdofb_vecteq_sourceterm(const cs_cell_mesh_t *cm, const cs_equation_param_t *eqp, const cs_real_t t_eval, const cs_real_t coef, cs_cell_builder_t *cb, cs_equation_builder_t *eqb, cs_cell_sys_t *csys)
Compute the term source for a vector-valued CDO-Fb scheme and add it to the local rhs...
Definition: cs_cdofb_vecteq.h:307
Definition: cs_cdofb_priv.h:51
int cs_cdofb_vecteq_solve_system(cs_sles_t *sles, const cs_matrix_t *matrix, const cs_equation_param_t *eqp, cs_real_t *x, cs_real_t *b)
Solve a linear system arising from a scalar-valued CDO-Fb scheme.
Definition: cs_cdofb_vecteq.c:545
Set of local quantities and connectivities related to a mesh face Structure used to get a better memo...
Definition: cs_cdo_local.h:212
cs_real_t * cs_cdofb_vecteq_get_face_values(void *context)
Retrieve an array of values at mesh faces for the current context. The lifecycle of this array is man...
Definition: cs_cdofb_vecteq.c:1888
void cs_cdofb_vecteq_setup_bc(cs_real_t t_eval, const cs_mesh_t *mesh, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, cs_real_t *p_dir_values[])
Set the boundary conditions known from the settings.
Definition: cs_cdofb_vecteq.c:259
cs_mask_t * source_mask
Definition: cs_equation_common.h:98
Structure and routines handling the specific settings related to a cs_equation_t structure.
cs_source_term_cellwise_t * compute_source[CS_N_MAX_SOURCE_TERMS]
Definition: cs_equation_common.h:107
void cs_source_term_compute_cellwise(const int n_source_terms, cs_xdef_t *const *source_terms, const cs_cell_mesh_t *cm, const cs_mask_t *source_mask, cs_source_term_cellwise_t *compute_source[], cs_real_t time_eval, void *input, cs_cell_builder_t *cb, cs_real_t *result)
Compute the local contributions of source terms in a cell.
Definition: cs_source_term.c:799
struct _cs_matrix_structure_t cs_matrix_structure_t
Definition: cs_matrix.h:86
void cs_cdofb_vecteq_update_field(const cs_real_t *solu, const cs_real_t *rhs, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *data, cs_real_t *field_val)
Store solution(s) of the linear system into a field structure Update extra-field values if required (...
cs_real_t * cs_cdofb_vecteq_get_cell_values(void *context)
Get the computed values at mesh cells from the inverse operation w.r.t. the static condensation (DoF ...
Definition: cs_cdofb_vecteq.c:1867
double precision, save b
Definition: cs_fuel_incl.f90:146