9.0
general documentation
Loading...
Searching...
No Matches
cs_cdo_local.h File Reference
#include "cdo/cs_cdo_connect.h"
#include "cdo/cs_cdo_quantities.h"
#include "cdo/cs_flag.h"
#include "cdo/cs_param_cdo.h"
#include "cdo/cs_sdm.h"
Include dependency graph for cs_cdo_local.h:

Go to the source code of this file.

Data Structures

struct  cs_cell_builder_t
 Set of local and temporary buffers. More...
struct  cs_cell_sys_t
 Set of arrays and local (small) dense matrices related to a mesh cell This is a key structure for building the local algebraic system. This structure belongs to one thread and only. More...
struct  cs_cell_mesh_t
 Set of local quantities and connectivities related to a mesh cell. More...
struct  cs_face_mesh_t
 Set of local quantities and connectivities related to a mesh face Structure used to get a better memory locality. Map existing structure into a more compact one dedicated to a face. Arrays are allocated to n_max_vbyf (= n_max_ebyf). Face-wise numbering is based on the f2e connectivity. More...
struct  cs_face_mesh_light_t

Functions

static bool cs_cell_has_boundary_elements (const cs_cell_builder_t *const cb)
 Check if at least one entity of the cell belongs to the boundary.
static short int cs_cell_mesh_get_v (const cs_lnum_t v_id, const cs_cell_mesh_t *const cm)
 Retrieve the vertex id in the cellwise numbering associated to the given vertex id in the mesh numbering.
static short int cs_cell_mesh_get_e (const cs_lnum_t e_id, const cs_cell_mesh_t *const cm)
 Retrieve the edge id in the cellwise numbering associated to the given edge id in the mesh numbering.
static short int cs_cell_mesh_get_f (const cs_lnum_t f_id, const cs_cell_mesh_t *const cm)
 Retrieve the face id in the cellwise numbering associated to the given face id in the mesh numbering.
static void cs_cell_mesh_get_f2v (short int f, const cs_cell_mesh_t *cm, short int *n_vf, short int *v_ids)
 Retrieve the list of vertices attached to a face.
static void cs_cell_mesh_get_next_3_vertices (const short int *f2e_ids, const short int *e2v_ids, short int *v0, short int *v1, short int *v2)
 Get the next three vertices in a row from a face to edge connectivity and a edge to vertex connectivity.
static bool cs_cell_mesh_is_boundary_face (const cs_cell_mesh_t *cm, const short int f)
 Is the face a boundary one ?
void cs_cdo_local_initialize (const cs_cdo_connect_t *connect)
 Allocate global structures used for build system with a cellwise or facewise process.
void cs_cdo_local_finalize (void)
 Free global structures related to cs_cell_mesh_t and cs_face_mesh_t structures.
cs_cell_sys_tcs_cell_sys_create (int n_max_dofbyc, int n_max_fbyc, int n_blocks, int *block_sizes)
 Allocate a cs_cell_sys_t structure.
void cs_cell_sys_reset (int n_fbyc, cs_cell_sys_t *csys)
 Reset all members related to BC and some other ones in a cs_cell_sys_t structure.
void cs_cell_sys_free (cs_cell_sys_t **p_csys)
 Free a cs_cell_sys_t structure.
void cs_cell_sys_dump (const char msg[], const cs_cell_sys_t *csys)
 Dump a local system for debugging purpose.
cs_cell_builder_tcs_cell_builder_create (void)
 Allocate cs_cell_builder_t structure.
void cs_cell_builder_free (cs_cell_builder_t **p_cb)
 Free a cs_cell_builder_t structure.
cs_cell_mesh_tcs_cell_mesh_create (const cs_cdo_connect_t *connect)
 Allocate and initialize a cs_cell_mesh_t structure.
cs_cell_mesh_tcs_cdo_local_get_cell_mesh (int mesh_id)
 Get a pointer to a cs_cell_mesh_t structure corresponding to mesh id.
void cs_cell_mesh_reset (cs_cell_mesh_t *cm)
 Initialize to invalid values a cs_cell_mesh_t structure.
void cs_cell_mesh_dump (const cs_cell_mesh_t *cm)
 Dump a cs_cell_mesh_t structure.
void cs_cell_mesh_free (cs_cell_mesh_t **p_cm)
 Free a cs_cell_mesh_t structure.
void cs_cell_mesh_build (cs_lnum_t c_id, cs_eflag_t build_flag, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, cs_cell_mesh_t *cm)
 Define a cs_cell_mesh_t structure for a given cell id. According to the requested level, some quantities may not be defined;.
cs_face_mesh_tcs_face_mesh_create (short int n_max_vbyf)
 Allocate a cs_face_mesh_t structure.
