46#define P8EST_OLD_MAXLEVEL 19
47#define P8EST_MAXLEVEL 30
50#define P8EST_OLD_QMAXLEVEL 18
51#define P8EST_QMAXLEVEL 29
54#define P8EST_ROOT_LEN ((p4est_qcoord_t) 1 << P8EST_MAXLEVEL)
57#define P8EST_QUADRANT_LEN(l) ((p4est_qcoord_t) 1 << (P8EST_MAXLEVEL - (l)))
60#define P8EST_QUADRANT_MASK(l) (~(P8EST_QUADRANT_LEN (l) - 1))
64#define P8EST_LAST_OFFSET(l) (P8EST_ROOT_LEN - P8EST_QUADRANT_LEN (l))
233extern void *P8EST_DATA_UNINITIALIZED;
236#define P8EST_QUADRANT_INIT(q) \
237 ((void) memset ((q), -1, sizeof (p8est_quadrant_t)))
332 int refine_recursive,
345 int coarsen_recursive,
386 int allow_for_coarsening,
455 size_t data_size,
int load_data,
466 P4EST_ASSERT (array->elem_size == sizeof (
p8est_tree_t));
467 P4EST_ASSERT (it >= 0 && (
size_t) it < array->elem_count);
476p8est_quadrant_array_index (sc_array_t * array,
size_t it)
479 P4EST_ASSERT (it < array->elem_count);
493p8est_quadrant_array_push_copy (sc_array_t * array,
513p8est_quadrant_array_push (sc_array_t * array)
527p8est_quadrant_mempool_alloc (sc_mempool_t * mempool)
537p8est_quadrant_list_pop (sc_list_t * list)
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(* p8est_weight_t)(p8est_t *p8est, p4est_topidx_t which_tree, p8est_quadrant_t *quadrant)
Callback function prototype to calculate weights for partitioning.
Definition: p8est.h:229
int(* p8est_coarsen_t)(p8est_t *p8est, p4est_topidx_t which_tree, p8est_quadrant_t *quadrants[])
Callback function prototype to decide for coarsening.
Definition: p8est.h:219
int(* p8est_refine_t)(p8est_t *p8est, p4est_topidx_t which_tree, p8est_quadrant_t *quadrant)
Callback function prototype to decide for refinement.
Definition: p8est.h:209
void p8est_qcoord_to_vertex(p8est_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.
long p8est_revision(p8est_t *p8est)
Return the revision counter of the forest.
void p8est_refine(p8est_t *p8est, int refine_recursive, p8est_refine_t refine_fn, p8est_init_t init_fn)
Refine a forest.
p8est_t * p8est_load(const char *filename, sc_MPI_Comm mpicomm, size_t data_size, int load_data, void *user_pointer, p8est_connectivity_t **connectivity)
Load the complete connectivity/p8est structure from disk.
void p8est_partition(p8est_t *p8est, int allow_for_coarsening, p8est_weight_t weight_fn)
Equally partition the forest.
unsigned p8est_checksum_partition(p8est_t *p8est)
Compute a partition-dependent checksum for a forest.
void p8est_coarsen(p8est_t *p8est, int coarsen_recursive, p8est_coarsen_t coarsen_fn, p8est_init_t init_fn)
Coarsen a forest.
struct p8est p8est_t
The p8est forest datatype.
#define P8EST_QUADRANT_INIT(q)
set statically allocated quadrant to defined values
Definition: p8est.h:236
struct p8est_tree p8est_tree_t
The p8est tree datatype.
void p8est_destroy(p8est_t *p8est)
Destroy a p8est.
void p8est_save(const char *filename, p8est_t *p8est, int save_data)
Save the complete connectivity/p8est data to disk.
void p8est_reset_data(p8est_t *p8est, size_t data_size, p8est_init_t init_fn, void *user_pointer)
Reset user pointer and element data.
void p8est_balance(p8est_t *p8est, p8est_connect_type_t btype, p8est_init_t init_fn)
2:1 balance the size differences of neighboring elements in a forest.
void(* p8est_init_t)(p8est_t *p8est, p4est_topidx_t which_tree, p8est_quadrant_t *quadrant)
Callback function prototype to initialize the quadrant's user data.
Definition: p8est.h:199
p8est_t * p8est_copy(p8est_t *input, int copy_data)
Make a deep copy of a p8est.
size_t p8est_memory_used(p8est_t *p8est)
Calculate local memory usage of a forest structure.
p8est_t * p8est_new(sc_MPI_Comm mpicomm, p8est_connectivity_t *connectivity, size_t data_size, p8est_init_t init_fn, void *user_pointer)
Create a new forest with an initial coarse mesh.
unsigned p8est_checksum(p8est_t *p8est)
Compute the checksum for a forest.
struct p8est_quadrant p8est_quadrant_t
The 3D quadrant (i.e., octant) datatype.
The connectivity defines the coarse topology of the forest.
p8est_connect_type_t
Characterize a type of adjacency.
Definition: p8est_connectivity.h:119
This structure holds the 3D inter-tree connectivity information.
Definition: p8est_connectivity.h:215
Definition: p8est_extended.h:67
The 3D quadrant (i.e., octant) datatype.
Definition: p8est.h:68
int8_t level
level of refinement
Definition: p8est.h:72
union p8est_quadrant::p8est_quadrant_data p
a union of additional data attached to a quadrant
int16_t pad16
padding
Definition: p8est.h:74
p4est_qcoord_t z
coordinates
Definition: p8est.h:70
int8_t pad8
padding
Definition: p8est.h:73
The p8est tree datatype.
Definition: p8est.h:111
p8est_quadrant_t first_desc
first local descendant
Definition: p8est.h:113
int8_t maxlevel
highest local quadrant level
Definition: p8est.h:120
p4est_locidx_t quadrants_per_level[P8EST_MAXLEVEL+1]
locals only
Definition: p8est.h:118
sc_array_t quadrants
locally stored quadrants
Definition: p8est.h:112
p8est_quadrant_t last_desc
last local descendant
Definition: p8est.h:114
p4est_locidx_t quadrants_offset
cumulative sum over earlier trees on this processor (locals only)
Definition: p8est.h:115
The p8est forest datatype.
Definition: p8est.h:132
p4est_gloidx_t global_num_quadrants
number of quadrants on all trees on all processors
Definition: p8est.h:151
size_t data_size
size of per-quadrant p.user_data (see p8est_quadrant_t::p8est_quadrant_data::user_data)
Definition: p8est.h:137
p4est_topidx_t last_local_tree
0-based index of last local tree, must be -2 for an empty processor
Definition: p8est.h:146
sc_array_t * trees
array of all trees
Definition: p8est.h:160
p4est_gloidx_t * global_first_quadrant
first global quadrant index for each process and 1 beyond
Definition: p8est.h:153
p4est_topidx_t first_local_tree
0-based index of first local tree, must be -1 for an empty processor
Definition: p8est.h:143
sc_MPI_Comm mpicomm
MPI communicator.
Definition: p8est.h:133
p4est_locidx_t local_num_quadrants
number of quadrants on all trees on this processor
Definition: p8est.h:149
p8est_inspect_t * inspect
algorithmic switches
Definition: p8est.h:167
sc_mempool_t * quadrant_pool
memory allocator for temporary quadrants
Definition: p8est.h:165
sc_mempool_t * user_data_pool
memory allocator for user data
Definition: p8est.h:162
int mpicomm_owned
flag if communicator is owned
Definition: p8est.h:136
int mpisize
number of MPI processes
Definition: p8est.h:134
void * user_pointer
convenience pointer for users, never touched by p4est
Definition: p8est.h:139
p8est_quadrant_t * global_first_position
first smallest possible quad for each process and 1 beyond
Definition: p8est.h:156
int mpirank
this process's MPI rank
Definition: p8est.h:135
long revision
Gets bumped on mesh change.
Definition: p8est.h:142
p8est_connectivity_t * connectivity
connectivity structure, not owned
Definition: p8est.h:159
struct p8est_quadrant::p8est_quadrant_data::@15 piggy1
of ghost octants, store the tree and owner rank
struct p8est_quadrant::p8est_quadrant_data::@16 piggy2
of transformed octants, store the original tree and the target tree
struct p8est_quadrant::p8est_quadrant_data::@17 piggy3
of ghost octants, store the tree and index in the owner's numbering
int user_int
never changed by p4est
Definition: p8est.h:79
void * user_data
never changed by p4est
Definition: p8est.h:77
long user_long
never changed by p4est
Definition: p8est.h:78
p4est_topidx_t which_tree
the tree containing the quadrant (used in auxiliary octants such as the ghost octants in p4est_ghost_...
Definition: p8est.h:80