My Project
programmer's documentation
Functions | Variables
cs_quadrature.c File Reference
#include <math.h>
#include <assert.h>
#include "cs_flag.h"
#include "cs_quadrature.h"
Include dependency graph for cs_quadrature.c:

Functions

void cs_quadrature_setup (void)
 Compute constant weights for all quadratures used. More...
 
const char * cs_quadrature_get_type_name (const cs_quadrature_type_t type)
 Return th name associated to a type of quadrature. More...
 
void cs_quadrature_edge_2pts (const cs_real_3_t v1, const cs_real_3_t v2, double len, cs_real_3_t gpts[], double w[])
 Compute quadrature points for an edge from v1 -> v2 (2 points) Exact for polynomial function up to order 3. More...
 
void cs_quadrature_edge_3pts (const cs_real_3_t v1, const cs_real_3_t v2, double len, cs_real_3_t gpts[], double w[])
 Compute quadrature points for an edge from v1 -> v2 (3 points) Exact for polynomial function up to order 5. More...
 
void cs_quadrature_tria_3pts (const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, double area, cs_real_3_t gpts[], double w[])
 Compute quadrature points for a triangle (3 points) Exact for polynomial function up to order 2. More...
 
void cs_quadrature_tria_4pts (const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, double area, cs_real_3_t gpts[], double w[])
 Compute quadrature points for a triangle (4 points) Exact for polynomial function up to order 3. More...
 
void cs_quadrature_tria_7pts (const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, double area, cs_real_3_t gpts[], double w[])
 Compute quadrature points for a triangle (7 points) Exact for polynomial function up to order 5. More...
 
void cs_quadrature_tet_4pts (const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, const cs_real_3_t v4, double vol, cs_real_3_t gpts[], double weights[])
 Compute the quadrature in a tetrehedra. Exact for 2nd order polynomials (order 3). More...
 
void cs_quadrature_tet_5pts (const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, const cs_real_3_t v4, double vol, cs_real_3_t gpts[], double weights[])
 Compute the quadrature in a tetrehedra. Exact for 3rd order polynomials (order 4). More...
 
void cs_quadrature_tet_15pts (const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, const cs_real_3_t v4, double vol, cs_real_3_t gpts[], double weights[])
 Compute the quadrature in a tetrehedra. Exact for 5th order polynomials (order 6). More...
 
cs_flag_t cs_quadrature_get_flag (const cs_quadrature_type_t qtype, const cs_flag_t loc)
 Get the flags adapted to the given quadrature type qtype and the location on which the quadrature should be performed. More...
 

Variables

static const double _quad_25ov48 = 25./48.
 
static const double _quad_9ov16 = 9./16.
 
static const double _quad_over18 = 1./18.
 
static const double _quad_over6 = 1./6.
 
static const double _quad_over3 = 1./3.
 
static const double _quad_9ov40 = 9./40.
 
static const double _quad_31ov240 = 31./240.
 
static const double _tetr_quad15w3 = 10. / 189.
 
static const double _tetr_quad15w4 = 16. / 135.
 
static double _edge_quad2c1
 
static double _edge_quad2c2
 
static double _edge_quad3c1
 
static double _edge_quad3c2
 
static double _tria_quad7c1
 
static double _tria_quad7c2
 
static double _tria_quad7c3
 
static double _tria_quad7c4
 
static double _tetr_quad4c1
 
static double _tetr_quad4c2
 
static double _tetr_quad15g1
 
static double _tetr_quad15g11
 
static double _tetr_quad15g2
 
static double _tetr_quad15g21
 
static double _tetr_quad15g3
 
static double _tetr_quad15g31
 
static double _tetr_quad15w1
 
static double _tetr_quad15w2
 
static const char cs_quadrature_type_name [CS_QUADRATURE_N_TYPES][CS_BASE_STRING_LEN]
 

Function Documentation

◆ cs_quadrature_edge_2pts()

void cs_quadrature_edge_2pts ( const cs_real_3_t  v1,
const cs_real_3_t  v2,
double  len,
cs_real_3_t  gpts[],
double  w[] 
)

