My Project
programmer's documentation
Macros | Functions
cs_reco.c File Reference
#include "cs_defs.h"
#include <assert.h>
#include <math.h>
#include <bft_mem.h>
#include "cs_math.h"
#include "cs_scheme_geometry.h"
#include "cs_reco.h"
Include dependency graph for cs_reco.c:

Macros

#define _dp3   cs_math_3_dot_product
 

Functions

void cs_reco_conf_vtx_dofs (const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const double *dof, double *p_crec[], double *p_frec[])
 Reconstruct at cell centers and face centers a vertex-based field Linear interpolation. If p_crec and/or p_frec are not allocated, this done in this subroutine. More...
 
void cs_reco_pv_at_cell_centers (const cs_adjacency_t *c2v, const cs_cdo_quantities_t *quant, const double *array, cs_real_t *val_xc)
 Reconstruct the value at all cell centers from an array of values defined on primal vertices. More...
 
void cs_reco_vect_pv_at_cell_centers (const cs_adjacency_t *c2v, const cs_cdo_quantities_t *quant, const double *array, cs_real_t *val_xc)
 Reconstruct the value at all cell centers from an array of values defined on primal vertices. Case of vector-valued fields. More...
 
void cs_reco_cell_vect_from_face_dofs (const cs_adjacency_t *c2f, const cs_cdo_quantities_t *cdoq, const cs_real_t i_face_vals[], const cs_real_t b_face_vals[], cs_real_t *cell_reco)
 Reconstruct the vector-valued quantity inside each cell from the face DoFs (interior and boundary). Scalar-valued face DoFs are related to the normal flux across faces. More...
 
void cs_reco_pv_at_cell_center (cs_lnum_t c_id, const cs_adjacency_t *c2v, const cs_cdo_quantities_t *quant, const double *array, cs_real_t *val_xc)
 Reconstruct the value at the cell center from an array of values defined on primal vertices. More...
 
void cs_reco_vect_pv_from_pc (const cs_adjacency_t *c2v, const cs_cdo_quantities_t *quant, const double *val, cs_real_t *reco_val)
 Reconstruct a vector-valued array at vertices from a vector-valued array at cells. More...
 
void cs_reco_pf_from_pv (cs_lnum_t f_id, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const double *pdi, cs_real_t *pdi_f)
 Reconstruct the value at the face center from an array of values defined on primal vertices. More...
 
void cs_reco_dfbyc_at_cell_center (cs_lnum_t c_id, const cs_adjacency_t *c2e, const cs_cdo_quantities_t *quant, const double *array, cs_real_3_t val_xc)
 Reconstruct a constant vector at the cell center from an array of values defined on dual faces lying inside each cell. This array is scanned thanks to the c2e connectivity. More...
 
void cs_reco_dfbyc_in_cell (const cs_cell_mesh_t *cm, const cs_real_t *array, cs_real_3_t val_c)
 Reconstruct a constant vector inside the cell c. array is scanned thanks to the c2e connectivity. Pointer is already located at the beginning of the cell sequence. Reconstruction used is based on DGA (stabilization = 1/d where d is the space dimension) More...
 
void cs_reco_dfbyc_in_pec (const cs_cell_mesh_t *cm, short int e, const cs_real_t *array, cs_real_3_t val_pec)
 Reconstruct a constant vector inside pec which is a volume surrounding the edge e inside the cell c. array is scanned thanks to the c2e connectivity. Pointer is already located at the beginning of the cell sequence. Reconstruction used is based on DGA (stabilization = 1/d where d is the space dimension) More...
 
void cs_reco_ccen_edge_dof (cs_lnum_t cid, const cs_adjacency_t *c2e, const cs_cdo_quantities_t *quant, const double *dof, double reco[])
 Reconstruct at the cell center a field of edge-based DoFs. More...
 
void cs_reco_ccen_edge_dofs (const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const double *dof, double *p_ccrec[])
 Reconstruct at each cell center a field of edge-based DoFs. More...
 
