programmer's documentation
Macros | Functions
cs_cdo_connect.c File Reference
#include "cs_defs.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <bft_mem.h>
#include <bft_printf.h>
#include "cs_order.h"
#include "cs_sort.h"
#include "cs_cdo.h"
#include "cs_cdo_connect.h"
Include dependency graph for cs_cdo_connect.c:

Macros

#define CS_CDO_CONNECT_DBG   0
 

Functions

static void _add_f2e_entry (cs_lnum_t shift, cs_lnum_t v1_num, cs_lnum_t v2_num, const _edge_builder_t *builder, cs_sla_matrix_t *f2e)
 Add a entry in the face –> edges connectivity. More...
 
static cs_sla_matrix_t_build_f2e_connect (const cs_mesh_t *m, const _edge_builder_t *builder)
 Define the face -> edges connectivity which is stored in a cs_sla_matrix_t structure. More...
 
static cs_sla_matrix_t_build_e2v_connect (const _edge_builder_t *builder)
 Define the edge -> vertices connectivity which is stored in a cs_sla_matrix_t structure. More...
 
static _edge_builder_t * _create_edge_builder (const cs_mesh_t *m)
 Allocate and define a _edge_builder_t structure. More...
 
static void _free_edge_builder (_edge_builder_t **p_builder)
 Destroy a _edge_builder structure. More...
 
static cs_sla_matrix_t_build_c2f_connect (const cs_mesh_t *mesh)
 Define the cell -> faces connectivity which is stored in a cs_sla_matrix_t structure. More...
 
static void _build_additional_connect (cs_cdo_connect_t *connect)
 Build additional connectivities for accessing geometrical quantities c2e: cell –> edges connectivity c2v: cell –> vertices connectivity. More...
 
static void _compute_max_ent (cs_cdo_connect_t *connect)
 Compute max number of entities by cell. More...
 
static cs_connect_info_t_connect_info_create (cs_lnum_t n_elts)
 Allocated and initialize a cs_connect_info_t structure. More...
 
static cs_connect_info_t_connect_info_free (cs_connect_info_t *info)
 Allocated and initialize a cs_cdo_connect_info_t structure. More...
 
static void _define_connect_info (cs_cdo_connect_t *connect)
 Define a status Int/Border 1st and 2nd level for sets of vertices, edges and faces. More...
 
const char * cs_cdo_connect_flagname (short int flag)
 String related to flag in cs_cdo_connect_info_t. More...
 
cs_cdo_connect_tcs_cdo_connect_build (const cs_mesh_t *m)
 Define a cs_cdo_connect_t structure. More...
 
cs_cdo_connect_tcs_cdo_connect_free (cs_cdo_connect_t *connect)
 Destroy a cs_cdo_connect_t structure. More...
 
void cs_cdo_connect_resume (const cs_cdo_connect_t *connect)
 Resume connectivity information. More...
 
void cs_cdo_connect_dump (const cs_cdo_connect_t *connect)
 Dump a cs_cdo_connect_t structure. More...
 
cs_connect_index_tcs_index_create (int n)
 Create an index structure of size n. More...
 
cs_connect_index_tcs_index_map (int n, int *idx, int *ids)
 Map arrays into an index structure of size n (owner = false) More...
 
void cs_index_free (cs_connect_index_t **pidx)
 Destroy a cs_connect_index_t structure. More...
 
cs_connect_index_tcs_index_compose (int nc, const cs_connect_index_t *a2b, const cs_connect_index_t *b2c)
 From 2 indexes : A -> B and B -> C create a new index A -> C. More...
 
cs_connect_index_tcs_index_transpose (int nb, const cs_connect_index_t *a2b)
 From a cs_connect_index_t A -> B create a new index B -> A. More...
 
void cs_index_sort (cs_connect_index_t *x)
 Sort each sub-list related to an entry in a cs_connect_index_t structure. More...
 
void cs_index_dump (const char *name, FILE *_f, cs_connect_index_t *x)
 Dump a cs_connect_index_t structure to a file or into the standard output. More...
 

Macro Definition Documentation

#define CS_CDO_CONNECT_DBG   0

Function Documentation

static void _add_f2e_entry ( cs_lnum_t  shift,
cs_lnum_t  v1_num,
cs_lnum_t  v2_num,
const _edge_builder_t *  builder,
cs_sla_matrix_t f2e 
)
static

Add a entry in the face –> edges connectivity.

Parameters
[in]shiftposition where to add the new entry
[in]v1_numnumber of the first vertex
[in]v2_numnumber of the second vertex
[in]builderpointer to a _edge_builder_t structure
[in,out]f2eface –> edges connectivity
static void _build_additional_connect ( cs_cdo_connect_t connect)
static

Build additional connectivities for accessing geometrical quantities c2e: cell –> edges connectivity c2v: cell –> vertices connectivity.

Parameters
[in,out]connectpointer to the cs_cdo_connect_t struct.
static cs_sla_matrix_t* _build_c2f_connect ( const cs_mesh_t mesh)
static

Define the cell -> faces connectivity which is stored in a cs_sla_matrix_t structure.

Parameters
[in]mpointer to a cs_mesh_t structure
Returns
a pointer to a new allocated cs_sla_matrix_t structure
static cs_sla_matrix_t* _build_e2v_connect ( const _edge_builder_t *  builder)
static

