![]() |
programmer's documentation
|
Build discrete stiffness matrices and handled boundary conditions for diffusion term in CDO vertex-based and vertex+cell schemes. More...
#include "cs_defs.h"
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <math.h>
#include <bft_mem.h>
#include <bft_printf.h>
#include "cs_cdo_scheme_geometry.h"
#include "cs_math.h"
#include "cs_property.h"
#include "cs_cdo_diffusion.h"
Functions | |
static cs_locmat_t * | _compute_wbs_stiffness (const cs_cdo_quantities_t *quant, const cs_cell_mesh_t *cm, const cs_real_3_t *tensor, cs_cdo_diff_t *diff) |
Compute the stiffness matrix on this cell using a Whitney Barycentric Subdivision (WBS) algo. More... | |
static cs_locmat_t * | _compute_vcb_stiffness (const cs_cdo_quantities_t *quant, const cs_cell_mesh_t *cm, const cs_real_3_t *tensor, cs_cdo_diff_t *diff) |
Compute the stiffness matrix on the current cell using a Whitney Barycentric Subdivision (WBS) algo and a V+C CDO scheme. More... | |
static void | _ntrgrd_cost_algo (short int f, const cs_cell_mesh_t *cm, const cs_real_3_t mnu, double beta, cs_cdo_diff_t *diff, cs_locmat_t *ntrgrd) |
Compute the normal trace operator for a given border face when a COST algo. is used for reconstructing the degrees of freedom. More... | |
static void | _ntrgrd_wbs_algo (const cs_face_mesh_t *fm, const cs_cell_mesh_t *cm, const cs_real_3_t pty_nuf, cs_cdo_diff_t *diff, cs_locmat_t *ntrgrd) |
Compute the normal trace operator for a given border face when a WBS algo. is used for reconstructing the degrees of freedom. More... | |
static void | _ntrgrd_vcb_algo (const cs_face_mesh_t *fm, const cs_cell_mesh_t *cm, const cs_real_3_t pty_nuf, cs_cdo_diff_t *diff, cs_locmat_t *ntrgrd) |
Compute the normal trace operator for a given border face when a WBS algo. and a V+C scheme is considered. More... | |
cs_cdo_diff_t * | cs_cdo_diffusion_builder_init (const cs_cdo_connect_t *connect, cs_space_scheme_t space_scheme, bool is_uniform, const cs_param_hodge_t h_info, const cs_param_bc_enforce_t bc_enforce) |
Initialize a builder structure used to build the stiffness matrix. More... | |
cs_cdo_diff_t * | cs_cdo_diffusion_builder_free (cs_cdo_diff_t *diff) |
Free a cs_cdo_diff_t structure. More... | |
cs_hodge_builder_t * | cs_cdo_diffusion_get_hodge_builder (cs_cdo_diff_t *diff) |
Get the related Hodge builder structure. More... | |
void | cs_cdo_diffusion_get_tmp_buffers (const cs_cdo_diff_t *diff, cs_real_3_t **tmp_vec, cs_real_t **tmp_sca) |
Get temporary buffers attached to a cs_cdo_diff_t structure. More... | |
void | cs_cdo_diffusion_build_c2bcbf (const cs_cdo_connect_t *connect, const cs_cdo_bc_list_t *dir_face, cs_lnum_t *p_c2bcbf_idx[], cs_lnum_t *p_c2bcbf_ids[]) |
Define a cell –> Dirichlet boundary faces connectivity. More... | |
cs_locmat_t * | cs_cdo_diffusion_build_local (const cs_cdo_quantities_t *quant, const cs_cell_mesh_t *cm, const cs_real_3_t *tensor, cs_cdo_diff_t *diff) |
Define the local (cellwise) stiffness matrix. More... | |
void | cs_cdo_diffusion_weak_bc (cs_lnum_t f_id, const cs_cell_mesh_t *cm, const cs_real_t matpty[3][3], cs_cdo_diff_t *diff, cs_cdo_locsys_t *csys) |
Define the local (cellwise) "normal trace gradient" matrix taking into account Dirichlet BCs by a weak enforcement using Nitsche technique (symmetrized or not) More... | |
void | cs_cdo_diffusion_cellwise_flux (const cs_cell_mesh_t *cm, const cs_dface_t *dface, const cs_real_t pty_tens[3][3], const double *p_v, const double p_c, cs_cdo_diff_t *diff, double *c_flux) |
Compute the diffusive flux across dual faces for a given cell The computation takes into account a subdivision into tetrahedra of the current cell based on p_{ef,c}. More... | |
double | cs_cdo_diffusion_face_flux (const cs_face_mesh_t *fm, const cs_real_t pty_tens[3][3], const double *p_v, const double p_f, const double p_c, cs_cdo_diff_t *diff) |
Compute the diffusive flux across a face (based on a subdivision into tetrahedra of the volume p_{f,c}) More... | |
Build discrete stiffness matrices and handled boundary conditions for diffusion term in CDO vertex-based and vertex+cell schemes.
|
static |
Compute the stiffness matrix on the current cell using a Whitney Barycentric Subdivision (WBS) algo and a V+C CDO scheme.
[in] | quant | pointer to a cs_cdo_quantities_t struct. |
[in] | cm | pointer to a cs_cell_mesh_t struct. |
[in] | tensor | 3x3 matrix attached to the diffusion property |
[in,out] | diff | auxiliary structure used to build the diff. term |
|
static |
Compute the stiffness matrix on this cell using a Whitney Barycentric Subdivision (WBS) algo.
(end ignore by Doxygen)
[in] | quant | pointer to a cs_cdo_quantities_t struct. |
[in] | cm | pointer to a cs_cell_mesh_t struct. |
[in] | tensor | 3x3 matrix attached to the diffusion property |
[in,out] | diff | auxiliary structure used to build the diff. term |
|
static |
Compute the normal trace operator for a given border face when a COST algo. is used for reconstructing the degrees of freedom.
[in] | f | face id in the cellwise numbering |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | mnu | property tensor times the face normal |
[in] | beta | value of the stabilizarion coef. related to reco. |
[in,out] | diff | pointer to a builder structure |
[in,out] | ntrgrd | local matrix related to the normal trace op. |
|
static |
Compute the normal trace operator for a given border face when a WBS algo. and a V+C scheme is considered.
[in] | fm | pointer to a cs_face_mesh_t structure |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | pty_nuf | property tensor times the face normal |
[in,out] | diff | pointer to a builder structure |
[in,out] | ntrgrd | local matrix related to the normal trace op. |
|
static |
Compute the normal trace operator for a given border face when a WBS algo. is used for reconstructing the degrees of freedom.
[in] | fm | pointer to a cs_face_mesh_t structure |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | pty_nuf | property tensor times the face normal |
[in,out] | diff | pointer to a builder structure |
[in,out] | ntrgrd | local matrix related to the normal trace op. |
void cs_cdo_diffusion_build_c2bcbf | ( | const cs_cdo_connect_t * | connect, |
const cs_cdo_bc_list_t * | dir_face, | ||
cs_lnum_t * | p_c2bcbf_idx[], | ||
cs_lnum_t * | p_c2bcbf_ids[] | ||
) |
Define a cell –> Dirichlet boundary faces connectivity.
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | dir_face | pointer to a cs_cdo_bc_list_t structure |
[in,out] | c2bcbf_idx | pointer to the index to build |
[in,out] | c2bcbf_ids | pointer to the list of ids to build |
cs_locmat_t* cs_cdo_diffusion_build_local | ( | const cs_cdo_quantities_t * | quant, |
const cs_cell_mesh_t * | cm, | ||
const cs_real_3_t * | tensor, | ||
cs_cdo_diff_t * | diff | ||
) |
Define the local (cellwise) stiffness matrix.
[in] | quant | pointer to a cs_cdo_quantities_t struct. |
[in] | cm | cell-wise connectivity and quantitites |
[in] | tensor | 3x3 matrix attached to the diffusion property |
[in,out] | diff | auxiliary structure used to build the diff. term |
cs_cdo_diff_t* cs_cdo_diffusion_builder_free | ( | cs_cdo_diff_t * | diff | ) |
Free a cs_cdo_diff_t structure.
[in,out] | diff | pointer to a cs_cdo_diff_t struc. |
cs_cdo_diff_t* cs_cdo_diffusion_builder_init | ( | const cs_cdo_connect_t * | connect, |
cs_space_scheme_t | space_scheme, | ||
bool | is_uniform, | ||
const cs_param_hodge_t | h_info, | ||
const cs_param_bc_enforce_t | bc_enforce | ||
) |
Initialize a builder structure used to build the stiffness matrix.
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | space_scheme | scheme used for discretizing in space |
[in] | is_uniform | diffusion tensor is uniform ? (true or false) |
[in] | h_info | cs_param_hodge_t structure |
[in] | bc_enforce | type of boundary enforcement for Dirichlet values |
void cs_cdo_diffusion_cellwise_flux | ( | const cs_cell_mesh_t * | cm, |
const cs_dface_t * | dface, | ||
const cs_real_t | pty_tens[3][3], | ||
const double * | p_v, | ||
const double | p_c, | ||
cs_cdo_diff_t * | diff, | ||
double * | c_flux | ||
) |
Compute the diffusive flux across dual faces for a given cell The computation takes into account a subdivision into tetrahedra of the current cell based on p_{ef,c}.
[in] | cm | pointer to a cs_face_mesh_t structure |
[in] | dface | pointer to the dual faces related to cell edges |
[in] | pty_tens | 3x3 matrix related to the diffusion property |
[in] | p_v | array of values attached to face vertices |
[in] | p_c | value attached to the cell |
[in,out] | diff | auxiliary structure dedicated to diffusion |
[in,out] | c_flux | flux across dual faces inside this cell |
double cs_cdo_diffusion_face_flux | ( | const cs_face_mesh_t * | fm, |
const cs_real_t | pty_tens[3][3], | ||
const double * | p_v, | ||
const double | p_f, | ||
const double | p_c, | ||
cs_cdo_diff_t * | diff | ||
) |
Compute the diffusive flux across a face (based on a subdivision into tetrahedra of the volume p_{f,c})
[in] | fm | pointer to a cs_face_mesh_t structure |
[in] | pty_tens | 3x3 matrix related to the diffusion property |
[in] | p_v | array of values attached to face vertices |
[in] | p_f | value attached to the face |
[in] | p_c | value attached to the cell |
[in,out] | diff | auxiliary structure dedicated to diffusion |
cs_hodge_builder_t* cs_cdo_diffusion_get_hodge_builder | ( | cs_cdo_diff_t * | diff | ) |
Get the related Hodge builder structure.
[in] | diff | pointer to a cs_cdo_diff_t structure |
void cs_cdo_diffusion_get_tmp_buffers | ( | const cs_cdo_diff_t * | diff, |
cs_real_3_t ** | tmp_vec, | ||
cs_real_t ** | tmp_sca | ||
) |
Get temporary buffers attached to a cs_cdo_diff_t structure.
[in] | diff | pointer to a cs_cdo_diff_t structure |
[in,out] | tmp_vec | pointer to a buffer of cs_real_3_t |
[in,out] | tmp_sca | pointer to a buffer of cs_real_t |
void cs_cdo_diffusion_weak_bc | ( | cs_lnum_t | f_id, |
const cs_cell_mesh_t * | cm, | ||
const cs_real_t | matpty[3][3], | ||
cs_cdo_diff_t * | diff, | ||
cs_cdo_locsys_t * | csys | ||
) |
Define the local (cellwise) "normal trace gradient" matrix taking into account Dirichlet BCs by a weak enforcement using Nitsche technique (symmetrized or not)
[in] | f_id | face id (a border face attached to a Dir. BC) |
[in] | cm | pointer to a cs_cell_mesh_t struct. |
[in] | matpty | 3x3 matrix related to the diffusion property |
[in,out] | diff | auxiliary structure used to build the diff. term |
[in,out] | csys | structure storing the cell-wise system |