void cs_reco_grad_cell_from_pv (cs_lnum_t c_id, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_real_t *pdi, cs_real_t val_xc[])
 Reconstruct the value at the cell center of the gradient of a field defined on primal vertices. More...
 
void cs_reco_cw_cell_vect_from_face_dofs (const cs_cell_mesh_t *cm, const cs_real_t i_face_vals[], const cs_real_t b_face_vals[], cs_real_t *cell_reco)
 Reconstruct the vector-valued quantity inside each cell from the face DoFs (interior and boundary). Scalar-valued face DoFs are related to the normal flux across faces. More...
 
void cs_reco_cw_cell_grad_from_scalar_pv (const cs_cell_mesh_t *cm, const cs_real_t pdi[], cs_real_t *cell_gradient)
 Reconstruct the value of a scalar potential at a point inside a cell The scalar potential has DoFs located at primal vertices. More...
 
cs_real_t cs_reco_cw_scalar_pv_inside_cell (const cs_cell_mesh_t *cm, const cs_real_t pdi[], const cs_real_t length_xcxp, const cs_real_t unitv_xcxp[], cs_real_t wbuf[])
 Reconstruct the value of a scalar potential at a point inside a cell The scalar potential has DoFs located at primal vertices. More...
 
void cs_reco_cw_vgrd_wbs_from_pvc (const cs_cell_mesh_t *cm, const cs_real_t *pot, cs_cell_builder_t *cb, cs_real_t *vgrd)
 Compute the weighted (by volume) gradient inside a given primal cell for the related vertices. 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_reco_cw_cgrd_wbs_from_pvc (const cs_cell_mesh_t *cm, const cs_real_t *pot, cs_cell_builder_t *cb, cs_real_t *cgrd)
 Compute the mean value of a gradient 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...
 

Macro Definition Documentation

◆ _dp3

#define _dp3   cs_math_3_dot_product

Function Documentation

◆ cs_reco_ccen_edge_dof()

void cs_reco_ccen_edge_dof ( cs_lnum_t  cid,
const cs_adjacency_t c2e,
const cs_cdo_quantities_t quant,
const double *  dof,
double  reco[] 
)

Reconstruct at the cell center a field of edge-based DoFs.

Parameters
[in]cidcell id
[in]c2ecell -> edges connectivity
[in]quantpointer to the additional quantities struct.
[in]dofpointer to the field of edge-based DoFs
[in,out]recovalue of the reconstructed field at cell center

◆ cs_reco_ccen_edge_dofs()

void cs_reco_ccen_edge_dofs ( const cs_cdo_connect_t connect,
const cs_cdo_quantities_t quant,
const double *  dof,
double *  p_ccrec[] 
)

Reconstruct at each cell center a field of edge-based DoFs.

Parameters
[in]connectpointer to the connectivity struct.
[in]quantpointer to the additional quantities struct.
[in]dofpointer to the field of edge-based DoFs
[in,out]p_ccrecpointer to the reconstructed values

◆ cs_reco_cell_vect_from_face_dofs()

void cs_reco_cell_vect_from_face_dofs ( const cs_adjacency_t c2f,
const cs_cdo_quantities_t cdoq,
const cs_real_t  i_face_vals[],
const cs_real_t  b_face_vals[],
cs_real_t cell_reco 
)

Reconstruct the vector-valued quantity inside each cell from the face DoFs (interior and boundary). Scalar-valued face DoFs are related to the normal flux across faces.

Parameters
[in]c2fcell -> faces connectivity
[in]quantpointer to the additional quantities struct.
[in]i_face_valsarray of DoF values for interior faces
[in]b_face_valsarray of DoF values for border faces
[out]cell_recovector-valued reconstruction inside cells

◆ cs_reco_conf_vtx_dofs()

void cs_reco_conf_vtx_dofs ( const cs_cdo_connect_t connect,
const cs_cdo_quantities_t quant,
const double *  dof,
double *  p_crec[],
double *  p_frec[] 
)

Reconstruct at cell centers and face centers a vertex-based field Linear interpolation. If p_crec and/or p_frec are not allocated, this done in this subroutine.

