8.3
general documentation
cs_cdo_diffusion.cpp File Reference

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_reco_cw.h"
#include "cs_scheme_geometry.h"
#include "cs_cdo_diffusion.h"
+ Include dependency graph for cs_cdo_diffusion.cpp:

Functions

void cs_cdo_diffusion_pena_dirichlet (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_hodge_t *hodge, 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. Predefined prototype to match the function pointer cs_cdo_enforce_bc_t. More...
 
void cs_cdo_diffusion_pena_block_dirichlet (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_hodge_t *hodge, 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. Case of a cellwise system defined by block. Predefined prototype to match the function pointer cs_cdo_enforce_bc_t. More...
 
void cs_cdo_diffusion_alge_dirichlet (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_hodge_t *hodge, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
 Take into account Dirichlet BCs by keeping the DoFs related to Dirichlet BCs in the algebraic system (i.e. a weak enforcement). The corresponding DoFs are algebraically "removed" of the system. More...
 
void cs_cdo_diffusion_alge_dirichlet_extra_block (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_hodge_t *hodge, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
 Function close to cs_cdo_diffusion_alge_dirichlet but dedicated to systems by blocks and especially for extra-diagonal blocks. The treatment of the RHS is a bit different. More...
 
void cs_cdo_diffusion_alge_block_dirichlet (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_hodge_t *hodge, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
 Take into account Dirichlet BCs by keeping the DoFs related to Dirichlet BCs in the algebraic system (i.e. a weak enforcement) The corresponding DoFs are algebraically "removed" of the system Block version. More...
 
void cs_cdo_diffusion_sfb_weak_dirichlet (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_hodge_t *hodge, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
 Take into account Dirichlet BCs by a weak enforcement using Nitsche technique. Case of scalar-valued CDO Face-based schemes Predefined prototype to match the function pointer cs_cdo_enforce_bc_t. More...
 
void cs_cdo_diffusion_vfb_weak_dirichlet (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_hodge_t *hodge, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
 Take into account Dirichlet BCs by a weak enforcement using Nitsche technique. Case of vector-valued CDO Face-based schemes The idea is to compute the scalar version and dispatch it three times, one for each Cartesian components Predefined prototype to match the function pointer cs_cdo_enforce_bc_t. More...
 
void cs_cdo_diffusion_sfb_wsym_dirichlet (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_hodge_t *hodge, 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 Case of scalar-valued CDO Face-based schemes Predefined prototype to match the function pointer cs_cdo_enforce_bc_t. More...
 
void cs_cdo_diffusion_vfb_wsym_dirichlet (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_hodge_t *hodge, 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. Case of vector-valued CDO Face-based schemes The idea is to compute the scalar version and dispatch it three times, one for each Cartesian components Predefined prototype to match the function pointer cs_cdo_enforce_bc_t. More...
 
void cs_cdo_diffusion_vfb_wsym_sliding (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_hodge_t *hodge, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
 Take into account sliding BCs by a weak enforcement using Nitsche technique plus a symmetric treatment. Case of vector-valued CDO Face-based schemes Predefined prototype to match the function pointer cs_cdo_enforce_bc_t. More...
 
void cs_cdo_diffusion_sfb_cost_robin (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_hodge_t *hodge, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
 Take into account Robin BCs. Case of scalar-valued CDO-Fb schemes with a CO+ST algorithm. Predefined prototype to match the function pointer cs_cdo_enforce_bc_t. More...
 
void cs_cdo_diffusion_svb_cost_robin (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_hodge_t *hodge, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
 Take into account Robin BCs. Case of scalar-valued CDO-Vb schemes with a CO+ST algorithm. Predefined prototype to match the function pointer cs_cdo_enforce_bc_t. More...
 
void cs_cdo_diffusion_svb_ocs_weak_dirichlet (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_hodge_t *hodge, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
 Take into account Dirichlet BCs by a weak enforcement using Nitsche technique. Case of scalar-valued CDO-Vb schemes with an orthogonal splitting between the consistency/stabilization parts (OCS) Predefined prototype to match the function pointer cs_cdo_enforce_bc_t. More...
 
void cs_cdo_diffusion_vvb_ocs_weak_dirichlet (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_hodge_t *hodge, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
 Take into account Dirichlet BCs by a weak enforcement using Nitsche technique. A Dirichlet is set for the three components of the vector. Case of vector-valued CDO-Vb schemes with an orthogonal splitting between the consistency/stabilization parts (OCS) Predefined prototype to match the function pointer cs_cdo_enforce_bc_t. More...
 
void cs_cdo_diffusion_vvb_ocs_sliding (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_hodge_t *hodge, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
 Take into account a sliding BCs. Case of vector-valued CDO-Vb schemes with a OCS algorithm. Orthogonal splitting between Consistency/Stabilization parts. Predefined prototype to match the function pointer cs_cdo_enforce_bc_t. More...
 
void cs_cdo_diffusion_svb_ocs_wsym_dirichlet (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_hodge_t *hodge, 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. Case of CDO-Vb schemes with a COST/Bubble or Voronoi algorithm. One assumes an Orthogonal splitting between Consistency/Stabilization parts (OCS). Predefined prototype to match the function pointer cs_cdo_enforce_bc_t. More...
 
void cs_cdo_diffusion_svb_wbs_robin (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_hodge_t *hodge, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
 Take into account Robin BCs. Case of scalar-valued CDO-Vb schemes with a WBS algorithm. Predefined prototype to match the function pointer cs_cdo_enforce_bc_t. More...
 
void cs_cdo_diffusion_svb_wbs_weak_dirichlet (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_hodge_t *hodge, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
 Take into account Dirichlet BCs by a weak enforcement using Nitsche technique. Case of CDO-Vb schemes with a WBS algorithm. Predefined prototype to match the function pointer cs_cdo_enforce_bc_t. More...
 
void cs_cdo_diffusion_svb_wbs_wsym_dirichlet (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_hodge_t *hodge, 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. Case of CDO-Vb schemes with a WBS algorithm Predefined prototype to match the function pointer cs_cdo_enforce_bc_t. More...
 
void cs_cdo_diffusion_vcb_weak_dirichlet (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_hodge_t *hodge, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
 Take into account Dirichlet BCs by a weak enforcement using Nitsche technique. Case of CDO-VCb schemes with a WBS algorithm. Predefined prototype to match the function pointer cs_cdo_enforce_bc_t. More...
 
void cs_cdo_diffusion_vcb_wsym_dirichlet (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_hodge_t *hodge, 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. Case of CDO-VCb schemes with a WBS algorithm Predefined prototype to match the function pointer cs_cdo_enforce_bc_t. More...
 
void cs_cdo_diffusion_sfb_get_face_flux (const cs_cell_mesh_t *cm, const double *pot, const cs_hodge_t *hodge, cs_cell_builder_t *cb, double *flx)
 Compute the diffusive flux across primal faces for a given cell. Use the same consistent approximation as in the discrete Hodge op. for this computation. This function is dedicated to scalar-valued face-based schemes. Flux = -Consistent(Hdg) * GRAD(pot) Predefined prototype to match the function pointer cs_cdo_diffusion_cw_flux_t. More...
 
void cs_cdo_diffusion_svb_get_dfbyc_flux (const cs_cell_mesh_t *cm, const double *pot, const cs_hodge_t *hodge, cs_cell_builder_t *cb, double *flx)
 Compute the diffusive flux across dual faces for a given cell. Use the same consistent approximation as in the discrete Hodge op. for this computation. This function is dedicated to vertex-based schemes. Flux = -Consistent(Hdg) * GRAD(pot) Predefined prototype to match the function pointer cs_cdo_diffusion_cw_flux_t. More...
 
void cs_cdo_diffusion_svb_get_cell_flux (const cs_cell_mesh_t *cm, const double *pot, const cs_hodge_t *hodge, cs_cell_builder_t *cb, double *flx)
 Compute the constant approximation of the diffusive flux inside a (primal) cell. Use the same consistent approximation as in the discrete Hodge op. for this computation. This function is dedicated to vertex-based schemes. Flux = -Hdg * GRAD(pot) Predefined prototype to match the function pointer cs_cdo_diffusion_cw_flux_t. More...
 
void cs_cdo_diffusion_svb_vbyf_flux (short int f, const cs_cell_mesh_t *cm, const cs_real_t *pot, const cs_hodge_t *hodge, cs_cell_builder_t *cb, cs_real_t *flux)
 Compute the normal flux for a face assuming only the knowledge of the potential at cell vertices. Valid for algorithm relying on a spliting of the consistency/stabilization part as in OCS (also called CO+ST) or Bubble algorithm. This is used for reconstructing the normal flux from the degrees of freedom. The contribution for each vertex of the face is then computed. More...
 
void cs_cdo_diffusion_wbs_get_dfbyc_flux (const cs_cell_mesh_t *cm, const cs_real_t *pot, const cs_hodge_t *hodge, 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} Predefined prototype to match the function pointer cs_cdo_diffusion_cw_flux_t. More...
 
void cs_cdo_diffusion_wbs_get_cell_flux (const cs_cell_mesh_t *cm, const cs_real_t *pot, const cs_hodge_t *hodge, 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} Predefined prototype to match the function pointer cs_cdo_diffusion_cw_flux_t. More...
 
void cs_cdo_diffusion_wbs_vbyf_flux (short int f, const cs_cell_mesh_t *cm, const cs_real_t *pot, const cs_hodge_t *hodge, cs_cell_builder_t *cb, cs_real_t *flux)
 Compute the normal flux for a face assuming only the knowledge of the potential at cell vertices (and at cell center). WBS algorithm is used for reconstructing the normal flux from the degrees of freedom. More...
 
double cs_cdo_diffusion_wbs_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...
 
void cs_cdo_diffusion_sfb_cost_flux (short int f, const cs_cell_mesh_t *cm, const cs_real_t *pot, const cs_hodge_t *hodge, cs_cell_builder_t *cb, cs_real_t *flux)
 Compute the normal diffusive flux for a face assuming only the knowledge of the potential at faces and cell. CO+ST algorithm is used for reconstructing the normal flux from the degrees of freedom. More...
 
void cs_cdovb_diffusion_p0_face_flux (const short int f, const cs_cell_mesh_t *cm, const cs_real_t diff_tensor[3][3], const cs_real_t *pot_values, cs_real_t *fluxes)
 Compute the normal flux for a face assuming only the knowledge of the potential at cell vertices. COST algorithm is used for reconstructing a piecewise constant gradient from the degrees of freedom. More...
 
void cs_macfb_diffusion (const cs_cell_mesh_t *cm, const cs_macfb_builder_t *macb, const cs_property_t *diff_pty, cs_sdm_t *mat, cs_real_t *rhs)
 Compute the diffusion operator. More...
 

Detailed Description

Build discrete stiffness matrices and handled boundary conditions for diffusion term in CDO vertex-based and vertex+cell schemes.

Function Documentation

◆ cs_cdo_diffusion_alge_block_dirichlet()

void cs_cdo_diffusion_alge_block_dirichlet ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
cs_face_mesh_t fm,
cs_hodge_t hodge,
cs_cell_builder_t cb,
cs_cell_sys_t csys 
)

Take into account Dirichlet BCs by keeping the DoFs related to Dirichlet BCs in the algebraic system (i.e. a weak enforcement) The corresponding DoFs are algebraically "removed" of the system Block version.

| | | | | | | | | | | Aii | Aid | | Aii | 0 | |bi| |bi-Aid.xd | |---------—| --> |---------—| and |–| --> |-------—| | | | | | | | | | | | Adi | Add | | 0 | Id | |bd| | xd |

where xd is the value of the Dirichlet BC Predefined prototype to match the function pointer cs_cdo_enforce_bc_t

Parameters
[in]eqppointer to a cs_equation_param_t struct.
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]csysstructure storing the cell-wise system

◆ cs_cdo_diffusion_alge_dirichlet()

void cs_cdo_diffusion_alge_dirichlet ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
cs_face_mesh_t fm,
cs_hodge_t hodge,
cs_cell_builder_t cb,
cs_cell_sys_t csys 
)

Take into account Dirichlet BCs by keeping the DoFs related to Dirichlet BCs in the algebraic system (i.e. a weak enforcement). The corresponding DoFs are algebraically "removed" of the system.

| | | | | | | | | | | Aii | Aid | | Aii | 0 | |bi| |bi-Aid.xd | |---------—| --> |---------—| and |–| --> |-------—| | | | | | | | | | | | Adi | Add | | 0 | Id | |bd| | xd |

where xd collects the values of the Dirichlet BC

Predefined prototype: function pointer cs_cdo_enforce_bc_t

Parameters
[in]eqppointer to a cs_equation_param_t struct.
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]csysstructure storing the cell-wise system

◆ cs_cdo_diffusion_alge_dirichlet_extra_block()

void cs_cdo_diffusion_alge_dirichlet_extra_block ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
cs_face_mesh_t fm,
cs_hodge_t hodge,
cs_cell_builder_t cb,
cs_cell_sys_t csys 
)

Function close to cs_cdo_diffusion_alge_dirichlet but dedicated to systems by blocks and especially for extra-diagonal blocks. The treatment of the RHS is a bit different.

Take into account Dirichlet BCs by keeping the DoFs related to Dirichlet BCs in the algebraic system (i.e. a weak enforcement). The corresponding DoFs are algebraically "removed" of the system

| | | | | | | | | | | Aii | Aid | | Aii | 0 | |bi| |bi-Aid.xd | |---------—| --> |---------—| and |–| --> |-------—| | | | | | | | | | | | Adi | Add | | 0 | 0 | |bd| | 0 |

where xd collects the values of the Dirichlet BC

Predefined prototype: function pointer cs_cdo_enforce_bc_t

Parameters
[in]eqppointer to a cs_equation_param_t struct.
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]csysstructure storing the cell-wise system

◆ cs_cdo_diffusion_pena_block_dirichlet()

void cs_cdo_diffusion_pena_block_dirichlet ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
cs_face_mesh_t fm,
cs_hodge_t hodge,
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. Case of a cellwise system defined by block. Predefined prototype to match the function pointer cs_cdo_enforce_bc_t.

Parameters
[in]eqppointer to a cs_equation_param_t struct.
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]csysstructure storing the cell-wise system

◆ cs_cdo_diffusion_pena_dirichlet()

void cs_cdo_diffusion_pena_dirichlet ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
cs_face_mesh_t fm,
cs_hodge_t hodge,
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. Predefined prototype to match the function pointer cs_cdo_enforce_bc_t.

Parameters
[in]eqppointer to a cs_equation_param_t struct.
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]csysstructure storing the cell-wise system

◆ cs_cdo_diffusion_sfb_cost_flux()

void cs_cdo_diffusion_sfb_cost_flux ( short int  f,
const cs_cell_mesh_t cm,
const cs_real_t pot,
const cs_hodge_t hodge,
cs_cell_builder_t cb,
cs_real_t flux 
)

Compute the normal diffusive flux for a face assuming only the knowledge of the potential at faces and cell. CO+ST algorithm is used for reconstructing the normal flux from the degrees of freedom.

Parameters
[in]fface id in the cell mesh
[in]cmpointer to a cs_cell_mesh_t structure
[in]potarray of values of the potential (all the mesh)
[in]hodgepointer to a cs_hodge_t structure
[in,out]cbauxiliary structure dedicated to diffusion
[out]fluxpointer to the value to set

◆ cs_cdo_diffusion_sfb_cost_robin()

void cs_cdo_diffusion_sfb_cost_robin ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
cs_face_mesh_t fm,
cs_hodge_t hodge,
cs_cell_builder_t cb,
cs_cell_sys_t csys 
)

Take into account Robin BCs. Case of scalar-valued CDO-Fb schemes with a CO+ST algorithm. Predefined prototype to match the function pointer cs_cdo_enforce_bc_t.

Parameters
[in]eqppointer to a cs_equation_param_t struct.
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]csysstructure storing the cellwise system

◆ cs_cdo_diffusion_sfb_get_face_flux()

void cs_cdo_diffusion_sfb_get_face_flux ( const cs_cell_mesh_t cm,
const double *  pot,
const cs_hodge_t hodge,
cs_cell_builder_t cb,
double *  flx 
)

Compute the diffusive flux across primal faces for a given cell. Use the same consistent approximation as in the discrete Hodge op. for this computation. This function is dedicated to scalar-valued face-based schemes. Flux = -Consistent(Hdg) * GRAD(pot) Predefined prototype to match the function pointer cs_cdo_diffusion_cw_flux_t.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]potvalues of the potential fields at specific locations
[in]hodgepointer to a cs_hodge_t structure
[in,out]cbauxiliary structure for computing the flux
[in,out]flxvalues of the flux across primal faces

◆ cs_cdo_diffusion_sfb_weak_dirichlet()

void cs_cdo_diffusion_sfb_weak_dirichlet ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
cs_face_mesh_t fm,
cs_hodge_t hodge,
cs_cell_builder_t cb,
cs_cell_sys_t csys 
)

Take into account Dirichlet BCs by a weak enforcement using Nitsche technique. Case of scalar-valued CDO Face-based schemes Predefined prototype to match the function pointer cs_cdo_enforce_bc_t.

Parameters
[in]eqppointer to a cs_equation_param_t struct.
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]csysstructure storing the cellwise system

◆ cs_cdo_diffusion_sfb_wsym_dirichlet()

void cs_cdo_diffusion_sfb_wsym_dirichlet ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
cs_face_mesh_t fm,
cs_hodge_t hodge,
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 Case of scalar-valued CDO Face-based schemes Predefined prototype to match the function pointer cs_cdo_enforce_bc_t.

Parameters
[in]eqppointer to a cs_equation_param_t struct.
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]csysstructure storing the cellwise system

◆ cs_cdo_diffusion_svb_cost_robin()

void cs_cdo_diffusion_svb_cost_robin ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
cs_face_mesh_t fm,
cs_hodge_t hodge,
cs_cell_builder_t cb,
cs_cell_sys_t csys 
)

Take into account Robin BCs. Case of scalar-valued CDO-Vb schemes with a CO+ST algorithm. Predefined prototype to match the function pointer cs_cdo_enforce_bc_t.

Parameters
[in]eqppointer to a cs_equation_param_t struct.
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]csysstructure storing the cellwise system

◆ cs_cdo_diffusion_svb_get_cell_flux()

void cs_cdo_diffusion_svb_get_cell_flux ( const cs_cell_mesh_t cm,
const double *  pot,
const cs_hodge_t hodge,
cs_cell_builder_t cb,
double *  flx 
)

Compute the constant approximation of the diffusive flux inside a (primal) cell. Use the same consistent approximation as in the discrete Hodge op. for this computation. This function is dedicated to vertex-based schemes. Flux = -Hdg * GRAD(pot) Predefined prototype to match the function pointer cs_cdo_diffusion_cw_flux_t.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]potvalues of the potential fields at specific locations
[in]hodgepointer to a cs_hodge_t structure
[in,out]cbauxiliary structure for computing the flux
[in,out]flxvalues of the flux inside the cell

◆ cs_cdo_diffusion_svb_get_dfbyc_flux()

void cs_cdo_diffusion_svb_get_dfbyc_flux ( const cs_cell_mesh_t cm,
const double *  pot,
const cs_hodge_t hodge,
cs_cell_builder_t cb,
double *  flx 
)

Compute the diffusive flux across dual faces for a given cell. Use the same consistent approximation as in the discrete Hodge op. for this computation. This function is dedicated to vertex-based schemes. Flux = -Consistent(Hdg) * GRAD(pot) Predefined prototype to match the function pointer cs_cdo_diffusion_cw_flux_t.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]potvalues of the potential fields at specific locations
[in]hodgepointer to a cs_hodge_t structure
[in,out]cbauxiliary structure for computing the flux
[in,out]flxvalues of the flux across specific entities

◆ cs_cdo_diffusion_svb_ocs_weak_dirichlet()

void cs_cdo_diffusion_svb_ocs_weak_dirichlet ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
cs_face_mesh_t fm,
cs_hodge_t hodge,
cs_cell_builder_t cb,
cs_cell_sys_t csys 
)

Take into account Dirichlet BCs by a weak enforcement using Nitsche technique. Case of scalar-valued CDO-Vb schemes with an orthogonal splitting between the consistency/stabilization parts (OCS) Predefined prototype to match the function pointer cs_cdo_enforce_bc_t.

Parameters
[in]eqppointer to a cs_equation_param_t struct.
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]csysstructure storing the cellwise system

◆ cs_cdo_diffusion_svb_ocs_wsym_dirichlet()

void cs_cdo_diffusion_svb_ocs_wsym_dirichlet ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
cs_face_mesh_t fm,
cs_hodge_t hodge,
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. Case of CDO-Vb schemes with a COST/Bubble or Voronoi algorithm. One assumes an Orthogonal splitting between Consistency/Stabilization parts (OCS). Predefined prototype to match the function pointer cs_cdo_enforce_bc_t.

Parameters
[in]eqppointer to a cs_equation_param_t struct.
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]csysstructure storing the cellwise system