Define the edge -> vertices connectivity which is stored in a cs_sla_matrix_t structure.

Parameters
[in]builderpointer to the _edge_builder_t structure
Returns
a pointer to a new allocated cs_sla_matrix_t structure
static cs_sla_matrix_t* _build_f2e_connect ( const cs_mesh_t m,
const _edge_builder_t *  builder 
)
static

Define the face -> edges connectivity which is stored in a cs_sla_matrix_t structure.

Parameters
[in]mpointer to a cs_mesh_t structure
[in]builderpointer to the _edge_builder_t structure
Returns
a pointer to a new allocated cs_sla_matrix_t structure
static void _compute_max_ent ( cs_cdo_connect_t connect)
static

Compute max number of entities by cell.

Parameters
[in]connectpointer to the cs_cdo_connect_t struct.
static cs_connect_info_t* _connect_info_create ( cs_lnum_t  n_elts)
static

Allocated and initialize a cs_connect_info_t structure.

Parameters
[in]n_eltsSize of the maximal set of entities related to this structure
Returns
a pointer to the new allocated structure
static cs_connect_info_t* _connect_info_free ( cs_connect_info_t info)
static

Allocated and initialize a cs_cdo_connect_info_t structure.

Parameters
[in]n_eltsSize of the maximal set of entities related to this structure
Returns
a pointer to the new allocated structure
static _edge_builder_t* _create_edge_builder ( const cs_mesh_t m)
static

Allocate and define a _edge_builder_t structure.

Parameters
[in]mpointer to the cs_mesh_t structure
Returns
a pointer to a new allocated _edge_builder_t structure
static void _define_connect_info ( cs_cdo_connect_t connect)
static

Define a status Int/Border 1st and 2nd level for sets of vertices, edges and faces.

Parameters
[in,out]connectpointer to a cs_cdo_connect_t struct.
static void _free_edge_builder ( _edge_builder_t **  p_builder)
static

Destroy a _edge_builder structure.

Parameters
[in]p_builderpointer to the _edge_builder structure pointer
cs_cdo_connect_t* cs_cdo_connect_build ( const cs_mesh_t m)

Define a cs_cdo_connect_t structure.

Parameters
[in]mpointer to a cs_mesh_t structure
Returns
a pointer to a cs_cdo_connect_t structure
void cs_cdo_connect_dump ( const cs_cdo_connect_t connect)

Dump a cs_cdo_connect_t structure.

Parameters
[in]connectpointer to cs_cdo_connect_t structure
const char* cs_cdo_connect_flagname ( short int  flag)

String related to flag in cs_cdo_connect_info_t.

String related to flag in cs_connect_info_t.

Parameters
[in]flagretrieve name for this flag
cs_cdo_connect_t* cs_cdo_connect_free ( cs_cdo_connect_t connect)

Destroy a cs_cdo_connect_t structure.

Parameters
[in]connectpointer to the cs_cdo_connect_t struct. to destroy
Returns
a NULL pointer
void cs_cdo_connect_resume ( const cs_cdo_connect_t connect)

Resume connectivity information.

Parameters
[in]connectpointer to cs_cdo_connect_t structure
cs_connect_index_t* cs_index_compose ( int  nc,
const cs_connect_index_t a2b,
const cs_connect_index_t b2c 
)

From 2 indexes : A -> B and B -> C create a new index A -> C.

Parameters
[in]ncnumber of elements in C set
[in]xabpointer to the index A -> B
[in]b2cpointer to the index B -> C
Returns
a pointer to the cs_connect_index_t structure A -> C
cs_connect_index_t* cs_index_create ( int  n)

Create an index structure of size n.

Parameters
[in]nnumber of entries of the indexed list
Returns
a pointer to a cs_connect_index_t
void cs_index_dump ( const char *  name,
FILE *  _f,
cs_connect_index_t x 
)

Dump a cs_connect_index_t structure to a file or into the standard output.

Parameters
[in]namename of the dump file. Can be set to NULL
[in]_fpointer to a FILE structure. Can be set to NULL.
[in]xpointer to a cs_connect_index_t structure
void cs_index_free ( cs_connect_index_t **  pidx)

Destroy a cs_connect_index_t structure.

Parameters
[in]pidxpointer of pointer to a cs_connect_index_t structure
cs_connect_index_t* cs_index_map ( int  n,
int *  idx,
int *  ids 
)

Map arrays into an index structure of size n (owner = false)

Parameters
[in]nnumber of entries of the indexed list
[in]idxarray of size n+1
[in]idsarray of size idx[n]
Returns
a pointer to a cs_connect_index_t
void cs_index_sort ( cs_connect_index_t x)

Sort each sub-list related to an entry in a cs_connect_index_t structure.

Sort each list related to an entry in a cs_connect_index_t structure.

Parameters
[in]xpointer to a cs_connect_index_t structure
cs_connect_index_t* cs_index_transpose ( int  nb,
const cs_connect_index_t a2b 
)

From a cs_connect_index_t A -> B create a new index B -> A.

From a cs_connect_index_t struct. A -> B create a new index B -> A.

Parameters
[in]nbsize of the "b" set
[in]a2bpointer to the index A -> B
Returns
a new pointer to the cs_connect_index_t structure B -> A