cs_face_mesh_tcs_cdo_local_get_face_mesh (int mesh_id)
 Get a pointer to a cs_face_mesh_t structure corresponding to mesh id.
void cs_face_mesh_free (cs_face_mesh_t **p_fm)
 Free a cs_face_mesh_t structure.
void cs_face_mesh_build (cs_lnum_t c_id, cs_lnum_t f_id, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, cs_face_mesh_t *fm)
 Define a cs_face_mesh_t structure for a given face/cell id.
void cs_face_mesh_build_from_cell_mesh (const cs_cell_mesh_t *cm, short int f, cs_face_mesh_t *fm)
 Define a cs_face_mesh_t structure for a given cell from a cs_cell_mesh_t structure. v_ids and e_ids are defined in the cell numbering given by cm.
cs_face_mesh_light_tcs_face_mesh_light_create (short int n_max_vbyf, short int n_max_vbyc)
 Allocate a cs_face_mesh_light_t structure.
cs_face_mesh_light_tcs_cdo_local_get_face_mesh_light (int mesh_id)
 Get a pointer to a cs_face_mesh_light_t structure corresponding to mesh id.
void cs_face_mesh_light_free (cs_face_mesh_light_t **p_fm)
 Free a cs_face_mesh_light_t structure.
void cs_face_mesh_light_build (const cs_cell_mesh_t *cm, short int f, cs_face_mesh_light_t *fm)
 Define a cs_face_mesh_light_t structure starting from a cs_cell_mesh_t structure.

Variables

cs_cell_mesh_t ** cs_cdo_local_cell_meshes
cs_face_mesh_t ** cs_cdo_local_face_meshes
cs_face_mesh_light_t ** cs_cdo_local_face_meshes_light

Function Documentation

◆ cs_cdo_local_finalize()

void cs_cdo_local_finalize ( void )

Free global structures related to cs_cell_mesh_t and cs_face_mesh_t structures.

◆ cs_cdo_local_get_cell_mesh()

cs_cell_mesh_t * cs_cdo_local_get_cell_mesh ( int mesh_id)

Get a pointer to a cs_cell_mesh_t structure corresponding to mesh id.

Parameters
[in]mesh_idid in the array of pointer to cs_cell_mesh_t struct.
Returns
a pointer to a cs_cell_mesh_t structure

◆ cs_cdo_local_get_face_mesh()

cs_face_mesh_t * cs_cdo_local_get_face_mesh ( int mesh_id)

Get a pointer to a cs_face_mesh_t structure corresponding to mesh id.

Parameters
[in]mesh_idid in the array of pointer to cs_face_mesh_t struct.
Returns
a pointer to a cs_face_mesh_t structure

◆ cs_cdo_local_get_face_mesh_light()

cs_face_mesh_light_t * cs_cdo_local_get_face_mesh_light ( int mesh_id)

Get a pointer to a cs_face_mesh_light_t structure corresponding to mesh id.

Parameters
[in]mesh_idid in the cs_face_mesh_light_t array
Returns
a pointer to a cs_face_mesh_light_t structure

◆ cs_cdo_local_initialize()

void cs_cdo_local_initialize ( const cs_cdo_connect_t * connect)

Allocate global structures used for build system with a cellwise or facewise process.

Parameters
[in]connectpointer to a cs_cdo_connect_t structure

◆ cs_cell_builder_create()

cs_cell_builder_t * cs_cell_builder_create ( void )

Allocate cs_cell_builder_t structure.

Returns
a pointer to the new allocated cs_cell_builder_t structure

◆ cs_cell_builder_free()

void cs_cell_builder_free ( cs_cell_builder_t ** p_cb)

Free a cs_cell_builder_t structure.

Parameters
[in,out]p_cbpointer of pointer to a cs_cell_builder_t struct

◆ cs_cell_has_boundary_elements()

bool cs_cell_has_boundary_elements ( const cs_cell_builder_t *const cb)
inlinestatic

Check if at least one entity of the cell belongs to the boundary.

Parameters
[in]cbpointer to a cs_cell_builder_t structure
Returns
true or false

◆ cs_cell_mesh_build()

void cs_cell_mesh_build ( cs_lnum_t c_id,
cs_eflag_t build_flag,
const cs_cdo_connect_t * connect,
const cs_cdo_quantities_t * quant,
cs_cell_mesh_t * cm )

Define a cs_cell_mesh_t structure for a given cell id. According to the requested level, some quantities may not be defined;.

Parameters
[in]c_idcell id
[in]build_flagindicate which members are really built
[in]connectpointer to a cs_cdo_connect_t structure
[in]quantpointer to a cs_cdo_quantities_t structure
[in,out]cmpointer to a cs_cell_mesh_t structure to set