◆ cs_cdo_diffusion_svb_vbyf_flux()

void cs_cdo_diffusion_svb_vbyf_flux ( short int  f,
const cs_cell_mesh_t cm,
const cs_real_t pot,
const cs_hodge_t hodge,
cs_cell_builder_t cb,
cs_real_t flux 
)

Compute the normal flux for a face assuming only the knowledge of the potential at cell vertices. Valid for algorithm relying on a spliting of the consistency/stabilization part as in OCS (also called CO+ST) or Bubble algorithm. This is used for reconstructing the normal flux from the degrees of freedom. The contribution for each vertex of the face is then computed.

Parameters
[in]fface id in the cell mesh
[in]cmpointer to a cs_cell_mesh_t structure
[in]potarray of values of the potential (all the mesh)
[in]hodgepointer to a cs_hodge_t structure
[in,out]cbauxiliary structure for building the flux
[in,out]fluxarray of values to set (size: n_vc)

◆ cs_cdo_diffusion_svb_wbs_robin()

void cs_cdo_diffusion_svb_wbs_robin ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
cs_face_mesh_t fm,
cs_hodge_t hodge,
cs_cell_builder_t cb,
cs_cell_sys_t csys 
)

Take into account Robin BCs. Case of scalar-valued CDO-Vb schemes with a WBS algorithm. Predefined prototype to match the function pointer cs_cdo_enforce_bc_t.

