![]() |
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 <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_cdofb_codits.h"
Macros | |
#define | CDOFB_CODITS_DBG 0 |
Functions | |
static void | _compute_cell_field (const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, int sys_id) |
Post-process the solution of a scalar convection/diffusion equation solved with a CDO face-based scheme. More... | |
static void | _init_bc_structures (const cs_mesh_t *m, cs_cdofb_codits_t *sys) |
Initialize structures related to boundary conditions. More... | |
static cs_sla_matrix_t * | _init_diffusion_matrix (const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant) |
Allocate and initialize the matrix related to the diffusion op. Note: values are filled in a second step. 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, cs_real_t tcur, cs_cdofb_codits_t *sys) |
Define the final (reduced) matrix for diffusion and its right hand side (RHS). RHS is the sum of three contributions. More... | |
static void | _map_to_matrix (cs_cdofb_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_cdofb_codits_create_all (int n_scal_systems) |
Allocate the required number of scalar equations based on a face based discretization. More... | |
void | cs_cdofb_codits_init (const cs_param_eq_t *eq, const cs_mesh_t *m, int eq_id) |
Initialize a cs_cdofb_codits_t. More... | |
void | cs_cdofb_codits_free_all (void) |
Destroy all cs_cdofb_codits_t structures. More... | |
void | cs_cdofb_codits_solve (const cs_mesh_t *m, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, double tcur, int sys_id) |
Solve a scalar convection/diffusion equation with a CDO face-based scheme. More... | |
void | cs_cdofb_codits_post (const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, int sys_id) |
Post-process the solution of a scalar convection/diffusion equation solved with a CDO face-based scheme. More... | |
const double * | cs_cdofb_codits_get_face_values (int eq_id) |
Get the computed values at each face. More... | |
Variables | |
static int | cs_cdofb_n_scal_systems = 0 |
static cs_cdofb_codits_t * | cs_cdofb_scal_systems = NULL |
#define CDOFB_CODITS_DBG 0 |
|
static |
Define the final (reduced) matrix for diffusion and its right hand side (RHS). RHS is the sum of three 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_cdofb_codits_t struct. |
|
static |
Post-process the solution of a scalar convection/diffusion equation solved with a CDO face-based scheme.
[in] | connect | pointer to a cs_cdo_connect_t struct. |
[in] | quant | pointer to a cs_cdo_quantities_t struct. |
[in] | sys_id | id of the equation/system to treat |
|
static |
Initialize structures related to boundary conditions.
[in] | m | pointer to the mesh structure |
[in,out] | sys | pointer to a cs_cdofb_codits_t structure |
|
static |
Allocate and initialize the matrix related to the diffusion op. Note: values are filled in a second step.
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | quant | pointer to a cs_cdo_quantities_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_cdofb_codits_create_all | ( | int | n_scal_systems | ) |
Allocate the required number of scalar equations based on a face based discretization.
[in] | n_scal_systems | number of scalar equations |
void cs_cdofb_codits_free_all | ( | void | ) |
Destroy all cs_cdofb_codits_t structures.
const double* cs_cdofb_codits_get_face_values | ( | int | eq_id | ) |
Get the computed values at each face.
[in] | eq_id | id related to a cs_param_eq_t struct. |
void cs_cdofb_codits_init | ( | const cs_param_eq_t * | eq, |
const cs_mesh_t * | m, | ||
int | eq_id | ||
) |
Initialize a cs_cdofb_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 to treat |
void cs_cdofb_codits_post | ( | const cs_cdo_connect_t * | connect, |
const cs_cdo_quantities_t * | quant, | ||
int | sys_id | ||
) |
Post-process the solution of a scalar convection/diffusion equation solved with a CDO face-based scheme.
[in] | connect | pointer to a cs_cdo_connect_t struct. |
[in] | quant | pointer to a cs_cdo_quantities_t struct. |
[in] | sys_id | id of the equation/system to treat |
void cs_cdofb_codits_solve | ( | const cs_mesh_t * | m, |
const cs_cdo_connect_t * | connect, | ||
const cs_cdo_quantities_t * | quant, | ||
double | tcur, | ||
int | sys_id | ||
) |
Solve a scalar convection/diffusion equation with a CDO face-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] | sys_id | pointer to a cs_cdofb_codits_t struct. |
|
static |
|
static |