![]() |
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 "cs_hodge.h"
#include "cs_log.h"
#include "cs_math.h"
#include "cs_property.h"
#include "cs_reco.h"
#include "cs_scheme_geometry.h"
#include "cs_cdo_diffusion.h"
Functions | |
static void | _enforce_nitsche (const double pcoef, const cs_param_hodge_t h_info, const cs_face_mesh_t *fm, const cs_cell_bc_t *cbc, cs_sdm_t *ntrgrd, cs_cell_builder_t *cb, cs_cell_sys_t *csys) |
Using the local (cellwise) "normal trace gradient" matrix takes into account Dirichlet BCs by a weak enforcement using Nitsche technique. More... | |
void | cs_cdovcb_diffusion_flux_op (const cs_face_mesh_t *fm, const cs_cell_mesh_t *cm, const cs_real_3_t pty_nuf, double beta, cs_cell_builder_t *cb, cs_sdm_t *ntrgrd) |
Compute the normal trace operator for a given border face when a WBS algo. is used for reconstructing the degrees of freedom Specific to CDO-V+C schemes. More... | |
void | cs_cdovb_diffusion_wbs_flux_op (const cs_face_mesh_t *fm, const cs_cell_mesh_t *cm, const cs_real_3_t pty_nuf, double beta, cs_cell_builder_t *cb, cs_sdm_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... | |
void | cs_cdovb_diffusion_cost_flux_op (const cs_face_mesh_t *fm, const cs_cell_mesh_t *cm, const cs_real_3_t mnu, double beta, cs_cell_builder_t *cb, cs_sdm_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... | |
void | cs_cdovb_diffusion_weak_dirichlet (const cs_param_hodge_t h_info, const cs_cell_bc_t *cbc, const cs_cell_mesh_t *cm, cs_cdo_diffusion_flux_trace_t *flux_op, cs_face_mesh_t *fm, cs_cell_builder_t *cb, cs_cell_sys_t *csys) |
Take into account Dirichlet BCs by a weak enforcement using Nitsche technique. More... | |
void | cs_cdovb_diffusion_wsym_dirichlet (const cs_param_hodge_t h_info, const cs_cell_bc_t *cbc, const cs_cell_mesh_t *cm, cs_cdo_diffusion_flux_trace_t *flux_op, cs_face_mesh_t *fm, cs_cell_builder_t *cb, cs_cell_sys_t *csys) |
Take into account Dirichlet BCs by a weak enforcement using Nitsche technique plus a symmetric treatment. More... | |
void | cs_cdo_diffusion_pena_dirichlet (const cs_param_hodge_t h_info, const cs_cell_bc_t *cbc, const cs_cell_mesh_t *cm, cs_cdo_diffusion_flux_trace_t *flux_op, cs_face_mesh_t *fm, cs_cell_builder_t *cb, cs_cell_sys_t *csys) |
Take into account Dirichlet BCs by a weak enforcement by a penalization technique with a huge value. More... | |
void | cs_cdo_diffusion_vcost_get_dfbyc_flux (const cs_cell_mesh_t *cm, const double *pot, cs_cell_builder_t *cb, double *flx) |
Compute the diffusive flux across dual faces for a given cell Use the COST algo. for computing the discrete Hodge op. This function is dedicated to vertex-based schemes. Flux = -Hdg * GRAD(pot) More... | |
void | cs_cdo_diffusion_vcost_get_pc_flux (const cs_cell_mesh_t *cm, const double *pot, cs_cell_builder_t *cb, double *flx) |
Compute the diffusive flux inside a (primal) cell Use the COST algo. for computing the discrete Hodge op. This function is dedicated to vertex-based schemes. Flux = -Hdg * GRAD(pot) More... | |
void | cs_cdo_diffusion_wbs_get_dfbyc_flux (const cs_cell_mesh_t *cm, const cs_real_t *pot, cs_cell_builder_t *cb, cs_real_t *flx) |
Compute the diffusive flux across dual faces for a given cell Use the WBS algo. for approximating the gradient The computation takes into account a subdivision into tetrahedra of the current cell based on p_{ef,c}. More... | |
void | cs_cdo_diffusion_wbs_get_pc_flux (const cs_cell_mesh_t *cm, const cs_real_t *pot, cs_cell_builder_t *cb, cs_real_t *flx) |
Compute the diffusive flux inside a given primal cell Use the WBS algo. for approximating the gradient 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_cell_builder_t *cb) |
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 |
Using the local (cellwise) "normal trace gradient" matrix takes into account Dirichlet BCs by a weak enforcement using Nitsche technique.
(end ignore by Doxygen)
[in] | pcoef | value of the penalization coefficient |
[in] | h_info | cs_param_hodge_t structure for diffusion |
[in] | fm | pointer to a cs_face_mesh_t structure |
[in] | cbc | pointer to a cs_cell_bc_t structure |
[in,out] | ntrgrd | pointer to a local matrix structure |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | csys | structure storing the cell-wise system |
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_cell_builder_t * | cb | ||
) |
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] | cb | auxiliary structure dedicated to diffusion |
void cs_cdo_diffusion_pena_dirichlet | ( | const cs_param_hodge_t | h_info, |
const cs_cell_bc_t * | cbc, | ||
const cs_cell_mesh_t * | cm, | ||
cs_cdo_diffusion_flux_trace_t * | flux_op, | ||
cs_face_mesh_t * | fm, | ||
cs_cell_builder_t * | cb, | ||
cs_cell_sys_t * | csys | ||
) |
Take into account Dirichlet BCs by a weak enforcement by a penalization technique with a huge value.
Take into account Dirichlet BCs by a weak enforcement using Nitsche technique (symmetrized or not) or penalization.
[in] | h_info | cs_param_hodge_t structure for diffusion |
[in] | cbc | pointer to a cs_cell_bc_t structure |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | flux_op | function pointer to the flux trace operator |
[in,out] | fm | pointer to a cs_face_mesh_t structure |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | csys | structure storing the cell-wise system |
void cs_cdo_diffusion_vcost_get_dfbyc_flux | ( | const cs_cell_mesh_t * | cm, |
const double * | pot, | ||
cs_cell_builder_t * | cb, | ||
double * | flx | ||
) |
Compute the diffusive flux across dual faces for a given cell Use the COST algo. for computing the discrete Hodge op. This function is dedicated to vertex-based schemes. Flux = -Hdg * GRAD(pot)
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | pot | values of the potential fields at specific locations |
[in,out] | cb | auxiliary structure for computing the flux |
[in,out] | flx | values of the flux across specific entities |
void cs_cdo_diffusion_vcost_get_pc_flux | ( | const cs_cell_mesh_t * | cm, |
const double * | pot, | ||
cs_cell_builder_t * | cb, | ||
double * | flx | ||
) |
Compute the diffusive flux inside a (primal) cell Use the COST algo. for computing the discrete Hodge op. This function is dedicated to vertex-based schemes. Flux = -Hdg * GRAD(pot)
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | pot | values of the potential fields at specific locations |
[in,out] | cb | auxiliary structure for computing the flux |
[in,out] | flx | values of the flux across specific entities |
void cs_cdo_diffusion_wbs_get_dfbyc_flux | ( | const cs_cell_mesh_t * | cm, |
const cs_real_t * | pot, | ||
cs_cell_builder_t * | cb, | ||
cs_real_t * | flx | ||
) |
Compute the diffusive flux across dual faces for a given cell Use the WBS algo. for approximating the gradient The computation takes into account a subdivision into tetrahedra of the current cell based on p_{ef,c}.
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | pot | values of the potential fields at vertices |
[in,out] | cb | auxiliary structure for computing the flux |
[in,out] | flx | flux across dual faces inside this cell |
void cs_cdo_diffusion_wbs_get_pc_flux | ( | const cs_cell_mesh_t * | cm, |
const cs_real_t * | pot, | ||
cs_cell_builder_t * | cb, | ||
cs_real_t * | flx | ||
) |
Compute the diffusive flux inside a given primal cell Use the WBS algo. for approximating the gradient The computation takes into account a subdivision into tetrahedra of the current cell based on p_{ef,c}.
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | pot | values of the potential fields at vertices |
[in,out] | cb | auxiliary structure for computing the flux |
[in,out] | flx | flux vector inside this cell |
void cs_cdovb_diffusion_cost_flux_op | ( | const cs_face_mesh_t * | fm, |
const cs_cell_mesh_t * | cm, | ||
const cs_real_3_t | mnu, | ||
double | beta, | ||
cs_cell_builder_t * | cb, | ||
cs_sdm_t * | ntrgrd | ||
) |
Compute the normal trace operator for a given border face when a COST 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] | mnu | property tensor times the face normal |
[in] | beta | value of the stabilizarion coef. related to reco. |
[in,out] | cb | pointer to a cell builder structure |
[in,out] | ntrgrd | local matrix related to the normal trace op. i.e. the flux operator |
void cs_cdovb_diffusion_wbs_flux_op | ( | const cs_face_mesh_t * | fm, |
const cs_cell_mesh_t * | cm, | ||
const cs_real_3_t | pty_nuf, | ||
double | beta, | ||
cs_cell_builder_t * | cb, | ||
cs_sdm_t * | ntrgrd | ||
) |
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] | beta | not useful here (prototype of function pointer) |
[in,out] | cb | pointer to a cell builder structure |
[in,out] | ntrgrd | local matrix related to the normal trace op. i.e. the flux operator |
void cs_cdovb_diffusion_weak_dirichlet | ( | const cs_param_hodge_t | h_info, |
const cs_cell_bc_t * | cbc, | ||
const cs_cell_mesh_t * | cm, | ||
cs_cdo_diffusion_flux_trace_t * | flux_op, | ||
cs_face_mesh_t * | fm, | ||
cs_cell_builder_t * | cb, | ||
cs_cell_sys_t * | csys | ||
) |
Take into account Dirichlet BCs by a weak enforcement using Nitsche technique.
[in] | h_info | cs_param_hodge_t structure for diffusion |
[in] | cbc | pointer to a cs_cell_bc_t structure |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | flux_op | function pointer to the flux trace operator |
[in,out] | fm | pointer to a cs_face_mesh_t structure |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | csys | structure storing the cellwise system |
void cs_cdovb_diffusion_wsym_dirichlet | ( | const cs_param_hodge_t | h_info, |
const cs_cell_bc_t * | cbc, | ||
const cs_cell_mesh_t * | cm, | ||
cs_cdo_diffusion_flux_trace_t * | flux_op, | ||
cs_face_mesh_t * | fm, | ||
cs_cell_builder_t * | cb, | ||
cs_cell_sys_t * | csys | ||
) |
Take into account Dirichlet BCs by a weak enforcement using Nitsche technique plus a symmetric treatment.
[in] | h_info | cs_param_hodge_t structure for diffusion |
[in] | cbc | pointer to a cs_cell_bc_t structure |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | flux_op | function pointer to the flux trace operator |
[in,out] | fm | pointer to a cs_face_mesh_t structure |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | csys | structure storing the cell-wise system |
void cs_cdovcb_diffusion_flux_op | ( | const cs_face_mesh_t * | fm, |
const cs_cell_mesh_t * | cm, | ||
const cs_real_3_t | pty_nuf, | ||
double | beta, | ||
cs_cell_builder_t * | cb, | ||
cs_sdm_t * | ntrgrd | ||
) |
Compute the normal trace operator for a given border face when a WBS algo. is used for reconstructing the degrees of freedom Specific to CDO-V+C schemes.
[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] | beta | not useful here (prototype of function pointer) |
[in,out] | cb | pointer to a cell builder structure |
[in,out] | ntrgrd | local matrix related to the normal trace op. i.e. the flux operator |