p4est  1.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions
p4est_mesh.h File Reference

forest topology in a conventional mesh format More...

#include <p4est_ghost.h>

Go to the source code of this file.

Data Structures

struct  p4est_mesh_t
 This structure contains complete mesh information on the forest. More...
 
struct  p4est_mesh_face_neighbor_t
 This structure can be used as the status of a face neighbor iterator. More...
 

Functions

size_t p4est_mesh_memory_used (p4est_mesh_t *mesh)
 Calculate the memory usage of the mesh structure. More...
 
p4est_mesh_tp4est_mesh_new (p4est_t *p4est, p4est_ghost_t *ghost, p4est_connect_type_t btype)
 Create a p4est_mesh structure. More...
 
void p4est_mesh_destroy (p4est_mesh_t *mesh)
 Destroy a p4est_mesh structure. More...
 
p4est_quadrant_tp4est_mesh_quadrant_cumulative (p4est_t *p4est, p4est_locidx_t cumulative_id, p4est_topidx_t *which_tree, p4est_locidx_t *quadrant_id)
 Find a quadrant based on its cumulative number in the local forest. More...
 
void p4est_mesh_face_neighbor_init2 (p4est_mesh_face_neighbor_t *mfn, p4est_t *p4est, p4est_ghost_t *ghost, p4est_mesh_t *mesh, p4est_topidx_t which_tree, p4est_locidx_t quadrant_id)
 Initialize a mesh neighbor iterator by quadrant index. More...
 
void p4est_mesh_face_neighbor_init (p4est_mesh_face_neighbor_t *mfn, p4est_t *p4est, p4est_ghost_t *ghost, p4est_mesh_t *mesh, p4est_topidx_t which_tree, p4est_quadrant_t *quadrant)
 Initialize a mesh neighbor iterator by quadrant pointer. More...
 
p4est_quadrant_tp4est_mesh_face_neighbor_next (p4est_mesh_face_neighbor_t *mfn, p4est_topidx_t *ntree, p4est_locidx_t *nquad, int *nface, int *nrank)
 Move the iterator forward to loop around neighbors of the quadrant. More...
 
void * p4est_mesh_face_neighbor_data (p4est_mesh_face_neighbor_t *mfn, void *ghost_data)
 Get the user data for the current face neighbor. More...
 

Detailed Description

forest topology in a conventional mesh format

Function Documentation

void p4est_mesh_destroy ( p4est_mesh_t mesh)

Destroy a p4est_mesh structure.

Parameters
[in]meshMesh structure previously created by p4est_mesh_new.
void* p4est_mesh_face_neighbor_data ( p4est_mesh_face_neighbor_t mfn,
void *  ghost_data 
)

Get the user data for the current face neighbor.

Parameters
[in]mfnInternal status of the iterator.
[in]ghost_dataData for the ghost quadrants that has been synchronized with p4est_ghost_exchange_data.
Returns
A pointer to the user data for the current neighbor.
void p4est_mesh_face_neighbor_init ( p4est_mesh_face_neighbor_t mfn,
p4est_t p4est,
p4est_ghost_t ghost,
p4est_mesh_t mesh,
p4est_topidx_t  which_tree,
p4est_quadrant_t quadrant 
)

Initialize a mesh neighbor iterator by quadrant pointer.

Parameters
[out]mfnA p4est_mesh_face_neighbor_t to be initialized.
[in]which_treeTree of quadrant whose neighbors are looped over.
[in]quadrantPointer to quadrant contained in which_tree.
void p4est_mesh_face_neighbor_init2 ( p4est_mesh_face_neighbor_t mfn,
p4est_t p4est,
p4est_ghost_t ghost,
p4est_mesh_t mesh,
p4est_topidx_t  which_tree,
p4est_locidx_t  quadrant_id 
)

Initialize a mesh neighbor iterator by quadrant index.

Parameters
[out]mfnA p4est_mesh_face_neighbor_t to be initialized.
[in]which_treeTree of quadrant whose neighbors are looped over.
[in]quadrant_idIndex relative to which_tree of quadrant.
p4est_quadrant_t* p4est_mesh_face_neighbor_next ( p4est_mesh_face_neighbor_t mfn,
p4est_topidx_t ntree,
p4est_locidx_t nquad,
int *  nface,
int *  nrank 
)

Move the iterator forward to loop around neighbors of the quadrant.

Parameters
[in,out]mfnInternal status of the iterator.
[out]ntreeIf not NULL, the tree number of the neighbor.
[out]nquadIf not NULL, the quadrant number within tree. For ghosts instead the number in ghost layer.
[out]nfaceIf not NULL, neighbor's face as in p4est_mesh_t.
[out]nrankIf not NULL, the owner process of the neighbor.
Returns
Either a real quadrant or one from the ghost layer. Returns NULL when the iterator is done.
size_t p4est_mesh_memory_used ( p4est_mesh_t mesh)

Calculate the memory usage of the mesh structure.

Parameters
[in]meshMesh structure.
Returns
Memory used in bytes.
p4est_mesh_t* p4est_mesh_new ( p4est_t p4est,
p4est_ghost_t ghost,
p4est_connect_type_t  btype 
)

Create a p4est_mesh structure.

Parameters
[in]p4estA forest that is fully 2:1 balanced.
[in]ghostThe ghost layer created from the provided p4est.
[in]btypeDetermines the highest codimension of neighbors.
Returns
A fully allocated mesh structure.
p4est_quadrant_t* p4est_mesh_quadrant_cumulative ( p4est_t p4est,
p4est_locidx_t  cumulative_id,
p4est_topidx_t which_tree,
p4est_locidx_t quadrant_id 
)

Find a quadrant based on its cumulative number in the local forest.

Parameters
[in]p4estForest to be worked with.
[in]cumulative_idCumulative index over all trees of quadrant.
[in,out]which_treeIf not NULL, the input value can be -1 or an initial guess for the quadrant's tree and output is the tree of returned quadrant.
[out]quadrant_idIf not NULL, the number of quadrant in tree.
Returns
The identified quadrant.