40 #ifdef P4EST_TO_P8EST_H
41 #error "The include files p4est.h and p4est_to_p8est.h cannot be combined"
50 #define P4EST_OLD_MAXLEVEL 30
53 #define P4EST_MAXLEVEL 30
56 #define P4EST_OLD_QMAXLEVEL 29
59 #define P4EST_QMAXLEVEL 29
62 #define P4EST_ROOT_LEN ((p4est_qcoord_t) 1 << P4EST_MAXLEVEL)
65 #define P4EST_QUADRANT_LEN(l) ((p4est_qcoord_t) 1 << (P4EST_MAXLEVEL - (l)))
68 #define P4EST_QUADRANT_MASK(l) (~(P4EST_QUADRANT_LEN (l) - 1))
72 #define P4EST_LAST_OFFSET(l) (P4EST_ROOT_LEN - P4EST_QUADRANT_LEN (l))
251 extern void *P4EST_DATA_UNINITIALIZED;
254 #define P4EST_QUADRANT_INIT(q) \
255 ((void) memset ((q), -1, sizeof (p4est_quadrant_t)))
349 int refine_recursive,
362 int coarsen_recursive,
402 int allow_for_coarsening,
471 size_t data_size,
int load_data,
482 P4EST_ASSERT (array->elem_size == sizeof (
p4est_tree_t));
483 P4EST_ASSERT (it >= 0 && (
size_t) it < array->elem_count);
492 p4est_quadrant_array_index (sc_array_t * array,
size_t it)
495 P4EST_ASSERT (it < array->elem_count);
509 p4est_quadrant_array_push_copy (sc_array_t * array,
529 p4est_quadrant_array_push (sc_array_t * array)
543 p4est_quadrant_mempool_alloc (sc_mempool_t * mempool)
553 p4est_quadrant_list_pop (sc_list_t * list)
int(* p4est_coarsen_t)(p4est_t *p4est, p4est_topidx_t which_tree, p4est_quadrant_t *quadrants[])
Callback function prototype to decide for coarsening.
Definition: p4est.h:237
struct p4est_tree p4est_tree_t
The p4est tree datatype.
void p4est_refine(p4est_t *p4est, int refine_recursive, p4est_refine_t refine_fn, p4est_init_t init_fn)
Refine a forest.
void p4est_destroy(p4est_t *p4est)
Destroy a p4est.
void(* p4est_init_t)(p4est_t *p4est, p4est_topidx_t which_tree, p4est_quadrant_t *quadrant)
Callback function prototype to initialize the quadrant's user data.
Definition: p4est.h:217
void p4est_save(const char *filename, p4est_t *p4est, int save_data)
Save the complete connectivity/p4est data to disk.
size_t p4est_memory_used(p4est_t *p4est)
Calculate local memory usage of a forest structure.
void p4est_partition(p4est_t *p4est, int allow_for_coarsening, p4est_weight_t weight_fn)
Equally partition the forest.
unsigned p4est_checksum_partition(p4est_t *p4est)
Compute a partition-dependent checksum for a forest.
void p4est_balance(p4est_t *p4est, p4est_connect_type_t btype, p4est_init_t init_fn)
2:1 balance the size differences of neighboring elements in a forest.
#define P4EST_QUADRANT_INIT(q)
set statically allocated quadrant to defined values
Definition: p4est.h:254
p4est_t * p4est_copy(p4est_t *input, int copy_data)
Make a deep copy of a p4est.
void p4est_qcoord_to_vertex(p4est_connectivity_t *connectivity, p4est_topidx_t treeid, p4est_qcoord_t x, p4est_qcoord_t y, double vxyz[3])
Transform a quadrant coordinate into the space spanned by tree vertices.
#define P4EST_MAXLEVEL
The finest level for representing quadrant midpoint coordinates.
Definition: p4est.h:53
p4est_t * p4est_load(const char *filename, sc_MPI_Comm mpicomm, size_t data_size, int load_data, void *user_pointer, p4est_connectivity_t **connectivity)
Load the complete connectivity/p4est structure from disk.
long p4est_revision(p4est_t *p4est)
Return the revision counter of the forest.
int(* p4est_weight_t)(p4est_t *p4est, p4est_topidx_t which_tree, p4est_quadrant_t *quadrant)
Callback function prototype to calculate weights for partitioning.
Definition: p4est.h:247
struct p4est p4est_t
The p4est forest datatype.
p4est_t * p4est_new(sc_MPI_Comm mpicomm, p4est_connectivity_t *connectivity, size_t data_size, p4est_init_t init_fn, void *user_pointer)
Create a new forest with an initial coarse mesh.
unsigned p4est_checksum(p4est_t *p4est)
Compute the checksum for a forest.
void p4est_coarsen(p4est_t *p4est, int coarsen_recursive, p4est_coarsen_t coarsen_fn, p4est_init_t init_fn)
Coarsen a forest.
int(* p4est_refine_t)(p4est_t *p4est, p4est_topidx_t which_tree, p4est_quadrant_t *quadrant)
Callback function prototype to decide for refinement.
Definition: p4est.h:227
struct p4est_quadrant p4est_quadrant_t
The 2D quadrant datatype.
void p4est_reset_data(p4est_t *p4est, size_t data_size, p4est_init_t init_fn, void *user_pointer)
Reset user pointer and element data.
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
The connectivity defines the coarse topology of the forest.
p4est_connect_type_t
Characterize a type of adjacency.
Definition: p4est_connectivity.h:113
This structure holds the 2D inter-tree connectivity information.
Definition: p4est_connectivity.h:190
Data pertaining to selecting, inspecting, and profiling algorithms.
Definition: p4est_extended.h:62
The 2D quadrant datatype.
Definition: p4est.h:76
int8_t level
level of refinement
Definition: p4est.h:80
int16_t pad16
padding
Definition: p4est.h:82
union p4est_quadrant::p4est_quadrant_data p
a union of additional data attached to a quadrant
p4est_qcoord_t y
coordinates
Definition: p4est.h:78
int8_t pad8
padding
Definition: p4est.h:81
The p4est tree datatype.
Definition: p4est.h:129
p4est_quadrant_t last_desc
last local descendant
Definition: p4est.h:132
p4est_quadrant_t first_desc
first local descendant
Definition: p4est.h:131
int8_t maxlevel
highest local quadrant level
Definition: p4est.h:138
sc_array_t quadrants
locally stored quadrants
Definition: p4est.h:130
p4est_locidx_t quadrants_offset
cumulative sum over earlier trees on this processor (locals only)
Definition: p4est.h:133
p4est_locidx_t quadrants_per_level[P4EST_MAXLEVEL+1]
locals only
Definition: p4est.h:136
The p4est forest datatype.
Definition: p4est.h:150
p4est_topidx_t first_local_tree
0-based index of first local tree, must be -1 for an empty processor
Definition: p4est.h:161
p4est_connectivity_t * connectivity
connectivity structure, not owned
Definition: p4est.h:177
p4est_locidx_t local_num_quadrants
number of quadrants on all trees on this processor
Definition: p4est.h:167
void * user_pointer
convenience pointer for users, never touched by p4est
Definition: p4est.h:157
int mpisize
number of MPI processes
Definition: p4est.h:152
int mpirank
this process's MPI rank
Definition: p4est.h:153
sc_array_t * trees
array of all trees
Definition: p4est.h:178
size_t data_size
size of per-quadrant p.user_data (see p4est_quadrant_t::p4est_quadrant_data::user_data)
Definition: p4est.h:155
long revision
Gets bumped on mesh change.
Definition: p4est.h:160
p4est_inspect_t * inspect
algorithmic switches
Definition: p4est.h:185
sc_MPI_Comm mpicomm
MPI communicator.
Definition: p4est.h:151
p4est_gloidx_t global_num_quadrants
number of quadrants on all trees on all processors
Definition: p4est.h:169
p4est_quadrant_t * global_first_position
first smallest possible quad for each process and 1 beyond
Definition: p4est.h:174
int mpicomm_owned
flag if communicator is owned
Definition: p4est.h:154
sc_mempool_t * quadrant_pool
memory allocator for temporary quadrants
Definition: p4est.h:183
p4est_topidx_t last_local_tree
0-based index of last local tree, must be -2 for an empty processor
Definition: p4est.h:164
sc_mempool_t * user_data_pool
memory allocator for user data
Definition: p4est.h:180
p4est_gloidx_t * global_first_quadrant
first global quadrant index for each process and 1 beyond
Definition: p4est.h:171
Union for quadrant data.
Definition: p4est.h:93
struct p4est_quadrant::p4est_quadrant_data::@0 piggy1
of ghost octants, store the tree and owner rank; not part of the API
long user_long
never changed by p4est
Definition: p4est.h:95
struct p4est_quadrant::p4est_quadrant_data::@1 piggy2
of transformed octants, store the original tree and the target tree; not part of the API
int user_int
never changed by p4est
Definition: p4est.h:96
p4est_topidx_t which_tree
the tree containing the quadrant (used in auxiliary octants such as the ghost octants in p4est_ghost_...
Definition: p4est.h:97
struct p4est_quadrant::p4est_quadrant_data::@2 piggy3
of ghost octants, store the tree and index in the owner's numbering; only part of the API in p4est_gh...
void * user_data
never changed by p4est
Definition: p4est.h:94