Parameters
[in]eqppointer to a cs_equation_param_t struct.
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]csysstructure storing the cellwise system

◆ cs_cdo_diffusion_svb_wbs_weak_dirichlet()

void cs_cdo_diffusion_svb_wbs_weak_dirichlet ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
cs_face_mesh_t fm,
cs_hodge_t hodge,
cs_cell_builder_t cb,
cs_cell_sys_t csys 
)

Take into account Dirichlet BCs by a weak enforcement using Nitsche technique. Case of CDO-Vb schemes with a WBS algorithm. Predefined prototype to match the function pointer cs_cdo_enforce_bc_t.

Parameters
[in]eqppointer to a cs_equation_param_t struct.
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]csysstructure storing the cellwise system

◆ cs_cdo_diffusion_svb_wbs_wsym_dirichlet()

void cs_cdo_diffusion_svb_wbs_wsym_dirichlet ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
cs_face_mesh_t fm,
cs_hodge_t hodge,
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. Case of CDO-Vb schemes with a WBS algorithm Predefined prototype to match the function pointer cs_cdo_enforce_bc_t.

Parameters
[in]eqppointer to a cs_equation_param_t struct.
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]csysstructure storing the cellwise system

◆ cs_cdo_diffusion_vcb_weak_dirichlet()

