![]() |
programmer's documentation
|
#include "cs_defs.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
#include <assert.h>
#include <string.h>
#include <limits.h>
#include <bft_mem.h>
#include <bft_printf.h>
#include "cs_mesh.h"
#include "cs_timer.h"
#include "cs_timer_stats.h"
#include "cs_log.h"
#include "cs_search.h"
#include "cs_quadrature.h"
#include "cs_evaluate.h"
#include "cs_prototypes.h"
#include "cs_field.h"
#include "cs_matrix.h"
#include "cs_sles.h"
#include "cs_cdo_bc.h"
#include "cs_hodge.h"
#include "cs_cdovb_codits.h"
Macros | |
#define | CDOVB_CODITS_DBG 0 |
Functions | |
static void | _init_bc_structures (const cs_mesh_t *m, cs_cdovb_codits_t *sys) |
Initialize structures related to boundary conditions. More... | |
static void | _compute_rhs (const cs_mesh_t *m, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_sla_matrix_t *ad, double tcur, cs_cdovb_codits_t *sys) |
Compute the right hand side (rhs) for a convection/diffusion equation. Take into account several contributions: –> Dirichlet, Neumann and Robin BCs –> Source terms. More... | |
static cs_sla_matrix_t * | _init_stiffness (cs_lnum_t n_vertices, const cs_cdo_connect_t *connect) |
Initialize a stiffness matrix. More... | |
static void | _encode_edge_masks (cs_lnum_t c_id, int n_bits, int n_blocks, const cs_cdo_connect_t *connect, const short int vtag[], cs_flag_t masks[]) |
Encode E_c cap E_v sets for all vertices of a cell using a mask of bits. More... | |
static cs_sla_matrix_t * | _build_stiffness_matrix (const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, cs_cdovb_codits_t *sys) |
Define the full stiffness matrix and the matrix related to the discrete Hodge operator from a cellwise assembly process. More... | |
static cs_sla_matrix_t * | _build_diffusion_system (const cs_mesh_t *m, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, double tcur, cs_cdovb_codits_t *sys) |
Define the matrix "Ad" for the diffusion term and its right hand side (rhs). rhs potentially collects these contributions: More... | |
static void | _map_to_matrix (cs_cdovb_codits_t *sys, cs_sla_matrix_t *sla_mat) |
Switch the matrix represenation from a cs_sla_matrix_t struct. to a cs_matrix_t struct. sla_mat is freed inside this routine. More... | |
static void | _solve_linear_system (const cs_param_eq_t *eq, const cs_matrix_t *a, const cs_real_t *rhs, cs_real_t *x) |
Solve a linear system Ax = b arising from a CDO vertex-based scheme. More... | |
void | cs_cdovb_codits_create_all (int n_scal_systems) |
Allocate the required number of scalar equations based on a vertex based discretization. More... | |
void | cs_cdovb_codits_init (const cs_param_eq_t *eq, const cs_mesh_t *m, int eq_id) |
Initialize a cs_cdovb_codits_t. More... | |
void | cs_cdovb_codits_free_all (void) |
Destroy all cs_cdovb_codits_t structures. More... | |
void | cs_cdovb_codits_solve (const cs_mesh_t *m, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, double tcur, int eq_id) |
Solve a scalar convection/diffusion equation with a CDO vertex-based scheme. More... | |
void | cs_cdovb_codits_post (const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, int eq_id) |
Post-process the solution of a scalar convection/diffusion equation solved with a CDO vertex-based scheme. More... | |
Variables | |
static int | cs_cdovb_n_scal_systems = 0 |
static cs_cdovb_codits_t * | cs_cdovb_scal_systems = NULL |
#define CDOVB_CODITS_DBG 0 |
|
static |
Define the matrix "Ad" for the diffusion term and its right hand side (rhs). rhs potentially collects these contributions:
[in] | m | pointer to a cs_mesh_t structure |
[in] | connect | pointer to a cs_cdo_connect_t struct. |
[in] | quant | pointer to a cs_cdo_quantities_t struct. |
[in] | tcur | current physical time of the simulation |
[in,out] | sys | pointer to a cs_cdovb_codits_t struct. |
|
static |
Define the full stiffness matrix and the matrix related to the discrete Hodge operator from a cellwise assembly process.
[in] | connect | pointer to a cs_cdo_connect_t struct. |
[in] | quant | pointer to a cs_cdo_quantities_t struct. |
[in,out] | sys | pointer to a cs_cdovb_codits_t struct. |
|
static |
Compute the right hand side (rhs) for a convection/diffusion equation. Take into account several contributions: –> Dirichlet, Neumann and Robin BCs –> Source terms.
[in] | m | pointer to a cs_mesh_t structure |
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | quant | pointer to a cs_cdo_quantities_t structure |
[in] | ad | pointer to the (full) diffusion matrix |
[in] | tcur | current physical time of the simulation |
[in,out] | sys | pointer to a cs_cdovb_codits_t structure |
|
static |
Encode E_c cap E_v sets for all vertices of a cell using a mask of bits.
[in] | c_id | cell id |
[in] | n_bits | number of bits in a block |
[in] | n_blocks | number of blocks in a mask |
[in] | connect | point to a cs_cdo_connect_t struct. |
[in] | vtag | buffer of tag indicating the local vertex id |
[in,out] | masks | list of masks |
|
static |
Initialize structures related to boundary conditions.
[in] | m | pointer to the mesh structure |
[in,out] | sys | pointer to a cs_cdovb_codits_t structure |
|
static |
Initialize a stiffness matrix.
[in] | n_vertices | number of vertices |
[in] | connect | pointer to a cs_cdo_connect_t structure |
|
static |
Switch the matrix represenation from a cs_sla_matrix_t struct. to a cs_matrix_t struct. sla_mat is freed inside this routine.
[in,out] | sys | pointer to a cs_cdovb_codits_t struct. |
[in,out] | sla_mat | pointer to a cs_sla_matrix_t struct. |
|
static |
Solve a linear system Ax = b arising from a CDO vertex-based scheme.
[in] | eq | pointer to a cs_param_eq_t structure |
[in] | a | pointer to a cs_matrix_t struct. |
[in] | rhs | right-hand side |
[in,out] | x | array of unkowns |
void cs_cdovb_codits_create_all | ( | int | n_scal_systems | ) |
Allocate the required number of scalar equations based on a vertex based discretization.
[in] | n_scal_systems | number of scalar equations |
void cs_cdovb_codits_free_all | ( | void | ) |
Destroy all cs_cdovb_codits_t structures.
void cs_cdovb_codits_init | ( | const cs_param_eq_t * | eq, |
const cs_mesh_t * | m, | ||
int | eq_id | ||
) |
Initialize a cs_cdovb_codits_t.
[in] | eq | pointer to a structure storing parameters of an eq. |
[in] | m | pointer to a mesh structure |
[in] | eq_id | id related to the equation/system to treat |
void cs_cdovb_codits_post | ( | const cs_cdo_connect_t * | connect, |
const cs_cdo_quantities_t * | quant, | ||
int | eq_id | ||
) |
Post-process the solution of a scalar convection/diffusion equation solved with a CDO vertex-based scheme.
[in] | connect | pointer to a cs_cdo_connect_t struct. |
[in] | quant | pointer to a cs_cdo_quantities_t struct. |
[in] | eq_id | id of the equation/system to treat |
void cs_cdovb_codits_solve | ( | const cs_mesh_t * | m, |
const cs_cdo_connect_t * | connect, | ||
const cs_cdo_quantities_t * | quant, | ||
double | tcur, | ||
int | eq_id | ||
) |
Solve a scalar convection/diffusion equation with a CDO vertex-based scheme.
[in] | m | pointer to a cs_mesh_t structure |
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | quant | pointer to a cs_cdo_quantities_t structure |
[in] | tcur | current physical time of the simulation |
[in] | eq_id | pointer to a cs_cdovb_codits_t struct. |
|
static |
|
static |