p4est 2.8.7.456-de8c6
p4est is a software library for parallel adaptive mesh refinement.
Loading...
Searching...
No Matches
p4est_extended.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/********************************************************************
26 * IMPORTANT NOTE *
27 * *
28 * These interfaces are intended for those who like finer control. *
29 * The API offers extended versions of some basic p4est functions. *
30 * The API may change without notice. *
31 ********************************************************************/
32
40#ifndef P4EST_EXTENDED_H
41#define P4EST_EXTENDED_H
42
43#include <p4est_mesh.h>
44#include <p4est_iterate.h>
45#include <p4est_lnodes.h>
46#include <p4est_io.h>
47
48SC_EXTERN_C_BEGIN;
49
51typedef uint64_t p4est_lid_t;
52
60/* TODO: Describe the purpose of various switches, counters, and timings. */
62{
73 size_t balance_A_count_in;
74 size_t balance_A_count_out;
75 size_t balance_comm_sent;
76 size_t balance_comm_nzpeers;
77 size_t balance_B_count_in;
78 size_t balance_B_count_out;
79 size_t balance_zero_sends[2], balance_zero_receives[2];
80 double balance_A;
81 double balance_comm;
82 double balance_B;
87 int use_B;
88};
89
111typedef void (*p4est_replace_t) (p4est_t * p4est,
112 p4est_topidx_t which_tree,
113 int num_outgoing,
114 p4est_quadrant_t * outgoing[],
115 int num_incoming,
116 p4est_quadrant_t * incoming[]);
117
125int p4est_lid_compare (const p4est_lid_t * a,
126 const p4est_lid_t * b);
127
134int p4est_lid_is_equal (const p4est_lid_t * a,
135 const p4est_lid_t * b);
136
143void p4est_lid_init (p4est_lid_t * input, uint64_t high,
144 uint64_t low);
145
149void p4est_lid_set_zero (p4est_lid_t * input);
150
154void p4est_lid_set_one (p4est_lid_t * input);
155
159void p4est_lid_set_uint64 (p4est_lid_t * input, uint64_t u);
160
169int p4est_lid_chk_bit (const p4est_lid_t * input,
170 int bit_number);
171
179void p4est_lid_set_bit (p4est_lid_t * input, int bit_number);
180
188void p4est_lid_copy (const p4est_lid_t * input,
189 p4est_lid_t * output);
190
199void p4est_lid_add (const p4est_lid_t * a,
200 const p4est_lid_t * b,
201 p4est_lid_t * result);
202
212void p4est_lid_sub (const p4est_lid_t * a,
213 const p4est_lid_t * b,
214 p4est_lid_t * result);
215
223void p4est_lid_bitwise_neg (const p4est_lid_t * a,
224 p4est_lid_t * result);
225
235void p4est_lid_bitwise_or (const p4est_lid_t * a,
236 const p4est_lid_t * b,
237 p4est_lid_t * result);
238
248void p4est_lid_bitwise_and (const p4est_lid_t * a,
249 const p4est_lid_t * b,
250 p4est_lid_t * result);
251
262void p4est_lid_shift_right (const p4est_lid_t * input,
263 unsigned shift_count,
264 p4est_lid_t * result);
265
276void p4est_lid_shift_left (const p4est_lid_t * input,
277 unsigned shift_count,
278 p4est_lid_t * result);
279
286void p4est_lid_add_inplace (p4est_lid_t * a,
287 const p4est_lid_t * b);
288
296void p4est_lid_sub_inplace (p4est_lid_t * a,
297 const p4est_lid_t * b);
298
305void p4est_lid_bitwise_or_inplace (p4est_lid_t * a,
306 const p4est_lid_t * b);
307
314void p4est_lid_bitwise_and_inplace (p4est_lid_t * a,
315 const p4est_lid_t * b);
316
334void p4est_quadrant_linear_id_ext128 (const p4est_quadrant_t *
335 quadrant, int level,
336 p4est_lid_t * id);
337
345void p4est_quadrant_set_morton_ext128 (p4est_quadrant_t *
346 quadrant, int level,
347 const p4est_lid_t * id);
348
379p4est_t *p4est_new_ext (sc_MPI_Comm mpicomm,
380 p4est_connectivity_t * connectivity,
381 p4est_locidx_t min_quadrants,
382 int min_level, int fill_uniform,
383 size_t data_size, p4est_init_t init_fn,
384 void *user_pointer);
385
400p4est_mesh_t *p4est_mesh_new_ext (p4est_t * p4est,
401 p4est_ghost_t * ghost,
402 int compute_tree_index,
403 int compute_level_lists,
405
421p4est_t *p4est_copy_ext (p4est_t * input, int copy_data,
422 int duplicate_mpicomm);
423
445void p4est_refine_ext (p4est_t * p4est,
446 int refine_recursive, int maxlevel,
447 p4est_refine_t refine_fn,
448 p4est_init_t init_fn,
449 p4est_replace_t replace_fn);
450
472void p4est_coarsen_ext (p4est_t * p4est, int coarsen_recursive,
473 int callback_orphans,
474 p4est_coarsen_t coarsen_fn,
475 p4est_init_t init_fn,
476 p4est_replace_t replace_fn);
477
489void p4est_balance_ext (p4est_t * p4est,
491 p4est_init_t init_fn,
492 p4est_replace_t replace_fn);
493
494void p4est_balance_subtree_ext (p4est_t * p4est,
496 p4est_topidx_t which_tree,
497 p4est_init_t init_fn,
498 p4est_replace_t replace_fn);
499
522p4est_gloidx_t p4est_partition_ext (p4est_t * p4est,
523 int partition_for_coarsening,
524 p4est_weight_t weight_fn);
525
532p4est_gloidx_t p4est_partition_for_coarsening (p4est_t * p4est,
534 num_quadrants_in_proc);
535
540void p4est_iterate_ext (p4est_t * p4est,
541 p4est_ghost_t * ghost_layer,
542 void *user_data,
543 p4est_iter_volume_t iter_volume,
544 p4est_iter_face_t iter_face,
545 p4est_iter_corner_t iter_corner,
546 int remote);
547
565void p4est_save_ext (const char *filename, p4est_t * p4est,
566 int save_data, int save_partition);
567
589p4est_t *p4est_load_ext (const char *filename, sc_MPI_Comm mpicomm,
590 size_t data_size, int load_data,
591 int autopartition, int broadcasthead,
592 void *user_pointer,
593 p4est_connectivity_t ** connectivity);
594
598p4est_t *p4est_source_ext (sc_io_source_t * src,
599 sc_MPI_Comm mpicomm, size_t data_size,
600 int load_data, int autopartition,
601 int broadcasthead, void *user_pointer,
602 p4est_connectivity_t ** connectivity);
603
604#ifdef P4EST_ENABLE_FILE_DEPRECATED
605
615p4est_file_context_t *p4est_file_open_read_ext (sc_MPI_Comm mpicomm,
616 const char *filename,
617 char *user_string,
619 global_num_quadrants,
620 int *errcode);
621
630p4est_file_context_t *p4est_file_read_field_ext (p4est_file_context_t * fc,
631 p4est_gloidx_t * gfq,
632 size_t quadrant_size,
633 sc_array_t * quadrant_data,
634 char *user_string,
635 int *errcode);
636#endif /* P4EST_ENABLE_FILE_DEPRECATED */
637
680void p4est_get_plex_data_ext (p4est_t * p4est,
681 p4est_ghost_t ** ghost,
682 p4est_lnodes_t ** lnodes,
684 int overlap,
686 first_local_quad,
687 sc_array_t * out_points_per_dim,
688 sc_array_t * out_cone_sizes,
689 sc_array_t * out_cones,
690 sc_array_t *
691 out_cone_orientations,
692 sc_array_t * out_vertex_coords,
693 sc_array_t * out_children,
694 sc_array_t * out_parents,
695 sc_array_t * out_childids,
696 sc_array_t * out_leaves,
697 sc_array_t * out_remotes,
698 int custom_numbering);
699
700SC_EXTERN_C_END;
701
702#endif /* !P4EST_EXTENDED_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
p4est_connect_type_t
Characterize a type of adjacency.
Definition p4est_connectivity.h:113
void(* p4est_replace_t)(p4est_t *p4est, p4est_topidx_t which_tree, int num_outgoing, p4est_quadrant_t *outgoing[], int num_incoming, p4est_quadrant_t *incoming[])
Callback function prototype to replace one set of quadrants with another.
Definition p4est_extended.h:111
uint64_t p4est_lid_t
A datatype to handle the linear id in 2D.
Definition p4est_extended.h:51
Provide functions to serialize/deserialize a forest.
Iteration over mesh topology via callbacks.
Generate Lobatto node numbers for any degree.
Forest topology in a conventional mesh format.
This structure holds the 2D inter-tree connectivity information.
Definition p4est_connectivity.h:190
Quadrants that neighbor the local domain.
Definition p4est_ghost.h:46
Data pertaining to selecting, inspecting, and profiling algorithms.
Definition p4est_extended.h:62
double balance_notify
time spent in sc_notify
Definition p4est_extended.h:84
double balance_notify_allgather
time spent in sc_notify_allgather
Definition p4est_extended.h:86
int balance_max_ranges
If positive and smaller than p4est_num ranges, overrides it.
Definition p4est_extended.h:72
int use_balance_ranges_notify
If true, call both sc_ranges and sc_notify and verify consistency.
Definition p4est_extended.h:68
double balance_ranges
time spent in sc_ranges
Definition p4est_extended.h:83
int use_balance_ranges
Use sc_ranges to determine the asymmetric communication pattern.
Definition p4est_extended.h:65
int use_balance_verify
Verify sc_ranges and/or sc_notify as applicable.
Definition p4est_extended.h:70
Store a parallel numbering of Lobatto points of a given degree > 0.
Definition p4est_lnodes.h:145
This structure contains complete mesh information on a 2:1 balanced forest.
Definition p4est_mesh.h:130
The 2D quadrant datatype.
Definition p4est.h:76
The p4est forest datatype.
Definition p4est.h:150