void cs_cdo_diffusion_vcb_weak_dirichlet ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
cs_face_mesh_t fm,
cs_hodge_t hodge,
cs_cell_builder_t cb,
cs_cell_sys_t csys 
)

Take into account Dirichlet BCs by a weak enforcement using Nitsche technique. Case of CDO-VCb schemes with a WBS algorithm. Predefined prototype to match the function pointer cs_cdo_enforce_bc_t.

Parameters
[in]eqppointer to a cs_equation_param_t struct.
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]csysstructure storing the cellwise system

◆ cs_cdo_diffusion_vcb_wsym_dirichlet()

void cs_cdo_diffusion_vcb_wsym_dirichlet ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
cs_face_mesh_t fm,
cs_hodge_t hodge,
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. Case of CDO-VCb schemes with a WBS algorithm Predefined prototype to match the function pointer cs_cdo_enforce_bc_t.

Parameters
[in]eqppointer to a cs_equation_param_t struct.
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]csysstructure storing the cellwise system

◆ cs_cdo_diffusion_vfb_weak_dirichlet()

void cs_cdo_diffusion_vfb_weak_dirichlet ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
cs_face_mesh_t fm,
cs_hodge_t hodge,
cs_cell_builder_t cb,
cs_cell_sys_t csys 
)