◆ cs_cell_mesh_create()

cs_cell_mesh_t * cs_cell_mesh_create ( const cs_cdo_connect_t * connect)

Allocate and initialize a cs_cell_mesh_t structure.

Parameters
[in]connectpointer to a cs_cdo_connect_t structure
Returns
a pointer to a new allocated cs_cell_mesh_t structure

◆ cs_cell_mesh_dump()

void cs_cell_mesh_dump ( const cs_cell_mesh_t * cm)

Dump a cs_cell_mesh_t structure.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure

◆ cs_cell_mesh_free()

void cs_cell_mesh_free ( cs_cell_mesh_t ** p_cm)

Free a cs_cell_mesh_t structure.

Parameters
[in,out]p_cmpointer of pointer to a cs_cell_mesh_t structure

◆ cs_cell_mesh_get_e()

short int cs_cell_mesh_get_e ( const cs_lnum_t e_id,
const cs_cell_mesh_t *const cm )
inlinestatic

Retrieve the edge id in the cellwise numbering associated to the given edge id in the mesh numbering.

Parameters
[in]e_idvertex id in the mesh numbering
[in]cmpointer to a cs_cell_mesh_t structure
Returns
the edge id in the cell numbering or -1 if not found

◆ cs_cell_mesh_get_f()

short int cs_cell_mesh_get_f ( const cs_lnum_t f_id,
const cs_cell_mesh_t *const cm )
inlinestatic

Retrieve the face id in the cellwise numbering associated to the given face id in the mesh numbering.

Parameters
[in]f_idface id in the mesh numbering
[in]cmpointer to a cs_cell_mesh_t structure
Returns
the face id in the cell numbering or -1 if not found

◆ cs_cell_mesh_get_f2v()

void cs_cell_mesh_get_f2v ( short int f,
const cs_cell_mesh_t * cm,
short int * n_vf,
short int * v_ids )
inlinestatic

Retrieve the list of vertices attached to a face.

Parameters
[in]fface id in the cell numbering
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]n_vfpointer of pointer to a cellwise view of the mesh
[in,out]v_idslist of vertex ids in the cell numbering

◆ cs_cell_mesh_get_next_3_vertices()

void cs_cell_mesh_get_next_3_vertices ( const short int * f2e_ids,
const short int * e2v_ids,
short int * v0,
short int * v1,
short int * v2 )
inlinestatic

Get the next three vertices in a row from a face to edge connectivity and a edge to vertex connectivity.

Parameters
[in]f2e_idsface-edge connectivity
[in]e2v_idsedge-vertex connectivity
[in,out]v0id of the first vertex
[in,out]v1id of the second vertex
[in,out]v2id of the third vertex

◆ cs_cell_mesh_get_v()

short int cs_cell_mesh_get_v ( const cs_lnum_t v_id,
const cs_cell_mesh_t *const cm )
inlinestatic

Retrieve the vertex id in the cellwise numbering associated to the given vertex id in the mesh numbering.

Parameters
[in]v_idvertex id in the mesh numbering
[in]cmpointer to a cs_cell_mesh_t structure
Returns
the vertex id in the cell numbering or -1 if not found

◆ cs_cell_mesh_is_boundary_face()

bool cs_cell_mesh_is_boundary_face ( const cs_cell_mesh_t * cm,
const short int f )
inlinestatic

Is the face a boundary one ?

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]fid of the face in the cellwise numbering
Returns
true if this is a boundary face otherwise false

◆ cs_cell_mesh_reset()

void cs_cell_mesh_reset ( cs_cell_mesh_t * cm)

Initialize to invalid values a cs_cell_mesh_t structure.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure

◆ cs_cell_sys_create()

cs_cell_sys_t * cs_cell_sys_create ( int n_max_dofbyc,
int n_max_fbyc,
int n_blocks,
int * block_sizes )

Allocate a cs_cell_sys_t structure.

Parameters
[in]n_max_dofbycmax. number of DoFs at a cell-wise level
[in]n_max_fbycmax. number of faces in a cell
[in]n_blocksnumber of blocks in a row/column
[in]block_sizessize of each block or null. Specific treatment n_blocks = 1.
Returns
a pointer to a new allocated cs_cell_sys_t structure
Parameters
[in]n_max_dofbycmax. number of DoFs at a cell-wise level
[in]n_max_fbycmax. number of faces in a cell
[in]n_blocksnumber of blocks in a row/column
[in]block_sizessize of each block or nullptr. Specific treatment for n_blocks = 1.
Returns
a pointer to a new allocated cs_cell_sys_t structure

◆ cs_cell_sys_dump()

