p4est  1.0
src/p4est_extended.h
Go to the documentation of this file.
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 P4EST_EXTENDED_H
00040 #define P4EST_EXTENDED_H
00041 
00042 #include <p4est.h>
00043 #include <p4est_iterate.h>
00044 
00045 SC_EXTERN_C_BEGIN;
00046 
00054 /* TODO: Describe the purpose of various switches, counters, and timings. */
00055 struct p4est_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        (*p4est_replace_t) (p4est_t * p4est,
00104                                         p4est_topidx_t which_tree,
00105                                         int num_outgoing,
00106                                         p4est_quadrant_t * outgoing[],
00107                                         int num_incoming,
00108                                         p4est_quadrant_t * incoming[]);
00109 
00123 p4est_t            *p4est_new_ext (sc_MPI_Comm mpicomm,
00124                                    p4est_connectivity_t * connectivity,
00125                                    p4est_locidx_t min_quadrants,
00126                                    int min_level, int fill_uniform,
00127                                    size_t data_size, p4est_init_t init_fn,
00128                                    void *user_pointer);
00129 
00151 void                p4est_refine_ext (p4est_t * p4est,
00152                                       int refine_recursive, int maxlevel,
00153                                       p4est_refine_t refine_fn,
00154                                       p4est_init_t init_fn,
00155                                       p4est_replace_t replace_fn);
00156 
00175 void                p4est_coarsen_ext (p4est_t * p4est, int coarsen_recursive,
00176                                        int callback_orphans,
00177                                        p4est_coarsen_t coarsen_fn,
00178                                        p4est_init_t init_fn,
00179                                        p4est_replace_t replace_fn);
00180 
00192 void                p4est_balance_ext (p4est_t * p4est,
00193                                        p4est_connect_type_t btype,
00194                                        p4est_init_t init_fn,
00195                                        p4est_replace_t replace_fn);
00196 
00197 void                p4est_balance_subtree_ext (p4est_t * p4est,
00198                                                p4est_connect_type_t btype,
00199                                                p4est_topidx_t which_tree,
00200                                                p4est_init_t init_fn,
00201                                                p4est_replace_t replace_fn);
00202 
00215 p4est_gloidx_t      p4est_partition_ext (p4est_t * p4est,
00216                                          int partition_for_coarsening,
00217                                          p4est_weight_t weight_fn);
00218 
00223 void                p4est_iterate_ext (p4est_t * p4est,
00224                                        p4est_ghost_t * ghost_layer,
00225                                        void *user_data,
00226                                        p4est_iter_volume_t iter_volume,
00227                                        p4est_iter_face_t iter_face,
00228                                        p4est_iter_corner_t iter_corner,
00229                                        int remote);
00230 
00248 void                p4est_save_ext (const char *filename, p4est_t * p4est,
00249                                     int save_data, int save_partition);
00250 
00272 p4est_t            *p4est_load_ext (const char *filename, sc_MPI_Comm mpicomm,
00273                                     size_t data_size, int load_data,
00274                                     int autopartition, int broadcasthead,
00275                                     void *user_pointer,
00276                                     p4est_connectivity_t ** connectivity);
00277 
00281 p4est_t            *p4est_source_ext (sc_io_source_t * src,
00282                                       sc_MPI_Comm mpicomm, size_t data_size,
00283                                       int load_data, int autopartition,
00284                                       int broadcasthead, void *user_pointer,
00285                                       p4est_connectivity_t ** connectivity);
00286 
00287 SC_EXTERN_C_END;
00288 
00289 #endif /* !P4EST_EXTENDED_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines