My Project
programmer's documentation
Macros | Functions | Variables
cs_cdo_local.c File Reference

Routines to handle low-level actions related to CDO local quantities: More...

#include "cs_defs.h"
#include <assert.h>
#include <float.h>
#include <limits.h>
#include <bft_mem.h>
#include <bft_printf.h>
#include "cs_math.h"
#include "cs_param.h"
#include "cs_cdo_local.h"
Include dependency graph for cs_cdo_local.c:

Macros

#define CS_CDO_LOCAL_DBG   0
 

Functions

void cs_cdo_local_initialize (const cs_cdo_connect_t *connect)
 Allocate global structures related to a cs_cell_mesh_t and cs_face_mesh_t structures. More...
 
void cs_cdo_local_finalize (void)
 Free global structures related to cs_cell_mesh_t and cs_face_mesh_t structures. More...
 
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. More...
 
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. More...
 
void cs_cell_sys_free (cs_cell_sys_t **p_csys)
 Free a cs_cell_sys_t structure. More...
 
void cs_cell_sys_dump (const char msg[], const cs_cell_sys_t *csys)
 Dump a local system for debugging purpose. More...
 
cs_cell_builder_tcs_cell_builder_create (void)
 Allocate cs_cell_builder_t structure. More...
 
void cs_cell_builder_free (cs_cell_builder_t **p_cb)
 Free a cs_cell_builder_t structure. More...
 
cs_cell_mesh_tcs_cell_mesh_create (const cs_cdo_connect_t *connect)
 Allocate and initialize a cs_cell_mesh_t structure. More...
 
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. More...
 
void cs_cell_mesh_reset (cs_cell_mesh_t *cm)
 Initialize to invalid values a cs_cell_mesh_t structure. More...
 
void cs_cell_mesh_dump (const cs_cell_mesh_t *cm)
 Dump a cs_cell_mesh_t structure. More...
 
void cs_cell_mesh_free (cs_cell_mesh_t **p_cm)
 Free a cs_cell_mesh_t structure. More...
 
void cs_cell_mesh_build (cs_lnum_t c_id, cs_flag_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;. More...
 
cs_face_mesh_tcs_face_mesh_create (short int n_max_vbyf)
 Allocate a cs_face_mesh_t structure. More...
 
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. More...
 
void cs_face_mesh_free (cs_face_mesh_t **p_fm)
 Free a cs_face_mesh_t structure. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
void cs_face_mesh_light_free (cs_face_mesh_light_t **p_fm)
 Free a cs_face_mesh_light_t structure. More...
 
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. More...
 

Variables

cs_cell_mesh_t ** cs_cdo_local_cell_meshes = NULL
 
cs_face_mesh_t ** cs_cdo_local_face_meshes = NULL
 
cs_face_mesh_light_t ** cs_cdo_local_face_meshes_light = NULL
 
static const int n_robin_parameters = 3
 
static int cs_cdo_local_n_structures = 0
 
static const cs_flag_t cs_cdo_local_flag_v
 
static const cs_flag_t cs_cdo_local_flag_e
 
static const cs_flag_t cs_cdo_local_flag_peq
 
static const cs_flag_t cs_cdo_local_flag_f
 
static const cs_flag_t cs_cdo_local_flag_pfq
 
static const cs_flag_t cs_cdo_local_flag_deq
 
static const cs_flag_t cs_cdo_local_flag_fe
 
static const cs_flag_t cs_cdo_local_flag_ef
 
static double ** cs_cdo_local_dbuf = NULL
 
static short int ** cs_cdo_local_kbuf = NULL
 

Detailed Description

Routines to handle low-level actions related to CDO local quantities:

Macro Definition Documentation

◆ CS_CDO_LOCAL_DBG

#define CS_CDO_LOCAL_DBG   0

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 related to a cs_cell_mesh_t and cs_face_mesh_t structures.

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_mesh_build()

void cs_cell_mesh_build ( cs_lnum_t  c_id,
cs_flag_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_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 entries
[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

◆ 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

◆ 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.

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 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 = NULL

◆ cs_cdo_local_dbuf

double** cs_cdo_local_dbuf = NULL
static

◆ cs_cdo_local_face_meshes

cs_face_mesh_t** cs_cdo_local_face_meshes = NULL

◆ cs_cdo_local_face_meshes_light

cs_face_mesh_light_t** cs_cdo_local_face_meshes_light = NULL

◆ cs_cdo_local_flag_deq

const cs_flag_t cs_cdo_local_flag_deq
static

◆ cs_cdo_local_flag_e

const cs_flag_t cs_cdo_local_flag_e
static

◆ cs_cdo_local_flag_ef

const cs_flag_t cs_cdo_local_flag_ef
static
Initial value:

◆ cs_cdo_local_flag_f

const cs_flag_t cs_cdo_local_flag_f
static

◆ cs_cdo_local_flag_fe

const cs_flag_t cs_cdo_local_flag_fe
static

◆ cs_cdo_local_flag_peq

const cs_flag_t cs_cdo_local_flag_peq
static

◆ cs_cdo_local_flag_pfq

const cs_flag_t cs_cdo_local_flag_pfq
static

◆ cs_cdo_local_flag_v

const cs_flag_t cs_cdo_local_flag_v
static

◆ cs_cdo_local_kbuf

short int** cs_cdo_local_kbuf = NULL
static

◆ cs_cdo_local_n_structures

int cs_cdo_local_n_structures = 0
static

◆ n_robin_parameters

const int n_robin_parameters = 3
static
CS_FLAG_COMP_FV
#define CS_FLAG_COMP_FV
Definition: cs_flag.h:142
CS_FLAG_COMP_PEQ
#define CS_FLAG_COMP_PEQ
Definition: cs_flag.h:134
CS_FLAG_COMP_EV
#define CS_FLAG_COMP_EV
Definition: cs_flag.h:139
CS_FLAG_COMP_PF
#define CS_FLAG_COMP_PF
Definition: cs_flag.h:136
CS_FLAG_COMP_EFQ
#define CS_FLAG_COMP_EFQ
Definition: cs_flag.h:144
CS_FLAG_COMP_DFQ
#define CS_FLAG_COMP_DFQ
Definition: cs_flag.h:135
CS_FLAG_COMP_PV
#define CS_FLAG_COMP_PV
Definition: cs_flag.h:131
CS_FLAG_COMP_HFQ
#define CS_FLAG_COMP_HFQ
Definition: cs_flag.h:145
CS_FLAG_COMP_PE
#define CS_FLAG_COMP_PE
Definition: cs_flag.h:133
CS_FLAG_COMP_EF
#define CS_FLAG_COMP_EF
Definition: cs_flag.h:143
CS_FLAG_COMP_FE
#define CS_FLAG_COMP_FE
Definition: cs_flag.h:140
CS_FLAG_COMP_PVQ
#define CS_FLAG_COMP_PVQ
Definition: cs_flag.h:132
CS_FLAG_COMP_FEQ
#define CS_FLAG_COMP_FEQ
Definition: cs_flag.h:141
CS_FLAG_COMP_DEQ
#define CS_FLAG_COMP_DEQ
Definition: cs_flag.h:138
CS_FLAG_COMP_PFQ
#define CS_FLAG_COMP_PFQ
Definition: cs_flag.h:137