p4est 2.8.6
p4est is a software library for parallel adaptive mesh refinement.
Data Fields
p8est_mesh_t Struct Reference

This structure contains complete mesh information on a 2:1 balanced forest. More...

#include <p8est_mesh.h>

Collaboration diagram for p8est_mesh_t:
Collaboration graph
[legend]

Data Fields

p4est_locidx_t local_num_quadrants
 number of process-local quadrants
 
p4est_locidx_t ghost_num_quadrants
 number of ghost-layer quadrants
 
p4est_topidx_tquad_to_tree
 tree index for each local quad. More...
 
int * ghost_to_proc
 processor for each ghost quad
 
p4est_locidx_tquad_to_quad
 one index for each of the 6 faces
 
int8_t * quad_to_face
 encodes orientation/2:1 status
 
sc_array_t * quad_to_half
 stores half-size neighbors
 
sc_array_t * quad_level
 Stores lists of per-level quads. More...
 
p4est_locidx_t local_num_edges
 unsame-size and tree-boundary edges
 
p4est_locidx_tquad_to_edge
 12 indices for each local quad
 
sc_array_t * edge_offset
 local_num_edges + 1 entries
 
sc_array_t * edge_quad
 edge_offset indexes into this
 
sc_array_t * edge_edge
 and this one too (type int8_t)
 
p4est_locidx_t local_num_corners
 tree-boundary corners
 
p4est_locidx_tquad_to_corner
 8 indices for each local quad
 
sc_array_t * corner_offset
 local_num_corners + 1 entries
 
sc_array_t * corner_quad
 corner_offset indexes into this
 
sc_array_t * corner_corner
 and this one too (type int8_t)
 
p8est_mesh_params_t params
 parameters the mesh was created with, e.g. More...
 

Detailed Description

This structure contains complete mesh information on a 2:1 balanced forest.

It stores the locally relevant neighborhood, that is, all locally owned quadrants and one layer of adjacent ghost quadrants and their owners.

For each local quadrant, its tree number is stored in quad_to_tree. The quad_to_tree array is NULL by default and can be enabled using p8est_mesh_new_ext or p8est_mesh_new_params. For each ghost quadrant, its owner rank is stored in ghost_to_proc. For each level, an array of local quadrant numbers is stored in quad_level. The quad_level array is NULL by default and can be enabled using p8est_mesh_new_ext or p8est_mesh_new_params.

The quad_to_quad list stores one value for each local quadrant's face. This value is in 0..local_num_quadrants-1 for local quadrants, or in local_num_quadrants + (0..ghost_num_quadrants-1) for ghost quadrants.

The quad_to_face list has equally many entries that are either:

  1. A value of v = 0..23 indicates one same-size neighbor. This value is decoded as v = r * 6 + nf, where nf = 0..5 is the neighbor's connecting face number and r = 0..3 is the relative orientation of the neighbor's face; see p8est_connectivity.h.
  2. A value of v = 24..119 indicates a double-size neighbor. This value is decoded as v = 24 + h * 24 + r * 6 + nf, where r and nf are as above and h = 0..3 is the number of the subface. h designates the subface of the large neighbor that the quadrant touches (this is the same as the large neighbor's face corner).
  3. A value of v = -24..-1 indicates four half-size neighbors. In this case the corresponding quad_to_quad index points into the quad_to_half array that stores four quadrant numbers per index, and the orientation of the smaller faces follows from 24 + v. The entries of quad_to_half encode between local and ghost quadrant in the same way as the quad_to_quad values described above. The small neighbors in quad_to_half are stored in the sequence of the face corners of this, i.e., the large quadrant.

A quadrant on the boundary of the forest sees itself and its face number.

The quad_to_edge list stores edge neighbors that are not face neighbors. On the inside of a tree, there are one or two of those depending on size. Between trees, there can be any number of same- or different-sized neighbors. For same-tree same-size neighbors, we record their number in quad_to_edge by the same convention as described for quad_to_quad above. In this case, the neighbor's matching edge number is always diagonally opposite, that is, edge number ^ 3.

For half- and double-size and all inter-tree edge neighbors, the quad_to_edge value is in local_num_quadrants + local_num_ghosts + [0 .. local_num_edges - 1]. After subtracting the number of local and ghost quadrants, it indexes into edge_offset, which encodes a group of edge neighbors. Each member of a group may be one same/double-size quadrant or two half-size quadrants; this is determined by the value of the edge_edge field as follows.

  1. A value of e = 0..23 indicates one same-size neighbor. This value is encoded as e = r * 12 + ne, where ne = 0..11 is the neighbor's connecting edge number and r = 0..1 indicates an edge flip.
  2. A value of e = 24..71 indicates a double-size neighbor. This value is decoded as e = 24 + h * 24 + r * 12 + ne, where r and ne are as above and h = 0..1 is the number of the subedge. h designates the subedge of the large neighbor that the quadrant touches (this is the same as the large neighbor's edge corner).
  3. A value of e = -24..-1 indicates two half-size neighbors. They are represented by two consecutive entries of the edge_quad and edge_edge arrays with identical values for edge_edge. The orientation of the smaller edges follows from 24 + e. The small neighbors in edge_quad are stored in the sequence of the edge corners of this, i.e., the large quadrant.

Edges with no diagonal neighbor at all are assigned the value -3. This only happens on the domain boundary, which is necessarily a tree boundary. Edge neighbors for face-hanging nodes are assigned the value -1.

The quad_to_corner list stores corner neighbors that are not face or edge neighbors. On the inside of a tree, there is precisely one such neighbor per corner. In this case, its index is encoded as described above for quad_to_quad. The neighbor's matching corner number is always diagonally opposite, that is, corner number ^ 7.

On the inside of an inter-tree face, we have precisely one corner neighbor. If a corner is across an inter-tree edge or corner, then the number of corner neighbors may be any non-negative number. In all three cases, the quad_to_corner value is in local_num_quadrants + local_num_ghosts + [0 .. local_num_corners - 1]. After subtracting the number of local and ghost quadrants, it indexes into corner_offset, which encodes a group of corner neighbors. Each group contains the quadrant numbers encoded as usual for quad_to_quad in corner_quad, and the corner number from the neighbor as corner_corner.

Corners with no diagonal neighbor at all are assigned the value -3. This only happens on the domain boundary, which is necessarily a tree boundary. If edgehanging_corners in params is 0, all corner-neighbors for face- and edge-hanging nodes are assigned the value -1. If it is 1, we check for corner neighbors across coarse edges and assign -1 for the remaining face- and edge-hanging nodes.

The params struct describes the parameters the mesh was created with. For full control over the parameters, use p8est_mesh_new_params for mesh creation.

Field Documentation

◆ params

p8est_mesh_params_t p8est_mesh_t::params

parameters the mesh was created with, e.g.

by passing them to p8est_mesh_new_ext or p8est_mesh_new_params

◆ quad_level

sc_array_t* p8est_mesh_t::quad_level

Stores lists of per-level quads.

The array has entries indexed by 0..P4EST_QMAXLEVEL inclusive that are arrays of local quadrant ids. Is NULL if compute_level_lists in params is 0.

◆ quad_to_tree

p4est_topidx_t* p8est_mesh_t::quad_to_tree

tree index for each local quad.

Is NULL if compute_tree_index in params is 0.


The documentation for this struct was generated from the following file: