p4est 2.8.6
p4est is a software library for parallel adaptive mesh refinement.
p8est_algorithms.h
Go to the documentation of this file.
1/*
2 This file is part of p4est.
3 p4est is a C library to manage a collection (a forest) of multiple
4 connected adaptive quadtrees or octrees in parallel.
5
6 Copyright (C) 2010 The University of Texas System
7 Additional copyright (C) 2011 individual authors
8 Written by Carsten Burstedde, Lucas C. Wilcox, and Tobin Isaac
9
10 p4est is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
14
15 p4est is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with p4est; if not, write to the Free Software Foundation, Inc.,
22 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23*/
24
33#ifndef P8EST_ALGORITHMS_H
34#define P8EST_ALGORITHMS_H
35
36#include <p8est_extended.h>
37
38SC_EXTERN_C_BEGIN;
39
43sc_mempool_t *p8est_quadrant_mempool_new (void);
44
51 p4est_topidx_t which_tree,
52 p8est_quadrant_t * quad,
53 p8est_init_t init_fn);
54
59 p8est_quadrant_t * quad);
60
69unsigned p8est_quadrant_checksum (sc_array_t * quadrants,
70 sc_array_t * checkarray,
71 size_t first_quadrant);
72
89 const p8est_quadrant_t * ld,
90 const p8est_quadrant_t *
91 quadrant);
92
98
104
110
116 int check_linearity);
117
131void p8est_tree_print (int log_priority, p8est_tree_t * tree);
132
139int p8est_is_equal (p8est_t * p8est1, p8est_t * p8est2,
140 int compare_data);
141
154
174 sc_array_t * in,
175 sc_array_t * out,
177 balance,
178 sc_array_t * borders,
179 sc_array_t * inseeds);
180
185void p8est_tree_uniqify_overlap (sc_array_t * out);
186
193 p4est_topidx_t which_tree);
194
215 const p8est_quadrant_t * q1,
216 int include_q1,
217 const p8est_quadrant_t * q2,
218 int include_q2,
219 p8est_tree_t * tree,
220 p4est_topidx_t which_tree,
221 p8est_init_t init_fn);
222
234 p4est_topidx_t which_tree,
235 p8est_init_t init_fn);
236
247 p4est_topidx_t which_tree,
248 p8est_init_t init_fn);
249
250void p8est_balance_border (p8est_t * p8est,
252 p4est_topidx_t which_tree,
253 p8est_init_t init_fn,
254 p8est_replace_t replace_fn,
255 sc_array_t * borders);
256
267 p8est_tree_t * tree);
268
289 partition,
290 int num_procs,
291 int rank,
293 min_quadrant_id,
295 max_quadrant_id);
296
310 num_quadrants_in_proc);
311
323 int num_procs,
325 num_quadrants_in_proc);
326
338 const p4est_locidx_t *
339 num_quadrants_in_proc);
340
352 p4est_topidx_t treeid,
353 int face,
354 const p8est_quadrant_t *
355 q);
356
357SC_EXTERN_C_END;
358
359#endif /* !P8EST_ALGORITHMS_H */
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
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
int p8est_tree_is_almost_sorted(p8est_tree_t *tree, int check_linearity)
Check if a tree is sorted/linear except across edges or corners.
int p8est_quadrant_in_range(const p8est_quadrant_t *fd, const p8est_quadrant_t *ld, const p8est_quadrant_t *quadrant)
Report whether a quadrant fits into the limits of a quadrant range.
int p8est_is_equal(p8est_t *p8est1, p8est_t *p8est2, int compare_data)
Locally check forest/connectivity structures for equality.
void p8est_quadrant_init_data(p8est_t *p8est, p4est_topidx_t which_tree, p8est_quadrant_t *quad, p8est_init_t init_fn)
Alloc and initialize the user data of a valid quadrant.
sc_mempool_t * p8est_quadrant_mempool_new(void)
Create a memory pool for quadrants that initializes compiler padding.
void p8est_tree_compute_overlap(p8est_t *p8est, sc_array_t *in, sc_array_t *out, p8est_connect_type_t balance, sc_array_t *borders, sc_array_t *inseeds)
Compute the overlap of a number of insulation layers with a tree.
void p8est_tree_print(int log_priority, p8est_tree_t *tree)
Print the quadrants in a tree.
void p8est_tree_uniqify_overlap(sc_array_t *out)
Gets the reduced representation of the overlap that results from using p8est_tree_compute_overlap_new...
p4est_gloidx_t p8est_partition_for_coarsening(p8est_t *p8est, p4est_locidx_t *num_quadrants_in_proc)
Correct partition counters to allow one level of coarsening.
int p8est_quadrant_on_face_boundary(p8est_t *p4est, p4est_topidx_t treeid, int face, const p8est_quadrant_t *q)
Checks if a quadrant's face is on the boundary of the forest.
void p8est_quadrant_free_data(p8est_t *p8est, p8est_quadrant_t *quad)
Free the user data of a valid quadrant.
int p8est_tree_is_linear(p8est_tree_t *tree)
Test if a tree is sorted in Morton ordering and linear.
p4est_locidx_t p8est_partition_correction(p4est_gloidx_t *partition, int num_procs, int rank, p4est_gloidx_t min_quadrant_id, p4est_gloidx_t max_quadrant_id)
Compute correction of partition for a process.
int p8est_tree_is_complete(p8est_tree_t *tree)
Test if a tree is sorted in Morton ordering and complete.
void p8est_complete_subtree(p8est_t *p8est, p4est_topidx_t which_tree, p8est_init_t init_fn)
Completes a sorted tree within a p8est.
unsigned p8est_quadrant_checksum(sc_array_t *quadrants, sc_array_t *checkarray, size_t first_quadrant)
Computes a machine-independent checksum of a list of quadrants.
size_t p8est_tree_remove_nonowned(p8est_t *p8est, p4est_topidx_t which_tree)
Removes quadrants that are outside the owned tree boundaries from a tree.
int p8est_next_nonempty_process(int rank, int num_procs, p4est_locidx_t *num_quadrants_in_proc)
Find next non-empty process.
p4est_gloidx_t p8est_partition_given(p8est_t *p8est, const p4est_locidx_t *num_quadrants_in_proc)
Partition p8est given the number of quadrants per proc.
int p8est_is_valid(p8est_t *p8est)
Check a forest for validity and allreduce the result.
size_t p8est_linearize_tree(p8est_t *p8est, p8est_tree_t *tree)
Remove overlaps from a sorted list of quadrants.
void p8est_balance_subtree(p8est_t *p8est, p8est_connect_type_t btype, p4est_topidx_t which_tree, p8est_init_t init_fn)
Balances a sorted tree within a p8est.
void p8est_complete_region(p8est_t *p8est, const p8est_quadrant_t *q1, int include_q1, const p8est_quadrant_t *q2, int include_q2, p8est_tree_t *tree, p4est_topidx_t which_tree, p8est_init_t init_fn)
Constructs a minimal linear octree between two octants.
int p8est_tree_is_sorted(p8est_tree_t *tree)
Test if a tree is sorted in Morton ordering.
p8est_connect_type_t
Characterize a type of adjacency.
Definition: p8est_connectivity.h:119
Interface routines with extended capabilities.
void(* p8est_replace_t)(p8est_t *p8est, p4est_topidx_t which_tree, int num_outgoing, p8est_quadrant_t *outgoing[], int num_incoming, p8est_quadrant_t *incoming[])
Callback function prototype to replace one set of quadrants with another.
Definition: p8est_extended.h:114
The p4est forest datatype.
Definition: p4est.h:136
The 3D quadrant (i.e., octant) datatype.
Definition: p8est.h:68
The p8est tree datatype.
Definition: p8est.h:111
The p8est forest datatype.
Definition: p8est.h:132