p4est  1.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
p6est_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) 2013 The University of Texas System
7  Written by Carsten Burstedde, Lucas C. Wilcox, and Tobin Isaac
8 
9  p4est is free software; you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation; either version 2 of the License, or
12  (at your option) any later version.
13 
14  p4est is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with p4est; if not, write to the Free Software Foundation, Inc.,
21  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 */
23 
24 /********************************************************************
25  * IMPORTANT NOTE *
26  * *
27  * These interfaces are intended for those who like finer control. *
28  * The API offers extended versions of some basic p6est functions. *
29  * The API may change without notice. *
30  ********************************************************************/
31 
39 #ifndef P6EST_EXTENDED_H
40 #define P6EST_EXTENDED_H
41 
42 #include <p6est.h>
43 
61 p6est_t *p6est_new_ext (sc_MPI_Comm mpicomm,
62  p6est_connectivity_t * connectivity,
63  p4est_locidx_t min_quadrants,
64  int min_level, int min_zlevel,
65  int fill_uniform, size_t data_size,
66  p6est_init_t init_fn, void *user_pointer);
67 
87 void p6est_save_ext (const char *filename, p6est_t * p6est,
88  int save_data, int save_partition);
89 
113 p6est_t *p6est_load_ext (const char *filename, sc_MPI_Comm mpicomm,
114  size_t data_size, int load_data,
115  int autopartition, int broadcasthead,
116  void *user_pointer,
117  p6est_connectivity_t ** connectivity);
118 
141 void p6est_refine_columns_ext (p6est_t * p6est,
142  int refine_recursive,
143  int maxlevel,
145  p6est_init_t init_fn,
146  p6est_replace_t replace_fn);
147 
170 void p6est_refine_layers_ext (p6est_t * p6est,
171  int refine_recursive,
172  int maxlevel,
174  p6est_init_t init_fn,
175  p6est_replace_t replace_fn);
176 
195 void p6est_coarsen_columns_ext (p6est_t * p6est,
196  int coarsen_recursive,
197  int callback_orphans,
199  coarsen_fn,
200  p6est_init_t init_fn,
201  p6est_replace_t replace_fn);
202 
221 void p6est_coarsen_layers_ext (p6est_t * p6est,
222  int coarsen_recursive,
223  int callback_orphans,
225  coarsen_fn,
226  p6est_init_t init_fn,
227  p6est_replace_t replace_fn);
228 
242  int partition_for_coarsening,
243  p6est_weight_t weight_fn);
244 
260 void p6est_balance_ext (p6est_t * p6est,
261  p8est_connect_type_t btype,
262  int max_diff, int min_diff,
263  p6est_init_t init_fn,
264  p6est_replace_t replace_fn);
265 
266 #endif
int(* p6est_weight_t)(p6est_t *p6est, p4est_topidx_t which_tree, p4est_quadrant_t *column, p2est_quadrant_t *layer)
Callback function prototype to calculate weights for partitioning.
Definition: p6est.h:277
void(* p6est_replace_t)(p6est_t *p6est, p4est_topidx_t which_tree, int num_outcolumns, int num_outlayers, p4est_quadrant_t *outcolumns[], p2est_quadrant_t *outlayers[], int num_incolumns, int num_inlayers, p4est_quadrant_t *incolumns[], p2est_quadrant_t *inlayers[])
Callback function prototype to transfer information from outgoing layers to incoming layers...
Definition: p6est.h:228
p4est_gloidx_t p6est_partition_ext(p6est_t *p6est, int partition_for_coarsening, p6est_weight_t weight_fn)
Repartition the forest.
Definition: p6est.c:1807
void p6est_refine_layers_ext(p6est_t *p6est, int refine_recursive, int maxlevel, p6est_refine_layer_t refine_fn, p6est_init_t init_fn, p6est_replace_t replace_fn)
Vertically refine a forest with a bounded refinement level and a replace option.
Definition: p6est.c:1242
The p6est forest datatype.
Definition: p6est.h:163
void p6est_coarsen_columns_ext(p6est_t *p6est, int coarsen_recursive, int callback_orphans, p6est_coarsen_column_t coarsen_fn, p6est_init_t init_fn, p6est_replace_t replace_fn)
Horizontally coarsen a forest.
Definition: p6est.c:1641
p8est_connect_type_t
Characterize a type of adjacency.
Definition: p8est_connectivity.h:79
p6est_t * p6est_new_ext(sc_MPI_Comm mpicomm, p6est_connectivity_t *connectivity, p4est_locidx_t min_quadrants, int min_level, int min_zlevel, int fill_uniform, size_t data_size, p6est_init_t init_fn, void *user_pointer)
Create a new forest.
Definition: p6est.c:372
void p6est_refine_columns_ext(p6est_t *p6est, int refine_recursive, int maxlevel, p6est_refine_column_t refine_fn, p6est_init_t init_fn, p6est_replace_t replace_fn)
Horizontally refine a forest with a bounded refinement level and a replace option.
Definition: p6est.c:1206
int(* p6est_refine_column_t)(p6est_t *p6est, p4est_topidx_t which_tree, p4est_quadrant_t *column)
Callback function prototype to decide whether to horizontally refine a column, i.e., horizontally refine all of the layers in the column.
Definition: p6est.h:243
static int refine_fn(p4est_t *p4est, p4est_topidx_t which_tree, p4est_quadrant_t *quadrant)
Callback function to decide on refinement.
Definition: p4est_step1.c:59
void(* p6est_init_t)(p6est_t *p6est, p4est_topidx_t which_tree, p4est_quadrant_t *column, p2est_quadrant_t *layer)
Callback function prototype to initialize the layers's user data.
Definition: p6est.h:195
int64_t p4est_gloidx_t
Typedef for globally unique indexing of quadrants.
Definition: p4est_base.h:84
int(* p6est_coarsen_column_t)(p6est_t *p6est, p4est_topidx_t which_tree, p4est_quadrant_t *columns[])
Callback function prototype to decide for horizontal coarsening.
Definition: p6est.h:260
This structure holds the 2D+1D inter-tree connectivity information.
Definition: p6est.h:63
p6est_t * p6est_load_ext(const char *filename, sc_MPI_Comm mpicomm, size_t data_size, int load_data, int autopartition, int broadcasthead, void *user_pointer, p6est_connectivity_t **connectivity)
Load the complete connectivity/p6est structure from disk.
Definition: p6est.c:889
int(* p6est_refine_layer_t)(p6est_t *p6est, p4est_topidx_t which_tree, p4est_quadrant_t *column, p2est_quadrant_t *layer)
Callback function prototype to decide whether to vertically refine a layer.
Definition: p6est.h:251
int(* p6est_coarsen_layer_t)(p6est_t *p6est, p4est_topidx_t which_tree, p4est_quadrant_t *column, p2est_quadrant_t *layers[])
Callback function prototype to decide for vertical coarsening.
Definition: p6est.h:268
void p6est_coarsen_layers_ext(p6est_t *p6est, int coarsen_recursive, int callback_orphans, p6est_coarsen_layer_t coarsen_fn, p6est_init_t init_fn, p6est_replace_t replace_fn)
Vertically coarsen a forest.
Definition: p6est.c:1689
A hybrid 2D+1D AMR extension.
int32_t p4est_locidx_t
Typedef for processor-local indexing of quadrants and nodes.
Definition: p4est_base.h:74
void p6est_save_ext(const char *filename, p6est_t *p6est, int save_data, int save_partition)
Save the complete connectivity/p6est data to disk.
Definition: p6est.c:653
void p6est_balance_ext(p6est_t *p6est, p8est_connect_type_t btype, int max_diff, int min_diff, p6est_init_t init_fn, p6est_replace_t replace_fn)
2:1 balance the size differences of neighboring elements in a forest.
Definition: p6est.c:2174