Take into account Dirichlet BCs by a weak enforcement using Nitsche technique. Case of vector-valued CDO Face-based schemes The idea is to compute the scalar version and dispatch it three times, one for each Cartesian components Predefined prototype to match the function pointer cs_cdo_enforce_bc_t.

Parameters
[in]eqppointer to a cs_equation_param_t struct.
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]csysstructure storing the cellwise system

◆ cs_cdo_diffusion_vfb_wsym_dirichlet()

void cs_cdo_diffusion_vfb_wsym_dirichlet ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
cs_face_mesh_t fm,
cs_hodge_t hodge,
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. Case of vector-valued CDO Face-based schemes The idea is to compute the scalar version and dispatch it three times, one for each Cartesian components Predefined prototype to match the function pointer cs_cdo_enforce_bc_t.

Parameters
[in]eqppointer to a cs_equation_param_t struct.
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]csysstructure storing the cellwise system

◆ cs_cdo_diffusion_vfb_wsym_sliding()

void cs_cdo_diffusion_vfb_wsym_sliding ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
cs_face_mesh_t fm,
cs_hodge_t hodge,
cs_cell_builder_t cb,
cs_cell_sys_t csys 
)

Take into account sliding BCs by a weak enforcement using Nitsche technique plus a symmetric treatment. Case of vector-valued CDO Face-based schemes Predefined prototype to match the function pointer cs_cdo_enforce_bc_t.

