Build an algebraic CDO vertex-based system for a set of coupled unsteady convection-diffusion-reaction of scalar-valued equations with source terms. More...
#include "cs_defs.h"#include <assert.h>#include <math.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <bft_mem.h>#include "cs_array.h"#include "cs_cdo_assembly.h"#include "cs_cdo_system.h"#include "cs_cdovb_priv.h"#include "cs_cdovb_scaleq.h"#include "cs_matrix.h"#include "cs_parameters.h"#include "cs_sles.h"#include "cs_cdovb_scalsys.h" Include dependency graph for cs_cdovb_scalsys.c:
 Include dependency graph for cs_cdovb_scalsys.c:| Macros | |
| #define | CS_CDOVB_SCALSYS_DBG 0 | 
| Typedefs | |
| typedef void() | cs_cdovb_scalsys_build_t(bool cur2prev, int n_equations, cs_equation_core_t **blocks, cs_cdovb_scalsys_t *scalsys, cs_field_t **fields, cs_cdo_system_helper_t *sh) | 
| Build the linear system of equations. The number of rows in the system is equal to the number of equations. Thus there are n_eqs*n_eqs blocks in the system. Each block corresponds potentially to a scalar-valued unsteady convection/diffusion/reaction equation with a CDO-Vb scheme.  More... | |
| typedef void() | cs_cdovb_scalsys_asb_t(const cs_cell_sys_t *csys, cs_cdo_system_helper_t *sh, cs_equation_builder_t *eqb, cs_cdo_assembly_t *asb) | 
| Generic function pointer to perform the assembly step. Add the block attached to the block (row_id, col_id) in the full (coupled) system.  More... | |
| typedef int() | cs_cdovb_scalsys_solve_t(int n_eqs, cs_lnum_t n_dofs, const cs_equation_system_param_t *sysp, cs_cdo_system_helper_t *sh, cs_field_t **fields) | 
| Solve a linear system arising for a system of equations relying on scalar-valued CDO vertex-based schemes.  More... | |
| Functions | |
| void | cs_cdovb_scalsys_init_sharing (const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *time_step) | 
| Set pointers to the main shared structures.  More... | |
| void * | cs_cdovb_scalsys_define (int n_eqs, const cs_equation_system_param_t *sysp, cs_equation_core_t **block_factories, cs_cdo_system_helper_t **p_sh) | 
| Create and initialize factories for extra-diagonal blocks Build equation builders and scheme context structures for each equation which are in the extra-diagonal blocks related to a system of equations. Structures associated to diagonal blocks should be already initialized during the treatment of the classical full equations.  More... | |
| void * | cs_cdovb_scalsys_free (int n_eqs, cs_equation_core_t **blocks, void *sys_context) | 
| Free an array of structures (equation parameters, equation builders or scheme context) for each equation which are in the extra-diagonal blocks related to a system of equations. Structures associated to diagonal blocks are freed during the treatment of the classical full equations.  More... | |
| void | cs_cdovb_scalsys_solve_implicit (bool cur2prev, int n_equations, cs_equation_system_param_t *sysp, cs_equation_core_t **blocks, void *sys_context, cs_cdo_system_helper_t *sh) | 
| Build and solve the linear system of equations. The number of rows in the system is equal to the number of equations. Thus there are n_eqs*n_eqs blocks in the system. Each block corresponds potentially to a scalar-valued unsteady convection/diffusion/reaction equation with a CDO-Vb scheme using an implicit time scheme.  More... | |
Build an algebraic CDO vertex-based system for a set of coupled unsteady convection-diffusion-reaction of scalar-valued equations with source terms.
| #define CS_CDOVB_SCALSYS_DBG 0 | 
| typedef void() cs_cdovb_scalsys_asb_t(const cs_cell_sys_t *csys, cs_cdo_system_helper_t *sh, cs_equation_builder_t *eqb, cs_cdo_assembly_t *asb) | 
Generic function pointer to perform the assembly step. Add the block attached to the block (row_id, col_id) in the full (coupled) system.
| [in] | csys | pointer to a cellwise view of the system | 
| [in,out] | sh | pointer to the system helper of the coupled sys. | 
| [in,out] | eqc | context for this kind of discretization | 
| [in,out] | asb | pointer to a cs_cdo_assembly_t structure | 
| typedef void() cs_cdovb_scalsys_build_t(bool cur2prev, int n_equations, cs_equation_core_t **blocks, cs_cdovb_scalsys_t *scalsys, cs_field_t **fields, cs_cdo_system_helper_t *sh) | 
Build the linear system of equations. The number of rows in the system is equal to the number of equations. Thus there are n_eqs*n_eqs blocks in the system. Each block corresponds potentially to a scalar-valued unsteady convection/diffusion/reaction equation with a CDO-Vb scheme.
| [in] | cur2prev | do a "current to previous" operation ? | 
| [in] | n_eqs | number of equations | 
| [in,out] | blocks | array of the core members for an equation | 
| [in,out] | scalsys | pointer to a cs_cdovb_scalsys_t structure | 
| [in,out] | fields | array of pointers to the associated fields | 
| [in,out] | sh | pointer to a system helper structure | 
| typedef int() cs_cdovb_scalsys_solve_t(int n_eqs, cs_lnum_t n_dofs, const cs_equation_system_param_t *sysp, cs_cdo_system_helper_t *sh, cs_field_t **fields) | 
Solve a linear system arising for a system of equations relying on scalar-valued CDO vertex-based schemes.
| [in] | n_eqs | number of equations constituting the system | 
| [in] | n_dofs | local number of DoFs (may be != n_gather_elts) | 
| [in] | sysp | parameter settings | 
| [in,out] | sh | pointer to the system helper structure | 
| [in,out] | fields | array of field pointers (one for each eq.) | 
| void* cs_cdovb_scalsys_define | ( | int | n_eqs, | 
| const cs_equation_system_param_t * | sysp, | ||
| cs_equation_core_t ** | block_factories, | ||
| cs_cdo_system_helper_t ** | p_sh | ||
| ) | 
Create and initialize factories for extra-diagonal blocks Build equation builders and scheme context structures for each equation which are in the extra-diagonal blocks related to a system of equations. Structures associated to diagonal blocks should be already initialized during the treatment of the classical full equations.
Case of scalar-valued CDO-Vb scheme in each block
| [in] | n_eqs | number of equations | 
| [in] | sysp | set of parameters to specify a system of eqs | 
| [in,out] | block_factories | array of the core members for an equation | 
| [out] | p_sh | system helper structure to initialize | 
| void* cs_cdovb_scalsys_free | ( | int | n_eqs, | 
| cs_equation_core_t ** | blocks, | ||
| void * | sys_context | ||
| ) | 
Free an array of structures (equation parameters, equation builders or scheme context) for each equation which are in the extra-diagonal blocks related to a system of equations. Structures associated to diagonal blocks are freed during the treatment of the classical full equations.
Case of scalar-valued CDO-Vb scheme in each block
| [in] | n_eqs | number of equations | 
| [in,out] | blocks | array of the core structures for an equation | 
| [in,out] | sys_context | pointer to a structure cast on-the-fly | 
| void cs_cdovb_scalsys_init_sharing | ( | const cs_mesh_t * | mesh, | 
| const cs_cdo_connect_t * | connect, | ||
| const cs_cdo_quantities_t * | quant, | ||
| const cs_time_step_t * | time_step | ||
| ) | 
Set pointers to the main shared structures.
| [in] | mesh | basic mesh structure | 
| [in] | connect | pointer to a cs_cdo_connect_t struct. | 
| [in] | quant | additional mesh quantities struct. | 
| [in] | time_step | pointer to a time step structure | 
| void cs_cdovb_scalsys_solve_implicit | ( | bool | cur2prev, | 
| int | n_equations, | ||
| cs_equation_system_param_t * | sysp, | ||
| cs_equation_core_t ** | blocks, | ||
| void * | sys_context, | ||
| cs_cdo_system_helper_t * | sh | ||
| ) | 
Build and solve the linear system of equations. The number of rows in the system is equal to the number of equations. Thus there are n_eqs*n_eqs blocks in the system. Each block corresponds potentially to a scalar-valued unsteady convection/diffusion/reaction equation with a CDO-Vb scheme using an implicit time scheme.
| [in] | cur2prev | do a "current to previous" operation ? | 
| [in] | n_equations | number of equations | 
| [in] | sysp | set of paremeters for the system of equations | 
| [in,out] | blocks | array of the core members for an equation | 
| [in,out] | sys_context | pointer to a structure cast on-the-fly | 
| [in,out] | sh | pointer to a system helper structure |