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
51#define P4EST_MAXLEVEL 30
54#define P4EST_OLD_QMAXLEVEL 29
55#define P4EST_QMAXLEVEL 29
58#define P4EST_ROOT_LEN ((p4est_qcoord_t) 1 << P4EST_MAXLEVEL)
61#define P4EST_QUADRANT_LEN(l) ((p4est_qcoord_t) 1 << (P4EST_MAXLEVEL - (l)))
64#define P4EST_QUADRANT_MASK(l) (~(P4EST_QUADRANT_LEN (l) - 1))
68#define P4EST_LAST_OFFSET(l) (P4EST_ROOT_LEN - P4EST_QUADRANT_LEN (l))
237extern void *P4EST_DATA_UNINITIALIZED;
240#define P4EST_QUADRANT_INIT(q) \
241 ((void) memset ((q), -1, sizeof (p4est_quadrant_t)))
335 int refine_recursive,
348 int coarsen_recursive,
386 int allow_for_coarsening,
455 size_t data_size,
int load_data,
466 P4EST_ASSERT (array->elem_size == sizeof (
p4est_tree_t));
467 P4EST_ASSERT (it >= 0 && (
size_t) it < array->elem_count);
476p4est_quadrant_array_index (sc_array_t * array,
size_t it)
479 P4EST_ASSERT (it < array->elem_count);
493p4est_quadrant_array_push_copy (sc_array_t * array,
513p4est_quadrant_array_push (sc_array_t * array)
527p4est_quadrant_mempool_alloc (sc_mempool_t * mempool)
537p4est_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:223
struct p4est_tree p4est_tree_t
The p4est tree datatype.
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.
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.
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.
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:203
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:240
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.
long p4est_revision(p4est_t *p4est)
Return the revision counter of the forest.
p4est_t * p4est_copy(p4est_t *input, int copy_data)
Make a deep copy of a p4est.
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:233
struct p4est p4est_t
The p4est forest datatype.
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:213
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:72
int8_t level
level of refinement
Definition: p4est.h:76
int16_t pad16
padding
Definition: p4est.h:78
union p4est_quadrant::p4est_quadrant_data p
a union of additional data attached to a quadrant
p4est_qcoord_t y
coordinates
Definition: p4est.h:74
int8_t pad8
padding
Definition: p4est.h:77
The p4est tree datatype.
Definition: p4est.h:115
p4est_quadrant_t last_desc
last local descendant
Definition: p4est.h:118
p4est_quadrant_t first_desc
first local descendant
Definition: p4est.h:117
int8_t maxlevel
highest local quadrant level
Definition: p4est.h:124
sc_array_t quadrants
locally stored quadrants
Definition: p4est.h:116
p4est_locidx_t quadrants_offset
cumulative sum over earlier trees on this processor (locals only)
Definition: p4est.h:119
p4est_locidx_t quadrants_per_level[P4EST_MAXLEVEL+1]
locals only
Definition: p4est.h:122
The p4est forest datatype.
Definition: p4est.h:136
p4est_topidx_t first_local_tree
0-based index of first local tree, must be -1 for an empty processor
Definition: p4est.h:147
p4est_connectivity_t * connectivity
connectivity structure, not owned
Definition: p4est.h:163
p4est_locidx_t local_num_quadrants
number of quadrants on all trees on this processor
Definition: p4est.h:153
void * user_pointer
convenience pointer for users, never touched by p4est
Definition: p4est.h:143
int mpisize
number of MPI processes
Definition: p4est.h:138
int mpirank
this process's MPI rank
Definition: p4est.h:139
sc_array_t * trees
array of all trees
Definition: p4est.h:164
size_t data_size
size of per-quadrant p.user_data (see p4est_quadrant_t::p4est_quadrant_data::user_data)
Definition: p4est.h:141
long revision
Gets bumped on mesh change.
Definition: p4est.h:146
p4est_inspect_t * inspect
algorithmic switches
Definition: p4est.h:171
sc_MPI_Comm mpicomm
MPI communicator.
Definition: p4est.h:137
p4est_gloidx_t global_num_quadrants
number of quadrants on all trees on all processors
Definition: p4est.h:155
p4est_quadrant_t * global_first_position
first smallest possible quad for each process and 1 beyond
Definition: p4est.h:160
int mpicomm_owned
flag if communicator is owned
Definition: p4est.h:140
sc_mempool_t * quadrant_pool
memory allocator for temporary quadrants
Definition: p4est.h:169
p4est_topidx_t last_local_tree
0-based index of last local tree, must be -2 for an empty processor
Definition: p4est.h:150
sc_mempool_t * user_data_pool
memory allocator for user data
Definition: p4est.h:166
p4est_gloidx_t * global_first_quadrant
first global quadrant index for each process and 1 beyond
Definition: p4est.h:157
struct p4est_quadrant::p4est_quadrant_data::@0 piggy1
of ghost octants, store the tree and owner rank
long user_long
never changed by p4est
Definition: p4est.h:82
struct p4est_quadrant::p4est_quadrant_data::@1 piggy2
of transformed octants, store the original tree and the target tree
int user_int
never changed by p4est
Definition: p4est.h:83
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:84
struct p4est_quadrant::p4est_quadrant_data::@2 piggy3
of ghost octants, store the tree and index in the owner's numbering
void * user_data
never changed by p4est
Definition: p4est.h:81