Parameters
[in]eqppointer to a cs_equation_param_t struct.
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]csysstructure storing the cellwise system

◆ cs_cdo_diffusion_vvb_ocs_sliding()

void cs_cdo_diffusion_vvb_ocs_sliding ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
cs_face_mesh_t fm,
cs_hodge_t hodge,
cs_cell_builder_t cb,
cs_cell_sys_t csys 
)

Take into account a sliding BCs. Case of vector-valued CDO-Vb schemes with a OCS algorithm. Orthogonal splitting between Consistency/Stabilization parts. Predefined prototype to match the function pointer cs_cdo_enforce_bc_t.

Parameters
[in]eqppointer to a cs_equation_param_t struct.
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]csysstructure storing the cellwise system

◆ cs_cdo_diffusion_vvb_ocs_weak_dirichlet()

void cs_cdo_diffusion_vvb_ocs_weak_dirichlet ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
cs_face_mesh_t fm,
cs_hodge_t hodge,
cs_cell_builder_t cb,
cs_cell_sys_t csys 
)

Take into account Dirichlet BCs by a weak enforcement using Nitsche technique. A Dirichlet is set for the three components of the vector. Case of vector-valued CDO-Vb schemes with an orthogonal splitting between the consistency/stabilization parts (OCS) Predefined prototype to match the function pointer cs_cdo_enforce_bc_t.

