107 double vertices[24]);
290 extern void *P2EST_DATA_UNINITIALIZED;
293 #define P2EST_QUADRANT_INIT(q) \
294 ((void) memset ((q), -1, sizeof (p2est_quadrant_t)))
341 double *top_vertices,
342 double height[3],
int min_zlevel,
399 int refine_recursive,
422 int refine_recursive,
436 int coarsen_recursive,
450 int coarsen_recursive,
467 P6EST_COMM_PARTITION = 1,
491 void p6est_partition_to_p4est_partition (
p6est_t *
p6est,
495 num_columns_in_proc);
496 void p4est_partition_to_p6est_partition (
p6est_t *
p6est,
548 size_t data_size,
int load_data,
555 p2est_quadrant_array_index (sc_array_t * array,
size_t it)
558 P4EST_ASSERT (it < array->elem_count);
566 p2est_quadrant_array_push (sc_array_t * array)
580 p2est_quadrant_mempool_alloc (sc_mempool_t * mempool)
590 p2est_quadrant_list_pop (sc_list_t * list)
595 #define P6EST_COLUMN_GET_RANGE(q,f,l) \
597 *(f) = (size_t) (q)->p.piggy3.local_num; \
598 *(l) = *(f) + (size_t) (q)->p.piggy3.which_tree; \
601 #define P6EST_COLUMN_SET_RANGE(q,f,l) \
603 (q)->p.piggy3.local_num = (p4est_locidx_t) (f); \
604 (q)->p.piggy3.which_tree = (p4est_topidx_t) ((l) - (f)); \
619 if (init_fn != NULL) {
620 init_fn (
p6est, which_tree, column, layer);
The top-level 2D p4est interface.
int32_t p4est_qcoord_t
Typedef for quadrant coordinates.
Definition: p4est_base.h:81
int32_t p4est_topidx_t
Typedef for counting topological entities (trees, tree vertices).
Definition: p4est_base.h:93
int32_t p4est_locidx_t
Typedef for processor-local indexing of quadrants and nodes.
Definition: p4est_base.h:106
int64_t p4est_gloidx_t
Typedef for globally unique indexing of quadrants.
Definition: p4est_base.h:118
int(* p6est_refine_column_t)(p6est_t *p6est, p4est_topidx_t which_tree, p4est_quadrant_t *column)
Callback function prototype to decide whether to horizontally refine a column, i.e....
Definition: p6est.h:251
void(* p6est_init_t)(p6est_t *p6est, p4est_topidx_t which_tree, p4est_quadrant_t *column, p2est_quadrant_t *layer)
Callback function prototype to initialize the layers's user data.
Definition: p6est.h:203
void p6est_balance(p6est_t *p6est, p8est_connect_type_t btype, p6est_init_t init_fn)
Balance a forest.
struct p6est_connectivity p6est_connectivity_t
This structure holds the 2D+1D inter-tree connectivity information.
p6est_t * p6est_load(const char *filename, sc_MPI_Comm mpicomm, size_t data_size, int load_data, void *user_pointer, p6est_connectivity_t **connectivity)
Load the complete connectivity/p6est structure from disk.
void p6est_connectivity_destroy(p6est_connectivity_t *conn)
Destroy a p6est_connectivity structure.
struct p2est_quadrant p2est_quadrant_t
A 1D quadrant datatype: this is used to encode a "layer" of a column in the 2D+1D AMR scheme.
p4est_gloidx_t p6est_partition(p6est_t *p6est, p6est_weight_t weight_fn)
Equally partition the forest.
void p6est_tree_get_vertices(p6est_connectivity_t *conn, p4est_topidx_t which_tree, double vertices[24])
Get the vertices of the corners of a tree.
struct p6est p6est_t
The p6est forest datatype.
void p6est_destroy(p6est_t *p6est)
Destroy a p6est.
void p6est_refine_layers(p6est_t *p6est, int refine_recursive, p6est_refine_layer_t refine_fn, p6est_init_t init_fn)
Refine the layers within the columns of a sheet.
void p6est_save(const char *filename, p6est_t *p6est, int save_data)
Save the complete connectivity/p6est data to disk.
int(* p6est_weight_t)(p6est_t *p6est, p4est_topidx_t which_tree, p4est_quadrant_t *column, p2est_quadrant_t *layer)
Callback function prototype to calculate weights for partitioning.
Definition: p6est.h:285
p6est_connectivity_t * p6est_connectivity_new(p4est_connectivity_t *conn4, double *top_vertices, double height[3])
Create a p6est_connectivity_t from a p4est_connectivity_t.
void p6est_coarsen_columns(p6est_t *p6est, int coarsen_recursive, p6est_coarsen_column_t coarsen_fn, p6est_init_t init_fn)
Coarsen the columns of a sheet.
int(* p6est_coarsen_column_t)(p6est_t *p6est, p4est_topidx_t which_tree, p4est_quadrant_t *columns[])
Callback function prototype to decide for horizontal coarsening.
Definition: p6est.h:268
void(* p6est_replace_t)(p6est_t *p6est, p4est_topidx_t which_tree, int num_outcolumns, int num_outlayers, p4est_quadrant_t *outcolumns[], p2est_quadrant_t *outlayers[], int num_incolumns, int num_inlayers, p4est_quadrant_t *incolumns[], p2est_quadrant_t *inlayers[])
Callback function prototype to transfer information from outgoing layers to incoming layers.
Definition: p6est.h:236
p6est_t * p6est_copy(p6est_t *input, int copy_data)
Make a deep copy of a p6est.
p6est_t * p6est_new(sc_MPI_Comm mpicomm, p6est_connectivity_t *connectivity, size_t data_size, p6est_init_t init_fn, void *user_pointer)
Create a new forest.
unsigned p6est_checksum(p6est_t *p6est)
Compute the checksum for a forest.
void p6est_coarsen_layers(p6est_t *p6est, int coarsen_recursive, p6est_coarsen_layer_t coarsen_fn, p6est_init_t init_fn)
Coarsen the layers of a sheet.
void p6est_reset_data(p6est_t *p6est, size_t data_size, p6est_init_t init_fn, void *user_pointer)
Reset user pointer and element data.
void p6est_refine_columns(p6est_t *p6est, int refine_recursive, p6est_refine_column_t refine_fn, p6est_init_t init_fn)
Refine the columns of a sheet.
int(* p6est_refine_layer_t)(p6est_t *p6est, p4est_topidx_t which_tree, p4est_quadrant_t *column, p2est_quadrant_t *layer)
Callback function prototype to decide whether to vertically refine a layer.
Definition: p6est.h:259
int(* p6est_coarsen_layer_t)(p6est_t *p6est, p4est_topidx_t which_tree, p4est_quadrant_t *column, p2est_quadrant_t *layers[])
Callback function prototype to decide for vertical coarsening.
Definition: p6est.h:276
#define P2EST_QUADRANT_INIT(q)
set statically allocated quadrant to defined values
Definition: p6est.h:293
p6est_t * p6est_new_from_p4est(p4est_t *p4est, double *top_vertices, double height[3], int min_zlevel, size_t data_size, p6est_init_t init_fn, void *user_pointer)
Create a new forest from an already created p4est that represents columns.
void p6est_qcoord_to_vertex(p6est_connectivity_t *connectivity, p4est_topidx_t treeid, p4est_qcoord_t x, p4est_qcoord_t y, p4est_qcoord_t z, double vxyz[3])
Transform a quadrant coordinate into the space spanned by tree vertices.
The connectivity defines the coarse topology of the forest.
p8est_connect_type_t
Characterize a type of adjacency.
Definition: p8est_connectivity.h:120
A 1D quadrant datatype: this is used to encode a "layer" of a column in the 2D+1D AMR scheme.
Definition: p6est.h:129
int8_t level
level of refinement
Definition: p6est.h:131
union p2est_quadrant::p6est_quadrant_data p
a union of additional data attached to a layer
int16_t pad16
padding
Definition: p6est.h:133
int8_t pad8
padding
Definition: p6est.h:132
p4est_qcoord_t z
vertical coordinate
Definition: p6est.h:130
This structure holds the 2D inter-tree connectivity information.
Definition: p4est_connectivity.h:190
The 2D quadrant datatype.
Definition: p4est.h:76
The p4est forest datatype.
Definition: p4est.h:150
This structure holds the 2D+1D inter-tree connectivity information.
Definition: p6est.h:65
p4est_connectivity_t * conn4
the 2D connecitvity; owned; vertices interpreted as the vertices of the bottom of the sheet
Definition: p6est.h:66
double * top_vertices
if NULL, uniform vertical profile, otherwise the vertices of the top of the sheet: should be the same...
Definition: p6est.h:69
double height[3]
if top_vertices == NULL, this gives the offset from the bottom of the sheet to the top
Definition: p6est.h:73
The p6est forest datatype.
Definition: p6est.h:167
void * user_pointer
convenience pointer for users, never touched by p4est
Definition: p6est.h:175
sc_MPI_Comm mpicomm
MPI communicator.
Definition: p6est.h:168
sc_mempool_t * user_data_pool
memory allocator for user data
Definition: p6est.h:184
int mpirank
this process's MPI rank
Definition: p6est.h:170
p4est_t * columns
2D description of column layout built from connectivity.
Definition: p6est.h:178
p6est_connectivity_t * connectivity
topology of sheet, not owned.
Definition: p6est.h:177
size_t data_size
size of per-quadrant p.user_data (see p2est_quadrant_t::p2est_quadrant_data::user_data)
Definition: p6est.h:173
int mpisize
number of MPI processes
Definition: p6est.h:169
p4est_gloidx_t * global_first_layer
first global quadrant index for each process and 1 beyond
Definition: p6est.h:189
p4est_qcoord_t root_len
height of the domain
Definition: p6est.h:191
int mpicomm_owned
whether this communicator is owned by the forest
Definition: p6est.h:171
sc_mempool_t * layer_pool
memory allocator for temporary layers
Definition: p6est.h:187
sc_array_t * layers
single array that stores p2est_quadrant_t layers within columns
Definition: p6est.h:182
p4est_topidx_t which_tree
the tree containing the quadrant
Definition: p6est.h:139
struct p2est_quadrant::p6est_quadrant_data::@12 piggy3
of ghost layers, store the tree and index in the owner's numbering
struct p2est_quadrant::p6est_quadrant_data::@11 piggy2
of transformed layers, store the original tree and the target tree
void * user_data
never changed by p4est
Definition: p6est.h:136
long user_long
never changed by p4est
Definition: p6est.h:137
int user_int
never changed by p4est
Definition: p6est.h:138
struct p2est_quadrant::p6est_quadrant_data::@10 piggy1
of ghost layer, store the tree and owner rank