8.3
general documentation
cs_scheme_geometry.cpp File Reference
#include "cs_defs.h"
#include <assert.h>
#include <float.h>
#include "cs_quadrature.h"
#include "cs_scheme_geometry.h"
+ Include dependency graph for cs_scheme_geometry.cpp:

Macros

#define CS_SCHEME_GEOMETRY_DBG   0
 
#define _dp3   cs_math_3_dot_product
 

Functions

static void _add_tria_to_covariance (const cs_real_t x1[3], const cs_real_t x2[3], const cs_real_t x3[3], const cs_nvec3_t ax, const cs_nvec3_t ay, const cs_real_t center[3], cs_real_t area, cs_real_t tensor[3])
 Update the covariance tensor with the contribution of the current triangle. More...
 
static void _add_tetra_to_inertia3 (const cs_real_t x1[3], const cs_real_t x2[3], const cs_real_t x3[3], const cs_real_t x4[3], const cs_real_t center[3], cs_real_t vol, cs_real_33_t tensor)
 Update the computation of the inertia tensor with the contribution of a tetrahedron. More...
 
static void _add_tetra_to_inertia (const cs_real_t x1[3], const cs_real_t x2[3], const cs_real_t x3[3], const cs_real_t x4[3], const cs_real_t center[3], cs_real_t vol, cs_real_33_t tensor)
 Update the computation of the inertia tensor with the contribution of a tetrahedron Ref.: F. Tonon "Explicit exact formulas for the 3D tetrahedron inertia tensor in terms of its vertex coordinates" (2004) J. of Mathematics and Statistics. More...
 
void cs_compute_face_covariance_tensor (const cs_cell_mesh_t *cm, short int f, const cs_nvec3_t ax, const cs_nvec3_t ay, const cs_real_t center[3], cs_real_t cov[3])
 Compute the inertial matrix of a cell with respect to the point called "center". This computation is performed exactly thanks to quadrature based on a "tetrahedrization" of the cell. More...
 
void cs_compute_inertia_tensor (const cs_cell_mesh_t *cm, const cs_real_t center[3], cs_real_t inertia[3][3])
 Compute the inertial matrix of a cell with respect to the point called "center". This computation is performed exactly thanks to quadrature based on a "tetrahedrization" of the cell. More...
 
void cs_compute_grd_ve (const short int v1, const short int v2, const cs_nvec3_t deq, const cs_real_3_t uvc[], const cs_real_t lvc[], cs_real_t *grd_v1, cs_real_t *grd_v2)
 Compute the gradient of a Lagrange hat function related to primal vertices in a p_{ef,c} subvolume of a cell c where e is an edge belonging to the face f with vertices v1 and v2. More...
 
void cs_compute_wef_wvf (short int f, const cs_cell_mesh_t *cm, cs_real_t *wvf, cs_real_t *wef)
 Compute for a face the weight related to each vertex w_{v,f} and the weight related to each edge w_{v,f} = |dc(v) cap f|/|f| Sum of w_{v,f} over the face vertices is equal to 1 Sum of w_{e,f} over the face edges is equal to 1. More...
 

Macro Definition Documentation

◆ _dp3

#define _dp3   cs_math_3_dot_product

◆ CS_SCHEME_GEOMETRY_DBG

#define CS_SCHEME_GEOMETRY_DBG   0

Function Documentation

◆ _add_tetra_to_inertia()

static void _add_tetra_to_inertia ( const cs_real_t  x1[3],
const cs_real_t  x2[3],
const cs_real_t  x3[3],
const cs_real_t  x4[3],
const cs_real_t  center[3],
cs_real_t  vol,
cs_real_33_t  tensor 
)
inlinestatic

Update the computation of the inertia tensor with the contribution of a tetrahedron Ref.: F. Tonon "Explicit exact formulas for the 3D tetrahedron inertia tensor in terms of its vertex coordinates" (2004) J. of Mathematics and Statistics.

Parameters
[in]x11st vertex coordinate
[in]x22nd vertex coordinate
[in]x33rd vertex coordinate
[in]x44th vertex coordinate
[in]centercenter used for the computation
[in]volvolume of the tetrahedron
[in,out]tensorinertia tensor to update