Parameters
[in]eqppointer to a cs_equation_param_t struct.
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]hodgepointer to a cs_hodge_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]csysstructure storing the cellwise system

◆ cs_cdo_diffusion_wbs_face_flux()

double cs_cdo_diffusion_wbs_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})

Parameters
[in]fmpointer to a cs_face_mesh_t structure
[in]pty_tens3x3 matrix related to the diffusion property
[in]p_varray of values attached to face vertices
[in]p_fvalue attached to the face
[in]p_cvalue attached to the cell
[in,out]cbauxiliary structure dedicated to diffusion
Returns
the value of the diffusive flux across the current face

◆ cs_cdo_diffusion_wbs_get_cell_flux()

void cs_cdo_diffusion_wbs_get_cell_flux ( const cs_cell_mesh_t cm,
const cs_real_t pot,
const cs_hodge_t hodge,
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} Predefined prototype to match the function pointer cs_cdo_diffusion_cw_flux_t.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]potvalues of the potential fields at vertices
[in]hodgepointer to a cs_hodge_t structure
[in,out]cbauxiliary structure for computing the flux
[in,out]flxflux vector inside this cell

◆ cs_cdo_diffusion_wbs_get_dfbyc_flux()

void cs_cdo_diffusion_wbs_get_dfbyc_flux ( const cs_cell_mesh_t cm,
const cs_real_t pot,
const cs_hodge_t hodge,
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} Predefined prototype to match the function pointer cs_cdo_diffusion_cw_flux_t.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]potvalues of the potential fields at vertices
[in]hodgepointer to a cs_hodge_t structure
[in,out]cbauxiliary structure for computing the flux
[in,out]flxflux across dual faces inside this cell

