programmer's documentation
Macros | Functions | Variables
cs_cdo_quantities.c File Reference
#include "cs_defs.h"
#include <limits.h>
#include <assert.h>
#include <float.h>
#include <math.h>
#include <string.h>
#include <bft_mem.h>
#include "cs_array_reduce.h"
#include "cs_log.h"
#include "cs_order.h"
#include "cs_parall.h"
#include "cs_prototypes.h"
#include "cs_cdo_quantities.h"
Include dependency graph for cs_cdo_quantities.c:

Macros

#define CS_CDO_QUANTITIES_DBG   0 /* Switch off/on debug information */
 
#define _n3   cs_math_3_norm
 
#define _dp3   cs_math_3_dot_product
 

Functions

static _cdo_fspec_t _get_fspec (cs_lnum_t f_id, const cs_mesh_t *m, const cs_mesh_quantities_t *mq)
 
static _cdo_projq_t _get_proj_quantities (cs_lnum_t f_id, const cs_cdo_connect_t *connect, const cs_real_t coords[], const int axis[])
 
static _cdo_fsubq_t _get_fsub_quantities (cs_lnum_t f_id, const cs_cdo_connect_t *connect, const cs_real_t *coord, _cdo_fspec_t fspec)
 
static void _compute_edge_quantities (const cs_mesh_t *mesh, const cs_cdo_connect_t *topo, cs_cdo_quantities_t *iq)
 
static void _compute_dcell_quantities (const cs_cdo_connect_t *topo, cs_cdo_quantities_t *quant)
 Compute dual cell volumes related to primal vertices Storage is based on the c2v connectivity. More...
 
static void _compute_dface_quantities (const cs_cdo_connect_t *topo, cs_cdo_quantities_t *quant)
 Compute dual face normals (face crossed by primal edges). Given a cell c and an edge e, there are two faces attached to the couple (c, e) For a face f in c, the triplet (e, f, c) induces a triangle s(e,f,c) The dual face is the union of these two triangles. Storage is based on the c2e connectivity. More...
 
static void _compute_quant_info (cs_cdo_quantities_t *quant)
 
static void _saturn_algorithm (const cs_mesh_t *mesh, const cs_mesh_quantities_t *mq, cs_cdo_quantities_t *cdoq)
 
static void _vtx_algorithm (const cs_mesh_t *mesh, const cs_mesh_quantities_t *mq, const cs_cdo_connect_t *connect, cs_cdo_quantities_t *quant)
 
static void _mirtich_algorithm (const cs_mesh_t *mesh, const cs_mesh_quantities_t *mq, const cs_cdo_connect_t *connect, cs_cdo_quantities_t *quant)
 
static void _define_cell_flag (const cs_cdo_connect_t *topo, cs_cdo_quantities_t *cdoq)
 
double cs_compute_area_from_quant (const cs_quant_t qa, const cs_real_t *xb)
 Compute the area of the triangle of base given by q (related to a segment) with apex located at xa. More...
 
cs_cdo_quantities_tcs_cdo_quantities_build (cs_cdo_cell_center_algo_t cc_algo, const cs_mesh_t *m, const cs_mesh_quantities_t *mq, const cs_cdo_connect_t *topo)
 Build a cs_cdo_quantities_t structure. More...
 
cs_cdo_quantities_tcs_cdo_quantities_free (cs_cdo_quantities_t *q)
 Destroy a cs_cdo_quantities_t structure. More...
 
void cs_cdo_quantities_summary (const cs_cdo_quantities_t *quant)
 Summarize generic information about the cdo mesh quantities. More...
 
void cs_cdo_quantities_dump (const cs_cdo_quantities_t *cdoq)
 Dump a cs_cdo_quantities_t structure. More...
 
void cs_quant_dump (FILE *f, cs_lnum_t num, const cs_quant_t q)
 Dump a cs_quant_t structure. More...
 

Variables

static const double one_12 = 1/12.
 
static const double one_24 = 1/24.
 

Macro Definition Documentation

◆ _dp3

#define _dp3   cs_math_3_dot_product

◆ _n3

#define _n3   cs_math_3_norm

◆ CS_CDO_QUANTITIES_DBG

#define CS_CDO_QUANTITIES_DBG   0 /* Switch off/on debug information */

Function Documentation

◆ _compute_dcell_quantities()

static void _compute_dcell_quantities ( const cs_cdo_connect_t topo,
cs_cdo_quantities_t quant 
)
static

Compute dual cell volumes related to primal vertices Storage is based on the c2v connectivity.

Parameters
[in]topopointer to a cs_cdo_connect_t structure
[in,out]quantpointer to cs_cdo_quantities_t structure

◆ _compute_dface_quantities()

