p4est 2.8.7.456-de8c6
p4est is a software library for parallel adaptive mesh refinement.
Loading...
Searching...
No Matches
p4est_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 P4EST_ALGORITHMS_H
34#define P4EST_ALGORITHMS_H
35
36#include <p4est_extended.h>
37
38SC_EXTERN_C_BEGIN;
39
43sc_mempool_t *p4est_quadrant_mempool_new (void);
44
51void p4est_quadrant_init_data (p4est_t * p4est,
52 p4est_topidx_t which_tree,
53 p4est_quadrant_t * quad,
54 p4est_init_t init_fn);
55
60void p4est_quadrant_free_data (p4est_t * p4est,
61 p4est_quadrant_t * quad);
62
71unsigned p4est_quadrant_checksum (sc_array_t * quadrants,
72 sc_array_t * checkarray,
73 size_t first_quadrant);
74
90int p4est_quadrant_in_range (const p4est_quadrant_t * fd,
91 const p4est_quadrant_t * ld,
92 const p4est_quadrant_t *
93 quadrant);
94
99int p4est_tree_is_sorted (p4est_tree_t * tree);
100
105int p4est_tree_is_linear (p4est_tree_t * tree);
106
111int p4est_tree_is_complete (p4est_tree_t * tree);
112
118int p4est_tree_is_almost_sorted (p4est_tree_t * tree,
119 int check_linearity);
120
135void p4est_tree_print (int log_priority, p4est_tree_t * tree);
136
143int p4est_is_equal (p4est_t * p4est1, p4est_t * p4est2,
144 int compare_data);
145
157int p4est_is_valid (p4est_t * p4est);
158
177void p4est_tree_compute_overlap (p4est_t * p4est,
178 sc_array_t * in,
179 sc_array_t * out,
180 p4est_connect_type_t balance,
181 sc_array_t * borders,
182 sc_array_t * inseeds);
183
188void p4est_tree_uniqify_overlap (sc_array_t * out);
189
195size_t p4est_tree_remove_nonowned (p4est_t * p4est,
196 p4est_topidx_t which_tree);
197
217void p4est_complete_region (p4est_t * p4est,
218 const p4est_quadrant_t * q1,
219 int include_q1,
220 const p4est_quadrant_t * q2,
221 int include_q2,
222 p4est_tree_t * tree,
223 p4est_topidx_t which_tree,
224 p4est_init_t init_fn);
225
236void p4est_complete_subtree (p4est_t * p4est,
237 p4est_topidx_t which_tree,
238 p4est_init_t init_fn);
239
248void p4est_balance_subtree (p4est_t * p4est,
250 p4est_topidx_t which_tree,
251 p4est_init_t init_fn);
252
253void p4est_balance_border (p4est_t * p4est,
255 p4est_topidx_t which_tree,
256 p4est_init_t init_fn,
257 p4est_replace_t replace_fn,
258 sc_array_t * borders);
259
269size_t p4est_linearize_tree (p4est_t * p4est,
270 p4est_tree_t * tree);
271
291p4est_locidx_t p4est_partition_correction (p4est_gloidx_t *
292 partition,
293 int num_procs,
294 int rank,
296 min_quadrant_id,
298 max_quadrant_id);
299
311p4est_gloidx_t p4est_partition_for_coarsening (p4est_t * p4est,
313 num_quadrants_in_proc);
314
325int p4est_next_nonempty_process (int rank,
326 int num_procs,
328 num_quadrants_in_proc);
329
340p4est_gloidx_t p4est_partition_given (p4est_t * p4est,
341 const p4est_locidx_t *
342 num_quadrants_in_proc);
343
354int p4est_quadrant_on_face_boundary (p4est_t * p4est,
355 p4est_topidx_t treeid,
356 int face,
357 const p4est_quadrant_t *
358 q);
359
360SC_EXTERN_C_END;
361
362#endif /* !P4EST_ALGORITHMS_H */
sc_mempool_t * p4est_quadrant_mempool_new(void)
Create a memory pool for quadrants that initializes compiler padding.
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
p4est_connect_type_t
Characterize a type of adjacency.
Definition p4est_connectivity.h:113
Interface routines with extended capabilities.
The 2D quadrant datatype.
Definition p4est.h:76
The p4est tree datatype.
Definition p4est.h:129
The p4est forest datatype.
Definition p4est.h:150