◆ cs_cdo_diffusion_wbs_vbyf_flux()

void cs_cdo_diffusion_wbs_vbyf_flux ( short int  f,
const cs_cell_mesh_t cm,
const cs_real_t pot,
const cs_hodge_t hodge,
cs_cell_builder_t cb,
cs_real_t flux 
)

Compute the normal flux for a face assuming only the knowledge of the potential at cell vertices (and at cell center). WBS algorithm is used for reconstructing the normal flux from the degrees of freedom.

Parameters
[in]fface id in the cell mesh
[in]cmpointer to a cs_cell_mesh_t structure
[in]potarray of values of the potential (all the mesh)
[in]hodgepointer to a cs_hodge_t structure
[in,out]cbauxiliary structure dedicated to diffusion
[in,out]fluxarray of values to set (size: n_vc)

◆ cs_cdovb_diffusion_p0_face_flux()

void cs_cdovb_diffusion_p0_face_flux ( const short int  f,
const cs_cell_mesh_t cm,
const cs_real_t  diff_tensor[3][3],
const cs_real_t pot_values,
cs_real_t fluxes 
)

Compute the normal flux for a face assuming only the knowledge of the potential at cell vertices. COST algorithm is used for reconstructing a piecewise constant gradient from the degrees of freedom.

Parameters
[in]fface id in the cell mesh
[in]cmpointer to a cs_cell_mesh_t structure
[in]diff_tensorproperty tensor times the face normal
[in]pot_valuesarray of values of the potential (all the mesh)
[in,out]fluxesvalues of the fluxes related to each vertex

◆ cs_macfb_diffusion()

void cs_macfb_diffusion ( const cs_cell_mesh_t cm,
const cs_macfb_builder_t macb,
const cs_property_t diff_pty,
cs_sdm_t *  mat,
cs_real_t rhs 
)

Compute the diffusion operator.

Compute the diffusion operator for the MAC face-based scheme.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]macbpointer to a cs_macfb_builder_t structure
[in]diff_ptypointer to a cs_property_t structure
[in,out]matpointer to a cs_sdm_t structure. It is filled inside the function. Have to preallocated.
[in,out]rhspointer to a cs_real_t array. It is filled inside the function. Have to preallocated.