static void _compute_dface_quantities ( const cs_cdo_connect_t topo,
cs_cdo_quantities_t quant 
)
static

Compute dual face normals (face crossed by primal edges). Given a cell c and an edge e, there are two faces attached to the couple (c, e) For a face f in c, the triplet (e, f, c) induces a triangle s(e,f,c) The dual face is the union of these two triangles. Storage is based on the c2e connectivity.

Parameters
[in]topopointer to a cs_cdo_connect_t structure
[in,out]quantpointer to cs_cdo_quantities_t structure

◆ _compute_edge_quantities()

static void _compute_edge_quantities ( const cs_mesh_t mesh,
const cs_cdo_connect_t topo,
cs_cdo_quantities_t iq 
)
static

◆ _compute_quant_info()

static void _compute_quant_info ( cs_cdo_quantities_t quant)
static

◆ _define_cell_flag()

static void _define_cell_flag ( const cs_cdo_connect_t topo,
cs_cdo_quantities_t cdoq 
)
static

◆ _get_fspec()

static _cdo_fspec_t _get_fspec ( cs_lnum_t  f_id,
const cs_mesh_t m,
const cs_mesh_quantities_t mq 
)
static

◆ _get_fsub_quantities()

static _cdo_fsubq_t _get_fsub_quantities ( cs_lnum_t  f_id,
const cs_cdo_connect_t connect,
const cs_real_t coord,
_cdo_fspec_t  fspec 
)
static

◆ _get_proj_quantities()

static _cdo_projq_t _get_proj_quantities ( cs_lnum_t  f_id,
const cs_cdo_connect_t connect,
const cs_real_t  coords[],
const int  axis[] 
)
static

◆ _mirtich_algorithm()

static void _mirtich_algorithm ( const cs_mesh_t mesh,
const cs_mesh_quantities_t mq,
const cs_cdo_connect_t connect,
cs_cdo_quantities_t quant 
)
static

◆ _saturn_algorithm()

static void _saturn_algorithm ( const cs_mesh_t mesh,
const cs_mesh_quantities_t mq,
cs_cdo_quantities_t cdoq 
)
static

◆ _vtx_algorithm()

static void _vtx_algorithm ( const cs_mesh_t mesh,
const cs_mesh_quantities_t mq,
const cs_cdo_connect_t connect,
cs_cdo_quantities_t quant 
)
static

◆ cs_cdo_quantities_build()

cs_cdo_quantities_t* cs_cdo_quantities_build ( cs_cdo_cell_center_algo_t  cc_algo,
const cs_mesh_t m,
const cs_mesh_quantities_t mq,
const cs_cdo_connect_t topo 
)

Build a cs_cdo_quantities_t structure.

Parameters
[in]cc_algotype of algorithm used for building the cell center
[in]mpointer to a cs_mesh_t structure
[in]mqpointer to a cs_mesh_quantities_t structure
[in]topopointer to a cs_cdo_connect_t structure
Returns
a new allocated pointer to a cs_cdo_quantities_t structure

◆ cs_cdo_quantities_dump()

void cs_cdo_quantities_dump ( const cs_cdo_quantities_t cdoq)

Dump a cs_cdo_quantities_t structure.

Parameters
[in]cdoqpointer to cs_cdo_quantities_t structure

◆ cs_cdo_quantities_free()

cs_cdo_quantities_t* cs_cdo_quantities_free ( cs_cdo_quantities_t q)

Destroy a cs_cdo_quantities_t structure.

Parameters
[in]qpointer to the cs_cdo_quantities_t struct. to free
Returns
a NULL pointer

◆ cs_cdo_quantities_summary()

void cs_cdo_quantities_summary ( const cs_cdo_quantities_t quant)

Summarize generic information about the cdo mesh quantities.

Parameters
[in]cdoqpointer to cs_cdo_quantities_t structure

◆ cs_compute_area_from_quant()

double cs_compute_area_from_quant ( const cs_quant_t  qa,
const cs_real_t xb 
)

Compute the area of the triangle of base given by q (related to a segment) with apex located at xa.

Parameters
[in]qapointer to a cs_quant_t structure related to a segment
[in]xbcoordinates of the apex to consider
Returns
the value the area of the triangle

◆ cs_quant_dump()

void cs_quant_dump ( FILE *  f,
cs_lnum_t  num,
const cs_quant_t  q 
)

Dump a cs_quant_t structure.

Parameters
[in]fFILE struct (stdout if NULL)
[in]numentity number related to this quantity struct.
[in]qcs_quant_t structure to dump

Variable Documentation

◆ one_12

const double one_12 = 1/12.
static

◆ one_24

const double one_24 = 1/24.
static