Compute quadrature points for an edge from v1 -> v2 (2 points) Exact for polynomial function up to order 3.

Parameters
[in]v1first vertex
[in]v2second vertex
[in]lenlength of edge [v1, v2]
[in,out]gptsgauss points
[in,out]wweight (same weight for the two points)

◆ cs_quadrature_edge_3pts()

void cs_quadrature_edge_3pts ( const cs_real_3_t  v1,
const cs_real_3_t  v2,
double  len,
cs_real_3_t  gpts[],
double  w[] 
)

Compute quadrature points for an edge from v1 -> v2 (3 points) Exact for polynomial function up to order 5.

Parameters
[in]v1first vertex
[in]v2second vertex
[in]lenlength of edge [v1, v2]
[in,out]gptsgauss points
[in,out]wweights

◆ cs_quadrature_get_flag()

cs_flag_t cs_quadrature_get_flag ( const cs_quadrature_type_t  qtype,
const cs_flag_t  loc 
)

Get the flags adapted to the given quadrature type qtype and the location on which the quadrature should be performed.

Parameters
[in]qtypecs_quadrature_type_t
[in]locIt could be CS_FLAG_CELL, CS_FLAG_FACE or CS_FLAG_EDGE plus CS_FLAG_PRIMAL or CS_FLAG_DUAL
Returns
metadata stored in a cs_flag_t to build a cs_cell_mesh_t

◆ cs_quadrature_get_type_name()

const char* cs_quadrature_get_type_name ( const cs_quadrature_type_t  type)

Return th name associated to a type of quadrature.

Parameters
[in]typecs_quadrature_type_t
Returns
the name associated to a given type of quadrature

◆ cs_quadrature_setup()

void cs_quadrature_setup ( void  )

Compute constant weights for all quadratures used.

◆ cs_quadrature_tet_15pts()

void cs_quadrature_tet_15pts ( const cs_real_3_t  v1,
const cs_real_3_t  v2,
const cs_real_3_t  v3,
const cs_real_3_t  v4,
double  vol,
cs_real_3_t  gpts[],
double  weights[] 
)

Compute the quadrature in a tetrehedra. Exact for 5th order polynomials (order 6).

Parameters
[in]v1first vertex
[in]v2second vertex
[in]v3third vertex
[in]v4fourth vertex
[in]volvolume of tetrahedron {v1, v2, v3, v4}
[in,out]gpts15 Gauss points (size = 3*15)
[in,out]weights15 weigths related to each Gauss point

◆ cs_quadrature_tet_4pts()

void cs_quadrature_tet_4pts ( const cs_real_3_t  v1,
const cs_real_3_t  v2,
const cs_real_3_t  v3,
const cs_real_3_t  v4,
double  vol,
cs_real_3_t  gpts[],
double  weights[] 
)

Compute the quadrature in a tetrehedra. Exact for 2nd order polynomials (order 3).

Parameters
[in]v1first vertex
[in]v2second vertex
[in]v3third vertex
[in]v4fourth vertex
[in]volvolume of tetrahedron {v1, v2, v3, v4}
[in,out]gpts4 Gauss points (size = 3*4)
[in,out]weightsweight (same value for all points)

◆ cs_quadrature_tet_5pts()

void cs_quadrature_tet_5pts ( const cs_real_3_t  v1,
const cs_real_3_t  v2,
const cs_real_3_t  v3,
const cs_real_3_t  v4,
double  vol,
cs_real_3_t  gpts[],
double  weights[] 
)

Compute the quadrature in a tetrehedra. Exact for 3rd order polynomials (order 4).

Parameters
[in]v1first vertex
[in]v2second vertex
[in]v3third vertex
[in]v4fourth vertex
[in]volvolume of tetrahedron {v1, v2, v3, v4}
[in,out]gpts5 Gauss points (size = 3*5)
[in,out]weights5 weigths related to each Gauss point

◆ cs_quadrature_tria_3pts()