◆ _add_tetra_to_inertia3()

static void _add_tetra_to_inertia3 ( const cs_real_t  x1[3],
const cs_real_t  x2[3],
const cs_real_t  x3[3],
const cs_real_t  x4[3],
const cs_real_t  center[3],
cs_real_t  vol,
cs_real_33_t  tensor 
)
inlinestatic

Update the computation of the inertia tensor with the contribution of a tetrahedron.

Parameters
[in]x11st vertex coordinate
[in]x22nd vertex coordinate
[in]x33rd vertex coordinate
[in]x44th vertex coordinate
[in]centercenter used for the computation
[in]volvolume of the tetrahedron
[in,out]tensorinertia tensor to update

◆ _add_tria_to_covariance()

static void _add_tria_to_covariance ( const cs_real_t  x1[3],
const cs_real_t  x2[3],
const cs_real_t  x3[3],
const cs_nvec3_t  ax,
const cs_nvec3_t  ay,
const cs_real_t  center[3],
cs_real_t  area,
cs_real_t  tensor[3] 
)
inlinestatic

Update the covariance tensor with the contribution of the current triangle.

Parameters
[in]x11st vertex coordinate
[in]x22nd vertex coordinate
[in]x33rd vertex coordinate
[in]axmain X-axis for the face-related coordinate system
[in]aymain Y-axis for the face-related coordinate system
[in]centercenter used for the computation
[in]areaarea of the triangle
[in,out]tensorcovariance tensor to update

◆ cs_compute_face_covariance_tensor()

void cs_compute_face_covariance_tensor ( const cs_cell_mesh_t cm,
short int  f,
const cs_nvec3_t  ax,
const cs_nvec3_t  ay,
const cs_real_t  center[3],
cs_real_t  cov[3] 
)

Compute the inertial matrix of a cell with respect to the point called "center". This computation is performed exactly thanks to quadrature based on a "tetrahedrization" of the cell.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]fid of the face in the cell numbering
[in]axmain X-axis for the face-related coordinate system
[in]aymain Y-axis for the face-related coordinate system
[in]centercoordinates of the face center
[in,out]cov2x2 symmetric covariance matrix to compute

◆ cs_compute_grd_ve()

void cs_compute_grd_ve ( const short int  v1,
const short int  v2,
const cs_nvec3_t  deq,
const cs_real_3_t  uvc[],
const cs_real_t  lvc[],
cs_real_t grd_v1,
cs_real_t grd_v2 
)

Compute the gradient of a Lagrange hat function related to primal vertices in a p_{ef,c} subvolume of a cell c where e is an edge belonging to the face f with vertices v1 and v2.

Compute the gradient of a Lagrange function related to primal vertices in a p_{ef,c} subvolume of a cell c where e is an edge belonging to the face f with vertices v1 and v2.

Parameters
[in]v1number of the first vertex in cell numbering
[in]v2number of the second vertex in cell numbering
[in]deqdual edge quantities
[in]uvcxc --> xv unit tangent vector
[in]lvcxc --> xv vector length
[in,out]grd_v1gradient of Lagrange function related to v1
[in,out]grd_v2gradient of Lagrange function related to v2

◆ cs_compute_inertia_tensor()

void cs_compute_inertia_tensor ( const cs_cell_mesh_t cm,
const cs_real_t  center[3],
cs_real_t  inertia[3][3] 
)

Compute the inertial matrix of a cell with respect to the point called "center". This computation is performed exactly thanks to quadrature based on a "tetrahedrization" of the cell.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]centercoordinates of the cell center
[in,out]inertiainertia matrix to compute

◆ cs_compute_wef_wvf()

void cs_compute_wef_wvf ( short int  f,
const cs_cell_mesh_t cm,
cs_real_t wvf,
cs_real_t wef 
)

Compute for a face the weight related to each vertex w_{v,f} and the weight related to each edge w_{v,f} = |dc(v) cap f|/|f| Sum of w_{v,f} over the face vertices is equal to 1 Sum of w_{e,f} over the face edges is equal to 1.

Parameters
[in]fid of the face in the cell-wise numbering
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]wvfweights of each face vertex
[in,out]wefweights of each face edge