p4est
1.0
|
00001 /* 00002 This file is part of p4est. 00003 p4est is a C library to manage a collection (a forest) of multiple 00004 connected adaptive quadtrees or octrees in parallel. 00005 00006 Copyright (C) 2010 The University of Texas System 00007 Written by Carsten Burstedde, Lucas C. Wilcox, and Tobin Isaac 00008 00009 p4est is free software; you can redistribute it and/or modify 00010 it under the terms of the GNU General Public License as published by 00011 the Free Software Foundation; either version 2 of the License, or 00012 (at your option) any later version. 00013 00014 p4est is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 GNU General Public License for more details. 00018 00019 You should have received a copy of the GNU General Public License 00020 along with p4est; if not, write to the Free Software Foundation, Inc., 00021 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00022 */ 00023 00024 /******************************************************************** 00025 * IMPORTANT NOTE * 00026 * * 00027 * These interfaces are intended for those who like finer control. * 00028 * The API offers extended versions of some basic p4est functions. * 00029 * The API may change without notice. * 00030 ********************************************************************/ 00031 00039 #ifndef P8EST_EXTENDED_H 00040 #define P8EST_EXTENDED_H 00041 00042 #include <p8est.h> 00043 #include <p8est_iterate.h> 00044 00045 SC_EXTERN_C_BEGIN; 00046 00047 /* Data pertaining to selecting, inspecting, and profiling algorithms. 00048 * A pointer to this structure is hooked into the p8est main structure. 00049 * 00050 * TODO: Describe the purpose of various switches, counters, and timings. 00051 * 00052 * The balance_ranges and balance_notify* times are collected 00053 * whenever an inspect structure is present in p8est. 00054 */ 00055 struct p8est_inspect 00056 { 00059 int use_balance_ranges; 00062 int use_balance_ranges_notify; 00064 int use_balance_verify; 00066 int balance_max_ranges; 00067 size_t balance_A_count_in; 00068 size_t balance_A_count_out; 00069 size_t balance_comm_sent; 00070 size_t balance_comm_nzpeers; 00071 size_t balance_B_count_in; 00072 size_t balance_B_count_out; 00073 size_t balance_zero_sends[2], balance_zero_receives[2]; 00074 double balance_A; 00075 double balance_comm; 00076 double balance_B; 00077 double balance_ranges; 00078 double balance_notify; 00080 double balance_notify_allgather; 00081 int use_B; 00082 }; 00083 00103 typedef void (*p8est_replace_t) (p8est_t * p8est, 00104 p4est_topidx_t which_tree, 00105 int num_outgoing, 00106 p8est_quadrant_t * outgoing[], 00107 int num_incoming, 00108 p8est_quadrant_t * incoming[]); 00109 00123 p8est_t *p8est_new_ext (sc_MPI_Comm mpicomm, 00124 p8est_connectivity_t * connectivity, 00125 p4est_locidx_t min_quadrants, 00126 int min_level, int fill_uniform, 00127 size_t data_size, p8est_init_t init_fn, 00128 void *user_pointer); 00129 00151 void p8est_refine_ext (p8est_t * p8est, 00152 int refine_recursive, int maxlevel, 00153 p8est_refine_t refine_fn, 00154 p8est_init_t init_fn, 00155 p8est_replace_t replace_fn); 00156 00175 void p8est_coarsen_ext (p8est_t * p8est, int coarsen_recursive, 00176 int callback_orphans, 00177 p8est_coarsen_t coarsen_fn, 00178 p8est_init_t init_fn, 00179 p8est_replace_t replace_fn); 00180 00192 void p8est_balance_ext (p8est_t * p8est, 00193 p8est_connect_type_t btype, 00194 p8est_init_t init_fn, 00195 p8est_replace_t replace_fn); 00196 00197 void p8est_balance_subtree_ext (p8est_t * p8est, 00198 p8est_connect_type_t btype, 00199 p4est_topidx_t which_tree, 00200 p8est_init_t init_fn, 00201 p8est_replace_t replace_fn); 00202 00215 p4est_gloidx_t p8est_partition_ext (p8est_t * p8est, 00216 int partition_for_coarsening, 00217 p8est_weight_t weight_fn); 00218 00224 void p8est_iterate_ext (p8est_t * p8est, 00225 p8est_ghost_t * ghost_layer, 00226 void *user_data, 00227 p8est_iter_volume_t iter_volume, 00228 p8est_iter_face_t iter_face, 00229 p8est_iter_edge_t iter_edge, 00230 p8est_iter_corner_t iter_corner, 00231 int remote); 00232 00250 void p8est_save_ext (const char *filename, p8est_t * p8est, 00251 int save_data, int save_partition); 00252 00274 p8est_t *p8est_load_ext (const char *filename, sc_MPI_Comm mpicomm, 00275 size_t data_size, int load_data, 00276 int autopartition, int broadcasthead, 00277 void *user_pointer, 00278 p8est_connectivity_t ** connectivity); 00279 00283 p8est_t *p8est_source_ext (sc_io_source_t * src, 00284 sc_MPI_Comm mpicomm, size_t data_size, 00285 int load_data, int autopartition, 00286 int broadcasthead, void *user_pointer, 00287 p8est_connectivity_t ** connectivity); 00288 00289 SC_EXTERN_C_END; 00290 00291 #endif /* !P8EST_EXTENDED_H */