programmer's documentation
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Functions
cs_cdo_diffusion.c 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_scheme_geometry.h"
#include "cs_cdo_diffusion.h"
Include dependency graph for cs_cdo_diffusion.c:

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...
 

Detailed Description

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

Function Documentation

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 
)
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)

Parameters
[in]pcoefvalue of the penalization coefficient
[in]h_infocs_param_hodge_t structure for diffusion
[in]fmpointer to a cs_face_mesh_t structure
[in]cbcpointer to a cs_cell_bc_t structure
[in,out]ntrgrdpointer to a local matrix structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]csysstructure 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})

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
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.

Parameters
[in]h_infocs_param_hodge_t structure for diffusion
[in]cbcpointer to a cs_cell_bc_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in]flux_opfunction pointer to the flux trace operator
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]csysstructure 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)

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]potvalues of the potential fields at specific locations
[in,out]cbauxiliary structure for computing the flux
[in,out]flxvalues 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)

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]potvalues of the potential fields at specific locations
[in,out]cbauxiliary structure for computing the flux
[in,out]flxvalues 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}.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]potvalues of the potential fields at vertices
[in,out]cbauxiliary structure for computing the flux
[in,out]flxflux 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}.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]potvalues of the potential fields at vertices
[in,out]cbauxiliary structure for computing the flux
[in,out]flxflux 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.

Parameters
[in]fmpointer to a cs_face_mesh_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in]mnuproperty tensor times the face normal
[in]betavalue of the stabilizarion coef. related to reco.
[in,out]cbpointer to a cell builder structure
[in,out]ntrgrdlocal 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.

Parameters
[in]fmpointer to a cs_face_mesh_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in]pty_nufproperty tensor times the face normal
[in]betanot useful here (prototype of function pointer)
[in,out]cbpointer to a cell builder structure
[in,out]ntrgrdlocal 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.

Parameters
[in]h_infocs_param_hodge_t structure for diffusion
[in]cbcpointer to a cs_cell_bc_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in]flux_opfunction pointer to the flux trace operator
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]csysstructure 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.

Parameters
[in]h_infocs_param_hodge_t structure for diffusion
[in]cbcpointer to a cs_cell_bc_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in]flux_opfunction pointer to the flux trace operator
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]csysstructure 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.

Parameters
[in]fmpointer to a cs_face_mesh_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in]pty_nufproperty tensor times the face normal
[in]betanot useful here (prototype of function pointer)
[in,out]cbpointer to a cell builder structure
[in,out]ntrgrdlocal matrix related to the normal trace op. i.e. the flux operator