Parameters
[in]connectpointer to the connectivity struct.
[in]quantpointer to the additional quantities struct.
[in]dofpointer to the field of vtx-based DoFs
[in,out]p_crecreconstructed values at cell centers
[in,out]p_frecreconstructed values at face centers

◆ cs_reco_cw_cell_grad_from_scalar_pv()

void cs_reco_cw_cell_grad_from_scalar_pv ( const cs_cell_mesh_t cm,
const cs_real_t  pdi[],
cs_real_t cell_gradient 
)

Reconstruct the value of a scalar potential at a point inside a cell The scalar potential has DoFs located at primal vertices.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]pdiarray of DoF values at vertices
[out]cell_gradientgradient inside the cell

◆ cs_reco_cw_cell_vect_from_face_dofs()

void cs_reco_cw_cell_vect_from_face_dofs ( const cs_cell_mesh_t cm,
const cs_real_t  i_face_vals[],
const cs_real_t  b_face_vals[],
cs_real_t cell_reco 
)

Reconstruct the vector-valued quantity inside each cell from the face DoFs (interior and boundary). Scalar-valued face DoFs are related to the normal flux across faces.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]i_face_valsarray of DoF values for interior faces
[in]b_face_valsarray of DoF values for border faces
[out]cell_recovector-valued reconstruction inside the cell

◆ cs_reco_cw_cgrd_wbs_from_pvc()

void cs_reco_cw_cgrd_wbs_from_pvc ( const cs_cell_mesh_t cm,
const cs_real_t pot,
cs_cell_builder_t cb,
cs_real_t cgrd 
)

Compute the mean value of a gradient 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 + cell
[in,out]cbauxiliary structure for computing the flux
[in,out]cgrdmean-value of the cell gradient

◆ cs_reco_cw_scalar_pv_inside_cell()

cs_real_t cs_reco_cw_scalar_pv_inside_cell ( const cs_cell_mesh_t cm,
const cs_real_t  pdi[],
const cs_real_t  length_xcxp,
const cs_real_t  unitv_xcxp[],
cs_real_t  wbuf[] 
)

Reconstruct the value of a scalar potential at a point inside a cell The scalar potential has DoFs located at primal vertices.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]pdiarray of DoF values at vertices
[in]length_xcxplenght of the segment [x_c, x_p]
[in]unitv_xcxpunitary vector pointed from x_c to x_p
[in,out]wbufpointer to a temporary buffer
Returns
the value of the reconstructed potential at the evaluation point

◆ cs_reco_cw_vgrd_wbs_from_pvc()

void cs_reco_cw_vgrd_wbs_from_pvc ( const cs_cell_mesh_t cm,
const cs_real_t pot,
cs_cell_builder_t cb,
cs_real_t vgrd 
)

Compute the weighted (by volume) gradient inside a given primal cell for the related vertices. 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 + cell
[in,out]cbauxiliary structure for computing the flux
[in,out]vgrdgradient at vertices inside this cell

◆ cs_reco_dfbyc_at_cell_center()

void cs_reco_dfbyc_at_cell_center ( cs_lnum_t  c_id,
const cs_adjacency_t c2e,
const cs_cdo_quantities_t quant,
const double *  array,
cs_real_3_t  val_xc 
)

Reconstruct a constant vector at the cell center from an array of values defined on dual faces lying inside each cell. This array is scanned thanks to the c2e connectivity.

Parameters
[in]c_idcell id
[in]c2ecell -> edges connectivity
[in]quantpointer to the additional quantities struct.
[in]arraypointer to the array of values
[in,out]val_xcvalue of the reconstruction at the cell center

◆ cs_reco_dfbyc_in_cell()

void cs_reco_dfbyc_in_cell ( const cs_cell_mesh_t cm,
const cs_real_t array,
cs_real_3_t  val_c 
)

Reconstruct a constant vector inside the cell c. array is scanned thanks to the c2e connectivity. Pointer is already located at the beginning of the cell sequence. Reconstruction used is based on DGA (stabilization = 1/d where d is the space dimension)

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]arraylocal pointer to the array of values
[in,out]val_cvalue of the reconstructed vector in the cell

