p4est  2.8.643-dbc7-dirty
p4est is a software library for parallel adaptive mesh refinement.
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) 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 P6EST_EXTENDED_H
26 #define P6EST_EXTENDED_H
27 
28 /********************************************************************
29  * IMPORTANT NOTE *
30  * *
31  * These interfaces are intended for those who like finer control. *
32  * The API offers extended versions of some basic p6est functions. *
33  * The API may change without notice. *
34  ********************************************************************/
35 
43 #include <p6est.h>
44 
45 SC_EXTERN_C_BEGIN;
46 
67  p6est_connectivity_t * connectivity,
68  p4est_locidx_t min_quadrants,
69  int min_level, int min_zlevel,
70  int num_zroot,
71  int fill_uniform, size_t data_size,
72  p6est_init_t init_fn, void *user_pointer);
73 
85 p6est_t *p6est_copy_ext (p6est_t * input, int copy_data,
86  int duplicate_mpicomm);
87 
107 void p6est_save_ext (const char *filename, p6est_t * p6est,
108  int save_data, int save_partition);
109 
133 p6est_t *p6est_load_ext (const char *filename, sc_MPI_Comm mpicomm,
134  size_t data_size, int load_data,
135  int autopartition, int broadcasthead,
136  void *user_pointer,
137  p6est_connectivity_t ** connectivity);
138 
162  int refine_recursive,
163  int maxlevel,
164  p6est_refine_column_t refine_fn,
165  p6est_init_t init_fn,
166  p6est_replace_t replace_fn);
167 
191  int refine_recursive,
192  int maxlevel,
193  p6est_refine_layer_t refine_fn,
194  p6est_init_t init_fn,
195  p6est_replace_t replace_fn);
196 
216  int coarsen_recursive,
217  int callback_orphans,
219  coarsen_fn,
220  p6est_init_t init_fn,
221  p6est_replace_t replace_fn);
222 
242  int coarsen_recursive,
243  int callback_orphans,
245  coarsen_fn,
246  p6est_init_t init_fn,
247  p6est_replace_t replace_fn);
248 
262  int partition_for_coarsening,
263  p6est_weight_t weight_fn);
264 
281  p8est_connect_type_t btype,
282  int max_diff, int min_diff,
283  p6est_init_t init_fn,
284  p6est_replace_t replace_fn);
285 
286 SC_EXTERN_C_END;
287 
288 #endif
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
A hybrid 2D+1D AMR extension.
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....
Definition: p6est.h:249
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:201
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:283
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:266
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:234
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:257
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:274
p4est_gloidx_t p6est_partition_ext(p6est_t *p6est, int partition_for_coarsening, p6est_weight_t weight_fn)
Repartition the forest.
p6est_t * p6est_copy_ext(p6est_t *input, int copy_data, int duplicate_mpicomm)
Make a deep copy of a p6est.
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.
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.
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.
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.
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.
void p6est_save_ext(const char *filename, p6est_t *p6est, int save_data, int save_partition)
Save the complete connectivity/p6est data to disk.
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.
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 num_zroot, int fill_uniform, size_t data_size, p6est_init_t init_fn, void *user_pointer)
Create a new forest.
p8est_connect_type_t
Characterize a type of adjacency.
Definition: p8est_connectivity.h:90
sc3_MPI_Comm_t sc_MPI_Comm
This structure holds the 2D+1D inter-tree connectivity information.
Definition: p6est.h:65
The p6est forest datatype.
Definition: p6est.h:165