void cs_quadrature_tria_3pts ( const cs_real_3_t  v1,
const cs_real_3_t  v2,
const cs_real_3_t  v3,
double  area,
cs_real_3_t  gpts[],
double  w[] 
)

Compute quadrature points for a triangle (3 points) Exact for polynomial function up to order 2.

Parameters
[in]v1first vertex
[in]v2second vertex
[in]v3third vertex
[in]areaarea of triangle {v1, v2, v3}
[in,out]gptsgauss points
[in,out]wweight (same weight for the three points)

◆ cs_quadrature_tria_4pts()

void cs_quadrature_tria_4pts ( const cs_real_3_t  v1,
const cs_real_3_t  v2,
const cs_real_3_t  v3,
double  area,
cs_real_3_t  gpts[],
double  w[] 
)

Compute quadrature points for a triangle (4 points) Exact for polynomial function up to order 3.

Parameters
[in]v1first vertex
[in]v2second vertex
[in]v3third vertex
[in]areaarea of triangle {v1, v2, v3}
[in,out]gptsgauss points
[in,out]wweights

◆ cs_quadrature_tria_7pts()

void cs_quadrature_tria_7pts ( const cs_real_3_t  v1,
const cs_real_3_t  v2,
const cs_real_3_t  v3,
double  area,
cs_real_3_t  gpts[],
double  w[] 
)

Compute quadrature points for a triangle (7 points) Exact for polynomial function up to order 5.

Parameters
[in]v1first vertex
[in]v2second vertex
[in]v3third vertex
[in]areaarea of triangle {v1, v2, v3}
[in,out]gptsgauss points
[in,out]wweights

Variable Documentation

◆ _edge_quad2c1

double _edge_quad2c1
static

◆ _edge_quad2c2

double _edge_quad2c2
static

◆ _edge_quad3c1

double _edge_quad3c1
static

◆ _edge_quad3c2

double _edge_quad3c2
static

◆ _quad_25ov48

const double _quad_25ov48 = 25./48.
static

◆ _quad_31ov240

const double _quad_31ov240 = 31./240.
static

◆ _quad_9ov16

const double _quad_9ov16 = 9./16.
static

◆ _quad_9ov40

const double _quad_9ov40 = 9./40.
static

◆ _quad_over18

const double _quad_over18 = 1./18.
static

◆ _quad_over3

const double _quad_over3 = 1./3.
static

◆ _quad_over6

const double _quad_over6 = 1./6.
static

◆ _tetr_quad15g1

double _tetr_quad15g1
static

◆ _tetr_quad15g11

double _tetr_quad15g11
static

◆ _tetr_quad15g2

double _tetr_quad15g2
static

◆ _tetr_quad15g21

double _tetr_quad15g21
static

◆ _tetr_quad15g3

double _tetr_quad15g3
static

◆ _tetr_quad15g31

double _tetr_quad15g31
static

◆ _tetr_quad15w1

double _tetr_quad15w1
static

◆ _tetr_quad15w2

double _tetr_quad15w2
static

◆ _tetr_quad15w3

const double _tetr_quad15w3 = 10. / 189.
static

◆ _tetr_quad15w4

const double _tetr_quad15w4 = 16. / 135.
static

◆ _tetr_quad4c1

double _tetr_quad4c1
static

◆ _tetr_quad4c2

double _tetr_quad4c2
static

◆ _tria_quad7c1

double _tria_quad7c1
static

◆ _tria_quad7c2

double _tria_quad7c2
static

◆ _tria_quad7c3

double _tria_quad7c3
static

◆ _tria_quad7c4

double _tria_quad7c4
static

◆ cs_quadrature_type_name

const char cs_quadrature_type_name[CS_QUADRATURE_N_TYPES][CS_BASE_STRING_LEN]
static
Initial value:
=
{ N_("none"),
N_("barycentric"),
N_("barycentric on a tetrahedral submesh"),
N_("higher (single weight)"),
N_("highest") }
N_
#define N_(String)
Definition: cs_defs.h:56