◆ cs_reco_dfbyc_in_pec()

void cs_reco_dfbyc_in_pec ( const cs_cell_mesh_t cm,
short int  e,
const cs_real_t array,
cs_real_3_t  val_pec 
)

Reconstruct a constant vector inside pec which is a volume surrounding the edge e inside the cell c. array is scanned thanks to the c2e connectivity. Pointer is already located at the beginning of the cell sequence. Reconstruction used is based on DGA (stabilization = 1/d where d is the space dimension)

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]elocal edge id
[in]arraylocal pointer to the array of values
[in,out]val_pecvalue of the reconstruction in pec

◆ cs_reco_grad_cell_from_pv()

void cs_reco_grad_cell_from_pv ( cs_lnum_t  c_id,
const cs_cdo_connect_t connect,
const cs_cdo_quantities_t quant,
const cs_real_t pdi,
cs_real_t  val_xc[] 
)

Reconstruct the value at the cell center of the gradient of a field defined on primal vertices.

Parameters
[in]c_idcell id
[in]connectpointer to a cs_cdo_connect_t structure
[in]quantpointer to the additional quantities struct.
[in]pdipointer to the array of values
[in,out]val_xcvalue of the reconstructed gradient at cell center

◆ cs_reco_pf_from_pv()

void cs_reco_pf_from_pv ( cs_lnum_t  f_id,
const cs_cdo_connect_t connect,
const cs_cdo_quantities_t quant,
const double *  pdi,
cs_real_t pdi_f 
)

Reconstruct the value at the face center from an array of values defined on primal vertices.

Parameters
[in]f_idface id (interior and border faces)
[in]connectpointer to a cs_cdo_connect_t structure
[in]quantpointer to the additional quantities struct.
[in]pdipointer to the array of values
[in,out]pdi_fvalue of the reconstruction at the face center

◆ cs_reco_pv_at_cell_center()

void cs_reco_pv_at_cell_center ( cs_lnum_t  c_id,
const cs_adjacency_t c2v,
const cs_cdo_quantities_t quant,
const double *  array,
cs_real_t val_xc 
)

Reconstruct the value at the cell center from an array of values defined on primal vertices.

Parameters
[in]c_idcell id
[in]c2vcell -> vertices connectivity
[in]quantpointer to the additional quantities struct.
[in]arraypointer to the array of values
[in,out]val_xcvalue of the reconstruction at the cell center

◆ cs_reco_pv_at_cell_centers()

void cs_reco_pv_at_cell_centers ( const cs_adjacency_t c2v,
const cs_cdo_quantities_t quant,
const double *  array,
cs_real_t val_xc 
)

Reconstruct the value at all cell centers from an array of values defined on primal vertices.

Parameters
[in]c2vcell -> vertices connectivity
[in]quantpointer to the additional quantities struct.
[in]arraypointer to the array of values
[in,out]val_xcvalues of the reconstruction at the cell center

◆ cs_reco_vect_pv_at_cell_centers()

void cs_reco_vect_pv_at_cell_centers ( const cs_adjacency_t c2v,
const cs_cdo_quantities_t quant,
const double *  array,
cs_real_t val_xc 
)

Reconstruct the value at all cell centers from an array of values defined on primal vertices. Case of vector-valued fields.

Parameters
[in]c2vcell -> vertices connectivity
[in]quantpointer to the additional quantities struct.
[in]arraypointer to the array of values
[in,out]val_xcvalues of the reconstruction at the cell center

◆ cs_reco_vect_pv_from_pc()

void cs_reco_vect_pv_from_pc ( const cs_adjacency_t c2v,
const cs_cdo_quantities_t quant,
const double *  val,
cs_real_t reco_val 
)

Reconstruct a vector-valued array at vertices from a vector-valued array at cells.

Parameters
[in]c2vcell -> vertices connectivity
[in]quantpointer to the additional quantities struct.
[in]valpointer to the array of values
[in,out]reco_valvalues of the reconstruction at vertices