void cs_cell_sys_dump ( const char msg[],
const cs_cell_sys_t * csys )

Dump a local system for debugging purpose.

Parameters
[in]msgassociated message to print
[in]csyspointer to a cs_cell_sys_t structure

◆ cs_cell_sys_free()

void cs_cell_sys_free ( cs_cell_sys_t ** p_csys)

Free a cs_cell_sys_t structure.

Parameters
[in,out]p_csyspointer of pointer to a cs_cell_sys_t struct.
[in,out]p_csyspointer of pointer to a cs_cell_sys_t struct

◆ cs_cell_sys_reset()

void cs_cell_sys_reset ( int n_fbyc,
cs_cell_sys_t * csys )

Reset all members related to BC and some other ones in a cs_cell_sys_t structure.

Parameters
[in]n_fbycnumber of faces in a cell
[in,out]csyspointer to the cs_cell_sys_t struct to reset

◆ cs_face_mesh_build()

void cs_face_mesh_build ( cs_lnum_t c_id,
cs_lnum_t f_id,
const cs_cdo_connect_t * connect,
const cs_cdo_quantities_t * quant,
cs_face_mesh_t * fm )

Define a cs_face_mesh_t structure for a given face/cell id.

Parameters
[in]c_idcell id
[in]f_idface id in the mesh structure
[in]connectpointer to a cs_cdo_connect_t structure
[in]quantpointer to a cs_cdo_quantities_t structure
[in,out]fmpointer to a cs_face_mesh_t structure to set

◆ cs_face_mesh_build_from_cell_mesh()

void cs_face_mesh_build_from_cell_mesh ( const cs_cell_mesh_t * cm,
short int f,
cs_face_mesh_t * fm )

Define a cs_face_mesh_t structure for a given cell from a cs_cell_mesh_t structure. v_ids and e_ids are defined in the cell numbering given by cm.

Parameters
[in]cmpointer to the reference cs_cell_mesh_t structure
[in]fface id in the cs_cell_mesh_t structure
[in,out]fmpointer to a cs_face_mesh_t structure to set

Define a cs_face_mesh_t structure for a given cell from a cs_cell_mesh_t structure. v_ids and e_ids are defined in the cell numbering given by cm.

Parameters
[in]cmpointer to the reference cs_cell_mesh_t structure
[in]fface id in the cs_cell_mesh_t structure
[in,out]fmpointer to a cs_face_mesh_t structure to set

◆ cs_face_mesh_create()

cs_face_mesh_t * cs_face_mesh_create ( short int n_max_vbyf)

Allocate a cs_face_mesh_t structure.

Parameters
[in]n_max_vbyfmax. number of vertices for a face
Returns
a pointer to a new allocated cs_face_mesh_t structure
Parameters
[in]n_max_vbyfmax. number of vertices fir a face
Returns
a pointer to a new allocated cs_face_mesh_t structure

◆ cs_face_mesh_free()

void cs_face_mesh_free ( cs_face_mesh_t ** p_fm)

Free a cs_face_mesh_t structure.

Parameters
[in,out]p_fmpointer of pointer to a cs_face_mesh_t structure

◆ cs_face_mesh_light_build()

void cs_face_mesh_light_build ( const cs_cell_mesh_t * cm,
short int f,
cs_face_mesh_light_t * fm )

Define a cs_face_mesh_light_t structure starting from a cs_cell_mesh_t structure.

Parameters
[in]cmpointer to the reference cs_cell_mesh_t structure
[in]fface id in the cs_cell_mesh_t structure
[in,out]fmpointer to a cs_face_mesh_light_t structure to set

◆ cs_face_mesh_light_create()

cs_face_mesh_light_t * cs_face_mesh_light_create ( short int n_max_vbyf,
short int n_max_vbyc )

Allocate a cs_face_mesh_light_t structure.

Parameters
[in]n_max_vbyfmax. number of vertices for a face
[in]n_max_vbycmax. number of vertices for a cell
Returns
a pointer to a new allocated cs_face_mesh_light_t structure

◆ cs_face_mesh_light_free()

void cs_face_mesh_light_free ( cs_face_mesh_light_t ** p_fm)

Free a cs_face_mesh_light_t structure.

Parameters
[in,out]p_fmpointer of pointer to a cs_face_mesh_light_t struct.

Variable Documentation

◆ cs_cdo_local_cell_meshes

cs_cell_mesh_t** cs_cdo_local_cell_meshes
extern

◆ cs_cdo_local_face_meshes

cs_face_mesh_t** cs_cdo_local_face_meshes
extern

◆ cs_cdo_local_face_meshes_light

cs_face_mesh_light_t** cs_cdo_local_face_meshes_light
extern