PPL Logo

libs/ck-libs/metis/libmetis/mesh.c File Reference

Go to the source code of this file.

Functions

int METIS_MeshToDual (idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, idx_t *ncommon, idx_t *numflag, idx_t **r_xadj, idx_t **r_adjncy)
int METIS_MeshToNodal (idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, idx_t *numflag, idx_t **r_xadj, idx_t **r_adjncy)
void CreateGraphDual (idx_t ne, idx_t nn, idx_t *eptr, idx_t *eind, idx_t ncommon, idx_t **r_xadj, idx_t **r_adjncy)
idx_t FindCommonElements (idx_t qid, idx_t elen, idx_t *eind, idx_t *nptr, idx_t *nind, idx_t *eptr, idx_t ncommon, idx_t *marker, idx_t *nbrs)
void CreateGraphNodal (idx_t ne, idx_t nn, idx_t *eptr, idx_t *eind, idx_t **r_xadj, idx_t **r_adjncy)
idx_t FindCommonNodes (idx_t qid, idx_t nelmnts, idx_t *elmntids, idx_t *eptr, idx_t *eind, idx_t *marker, idx_t *nbrs)
mesh_tCreateMesh (void)
void InitMesh (mesh_t *mesh)
void FreeMesh (mesh_t **r_mesh)


Function Documentation

int METIS_MeshToDual ( idx_t ne,
idx_t nn,
idx_t eptr,
idx_t eind,
idx_t ncommon,
idx_t numflag,
idx_t **  r_xadj,
idx_t **  r_adjncy 
)

This function creates a graph corresponding to the dual of a finite element mesh.

Parameters:
ne is the number of elements in the mesh.
nn is the number of nodes in the mesh.
eptr is an array of size ne+1 used to mark the start and end locations in the nind array.
eind is an array that stores for each element the set of node IDs (indices) that it is made off. The length of this array is equal to the total number of nodes over all the mesh elements.
ncommon is the minimum number of nodes that two elements must share in order to be connected via an edge in the dual graph.
numflag is either 0 or 1 indicating if the numbering of the nodes starts from 0 or 1, respectively. The same numbering is used for the returned graph as well.
r_xadj indicates where the adjacency list of each vertex is stored in r_adjncy. The memory for this array is allocated by this routine. It can be freed by calling METIS_free().
r_adjncy stores the adjacency list of each vertex in the generated dual graph. The memory for this array is allocated by this routine. It can be freed by calling METIS_free().

Definition at line 44 of file mesh.c.

References ChangeMesh2CNumbering(), ChangeMesh2FNumbering(), CreateGraphDual(), free(), gk_malloc_cleanup(), gk_malloc_init(), gk_sigtrap(), gk_siguntrap(), METIS_ERROR_MEMORY, and metis_rcode().

Referenced by main(), and METIS_PartMeshDual().

Here is the call graph for this function:

Here is the caller graph for this function:

int METIS_MeshToNodal ( idx_t ne,
idx_t nn,
idx_t eptr,
idx_t eind,
idx_t numflag,
idx_t **  r_xadj,
idx_t **  r_adjncy 
)

This function creates a graph corresponding to (almost) the nodal of a finite element mesh. In the nodal graph, each node is connected to the nodes corresponding to the union of nodes present in all the elements in which that node belongs.

Parameters:
ne is the number of elements in the mesh.
nn is the number of nodes in the mesh.
eptr is an array of size ne+1 used to mark the start and end locations in the nind array.
eind is an array that stores for each element the set of node IDs (indices) that it is made off. The length of this array is equal to the total number of nodes over all the mesh elements.
numflag is either 0 or 1 indicating if the numbering of the nodes starts from 0 or 1, respectively. The same numbering is used for the returned graph as well.
r_xadj indicates where the adjacency list of each vertex is stored in r_adjncy. The memory for this array is allocated by this routine. It can be freed by calling METIS_free().
r_adjncy stores the adjacency list of each vertex in the generated dual graph. The memory for this array is allocated by this routine. It can be freed by calling METIS_free().

Definition at line 114 of file mesh.c.

References ChangeMesh2CNumbering(), ChangeMesh2FNumbering(), CreateGraphNodal(), free(), gk_malloc_cleanup(), gk_malloc_init(), gk_sigtrap(), gk_siguntrap(), METIS_ERROR_MEMORY, and metis_rcode().

Referenced by main(), and METIS_PartMeshNodal().

Here is the call graph for this function:

Here is the caller graph for this function:

void CreateGraphDual ( idx_t  ne,
idx_t  nn,
idx_t eptr,
idx_t eind,
idx_t  ncommon,
idx_t **  r_xadj,
idx_t **  r_adjncy 
)

This function creates the dual of a finite element mesh

Definition at line 162 of file mesh.c.

References adjncy, FindCommonElements(), free(), gk_errexit(), gk_free(), malloc(), and xadj.

Referenced by METIS_MeshToDual().

Here is the call graph for this function:

Here is the caller graph for this function:

idx_t FindCommonElements ( idx_t  qid,
idx_t  elen,
idx_t eind,
idx_t nptr,
idx_t nind,
idx_t eptr,
idx_t  ncommon,
idx_t marker,
idx_t nbrs 
)

This function finds all elements that share at least ncommon nodes with the ``query'' element.

Definition at line 237 of file mesh.c.

References PUP::l.

Referenced by CreateGraphDual().

Here is the caller graph for this function:

void CreateGraphNodal ( idx_t  ne,
idx_t  nn,
idx_t eptr,
idx_t eind,
idx_t **  r_xadj,
idx_t **  r_adjncy 
)

This function creates the (almost) nodal of a finite element mesh

Definition at line 277 of file mesh.c.

References adjncy, FindCommonNodes(), free(), gk_errexit(), gk_free(), malloc(), and xadj.

Referenced by METIS_MeshToNodal().

Here is the call graph for this function:

Here is the caller graph for this function:

idx_t FindCommonNodes ( idx_t  qid,
idx_t  nelmnts,
idx_t elmntids,
idx_t eptr,
idx_t eind,
idx_t marker,
idx_t nbrs 
)

This function finds the union of nodes that are in the same elements with the ``query'' node.

Definition at line 348 of file mesh.c.

Referenced by CreateGraphNodal().

Here is the caller graph for this function:

mesh_t* CreateMesh ( void   ) 

This function creates and initializes a mesh_t structure

Definition at line 380 of file mesh.c.

References gk_malloc(), InitMesh(), and mesh.

Referenced by ReadMesh().

Here is the call graph for this function:

Here is the caller graph for this function:

void InitMesh ( mesh_t mesh  ) 

This function initializes a mesh_t data structure

Definition at line 395 of file mesh.c.

Referenced by CreateMesh().

Here is the caller graph for this function:

void FreeMesh ( mesh_t **  r_mesh  ) 

This function deallocates any memory stored in a mesh

Definition at line 404 of file mesh.c.

References mesh_t::eind, mesh_t::eptr, mesh_t::ewgt, gk_free(), and mesh.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on Mon Sep 21 08:09:32 2020 for Charm++ by  doxygen 1.5.5