46 #define P8EST_OLD_MAXLEVEL 19
49 #define P8EST_MAXLEVEL 30
52 #define P8EST_OLD_QMAXLEVEL 18
55 #define P8EST_QMAXLEVEL 29
58 #define P8EST_ROOT_LEN ((p4est_qcoord_t) 1 << P8EST_MAXLEVEL)
61 #define P8EST_QUADRANT_LEN(l) ((p4est_qcoord_t) 1 << (P8EST_MAXLEVEL - (l)))
64 #define P8EST_QUADRANT_MASK(l) (~(P8EST_QUADRANT_LEN (l) - 1))
68 #define P8EST_LAST_OFFSET(l) (P8EST_ROOT_LEN - P8EST_QUADRANT_LEN (l))
247 extern void *P8EST_DATA_UNINITIALIZED;
250 #define P8EST_QUADRANT_INIT(q) \
251 ((void) memset ((q), -1, sizeof (p8est_quadrant_t)))
346 int refine_recursive,
359 int coarsen_recursive,
402 int allow_for_coarsening,
471 size_t data_size,
int load_data,
482 P4EST_ASSERT (array->elem_size == sizeof (
p8est_tree_t));
483 P4EST_ASSERT (it >= 0 && (
size_t) it < array->elem_count);
492 p8est_quadrant_array_index (sc_array_t * array,
size_t it)
495 P4EST_ASSERT (it < array->elem_count);
509 p8est_quadrant_array_push_copy (sc_array_t * array,
529 p8est_quadrant_array_push (sc_array_t * array)
543 p8est_quadrant_mempool_alloc (sc_mempool_t * mempool)
553 p8est_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
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.
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:243
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:233
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:223
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.
#define P8EST_MAXLEVEL
The finest level for representing quadrant midpoint coordinates.
Definition: p8est.h:49
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.
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.
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.
struct p8est p8est_t
The p8est forest datatype.
#define P8EST_QUADRANT_INIT(q)
set statically allocated quadrant to defined values
Definition: p8est.h:250
p8est_t * p8est_copy(p8est_t *input, int copy_data)
Make a deep copy of a p8est.
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:213
size_t p8est_memory_used(p8est_t *p8est)
Calculate local memory usage of a forest structure.
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:120
This structure holds the 3D inter-tree connectivity information.
Definition: p8est_connectivity.h:216
Definition: p8est_extended.h:67
The 3D quadrant (i.e., octant) datatype.
Definition: p8est.h:72
int8_t level
level of refinement
Definition: p8est.h:76
union p8est_quadrant::p8est_quadrant_data p
a union of additional data attached to a quadrant
int16_t pad16
padding
Definition: p8est.h:78
p4est_qcoord_t z
coordinates
Definition: p8est.h:74
int8_t pad8
padding
Definition: p8est.h:77
The p8est tree datatype.
Definition: p8est.h:125
p8est_quadrant_t first_desc
first local descendant
Definition: p8est.h:127
int8_t maxlevel
highest local quadrant level
Definition: p8est.h:134
p4est_locidx_t quadrants_per_level[P8EST_MAXLEVEL+1]
locals only
Definition: p8est.h:132
sc_array_t quadrants
locally stored quadrants
Definition: p8est.h:126
p8est_quadrant_t last_desc
last local descendant
Definition: p8est.h:128
p4est_locidx_t quadrants_offset
cumulative sum over earlier trees on this processor (locals only)
Definition: p8est.h:129
The p8est forest datatype.
Definition: p8est.h:146
p4est_gloidx_t global_num_quadrants
number of quadrants on all trees on all processors
Definition: p8est.h:165
size_t data_size
size of per-quadrant p.user_data (see p8est_quadrant_t::p8est_quadrant_data::user_data)
Definition: p8est.h:151
p4est_topidx_t last_local_tree
0-based index of last local tree, must be -2 for an empty processor
Definition: p8est.h:160
sc_array_t * trees
array of all trees
Definition: p8est.h:174
p4est_gloidx_t * global_first_quadrant
first global quadrant index for each process and 1 beyond
Definition: p8est.h:167
p4est_topidx_t first_local_tree
0-based index of first local tree, must be -1 for an empty processor
Definition: p8est.h:157
sc_MPI_Comm mpicomm
MPI communicator.
Definition: p8est.h:147
p4est_locidx_t local_num_quadrants
number of quadrants on all trees on this processor
Definition: p8est.h:163
p8est_inspect_t * inspect
algorithmic switches
Definition: p8est.h:181
sc_mempool_t * quadrant_pool
memory allocator for temporary quadrants
Definition: p8est.h:179
sc_mempool_t * user_data_pool
memory allocator for user data
Definition: p8est.h:176
int mpicomm_owned
flag if communicator is owned
Definition: p8est.h:150
int mpisize
number of MPI processes
Definition: p8est.h:148
void * user_pointer
convenience pointer for users, never touched by p4est
Definition: p8est.h:153
p8est_quadrant_t * global_first_position
first smallest possible quad for each process and 1 beyond
Definition: p8est.h:170
int mpirank
this process's MPI rank
Definition: p8est.h:149
long revision
Gets bumped on mesh change.
Definition: p8est.h:156
p8est_connectivity_t * connectivity
connectivity structure, not owned
Definition: p8est.h:173
Union for quadrant data.
Definition: p8est.h:89
int user_int
never changed by p4est
Definition: p8est.h:92
void * user_data
never changed by p4est
Definition: p8est.h:90
struct p8est_quadrant::p8est_quadrant_data::@13 piggy1
of ghost octants, store the tree and owner rank; not part of the API
long user_long
never changed by p4est
Definition: p8est.h:91
struct p8est_quadrant::p8est_quadrant_data::@15 piggy3
of ghost octants, store the tree and index in the owner's numbering; only part of the API in p8est_gh...
struct p8est_quadrant::p8est_quadrant_data::@14 piggy2
of transformed octants, store the original tree and the target tree; not part of the API
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:93