p4est 2.8.8
p4est is a software library for parallel adaptive mesh refinement.
Loading...
Searching...
No Matches
p4est_search.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
25#ifndef P4EST_SEARCH_H
26#define P4EST_SEARCH_H
27
60#include <p4est.h>
61
62SC_EXTERN_C_BEGIN;
63
91void p4est_find_partition (const int num_procs,
92 p4est_gloidx_t * search_in,
93 p4est_gloidx_t my_begin,
94 p4est_gloidx_t my_end,
95 p4est_gloidx_t * begin,
96 p4est_gloidx_t * end);
97
102ssize_t p4est_find_lower_bound (sc_array_t * array,
103 const p4est_quadrant_t * q,
104 size_t guess);
105
110ssize_t p4est_find_higher_bound (sc_array_t * array,
111 const p4est_quadrant_t * q,
112 size_t guess);
113
130p4est_quadrant_t *p4est_find_quadrant_cumulative (p4est_t * p4est,
132 cumulative_id,
134 which_tree,
136 quadrant_id);
137
155void p4est_split_array (sc_array_t * array, int level,
156 size_t indices[]);
157
182int32_t p4est_find_range_boundaries (p4est_quadrant_t * lq,
183 p4est_quadrant_t * uq,
184 int level, int faces[],
185 int corners[]);
186
213 p4est_topidx_t which_tree,
214 p4est_quadrant_t * quadrant,
215 p4est_locidx_t local_num,
216 void *point);
217
220
281void p4est_search_local (p4est_t * p4est, int call_post,
282 p4est_search_local_t quadrant_fn,
283 p4est_search_local_t point_fn,
284 sc_array_t * points);
285
289void p4est_search (p4est_t * p4est,
290 p4est_search_query_t quadrant_fn,
291 p4est_search_query_t point_fn,
292 sc_array_t * points);
293
317 sc_array_t * quadrants,
318 sc_array_t * indices);
319
362void p4est_search_reorder (p4est_t * p4est,
363 int skip_levels,
364 p4est_search_reorder_t reorder_fn,
366 pre_quadrant_fn,
368 post_quadrant_fn,
369 p4est_search_local_t point_fn,
370 sc_array_t * points);
371
392 p4est_topidx_t which_tree,
393 p4est_quadrant_t * quadrant,
394 int pfirst, int plast,
395 void *point);
396
422void p4est_search_partition (p4est_t *p4est, int call_post,
424 quadrant_fn,
426 sc_array_t *points);
427
458void p4est_search_partition_gfx
459 (const p4est_gloidx_t *gfq, const p4est_quadrant_t *gfp,
460 int nmemb, p4est_topidx_t num_trees, int call_post, void *user,
462 sc_array_t *points);
463
496void p4est_search_partition_gfp
497 (const p4est_quadrant_t *gfp, int nmemb, p4est_topidx_t num_trees,
498 int call_post, void *user, p4est_search_partition_t quadrant_fn,
499 p4est_search_partition_t point_fn, sc_array_t *points);
500
552 p4est_topidx_t which_tree,
553 p4est_quadrant_t * quadrant,
554 int pfirst, int plast,
555 p4est_locidx_t local_num,
556 void *point);
557
617void p4est_search_all (p4est_t * p4est, int call_post,
618 p4est_search_all_t quadrant_fn,
619 p4est_search_all_t point_fn,
620 sc_array_t * points);
621
622SC_EXTERN_C_END;
623
624#endif /* !P4EST_SEARCH_H */
The top-level 2D p4est interface.
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
int(* p4est_search_reorder_t)(p4est_t *p4est, sc_array_t *quadrants, sc_array_t *indices)
Callback function to query, reorder, and reduce a set of quadrants.
Definition p4est_search.h:316
p4est_search_local_t p4est_search_query_t
This typedef is provided for backwards compatibility.
Definition p4est_search.h:219
int(* p4est_search_partition_t)(p4est_t *p4est, p4est_topidx_t which_tree, p4est_quadrant_t *quadrant, int pfirst, int plast, void *point)
Callback function for the partition recursion.
Definition p4est_search.h:391
int(* p4est_search_local_t)(p4est_t *p4est, p4est_topidx_t which_tree, p4est_quadrant_t *quadrant, p4est_locidx_t local_num, void *point)
Callback function to query the match of a "point" with a quadrant.
Definition p4est_search.h:212
int(* p4est_search_all_t)(p4est_t *p4est, p4est_topidx_t which_tree, p4est_quadrant_t *quadrant, int pfirst, int plast, p4est_locidx_t local_num, void *point)
Callback function for the top-down search through the whole forest.
Definition p4est_search.h:551
The 2D quadrant datatype.
Definition p4est.h:76
The p4est forest datatype.
Definition p4est.h:150