p4est  1.0
src/p8est_nodes.h
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 #ifndef P8EST_NODES_H
00025 #define P8EST_NODES_H
00026 
00027 #include <p8est.h>
00028 #include <p8est_ghost.h>
00029 
00030 SC_EXTERN_C_BEGIN;
00031 
00035 typedef struct p8est_indep
00036 {
00037   p4est_qcoord_t      x, y, z;
00038   int8_t              level, pad8;
00039   int16_t             pad16;
00040   union p4est_indep_data
00041   {
00042     void               *unused;
00043     p4est_topidx_t      which_tree;
00044     struct
00045     {
00046       p4est_topidx_t      which_tree;
00047       int                 owner_rank;
00048     }
00049     piggy1;
00050     struct
00051     {
00052       p4est_topidx_t      which_tree;
00053       p4est_topidx_t      from_tree;
00054     }
00055     piggy_unused2;
00056     struct
00057     {
00058       p4est_topidx_t      which_tree;
00059       p4est_locidx_t      local_num;
00060     }
00061     piggy3;
00062   }
00063   p;
00064 }
00065 p8est_indep_t;
00066 
00070 typedef struct p8est_hang2
00071 {
00072   p4est_qcoord_t      x, y, z;
00073   int8_t              level, pad8;
00074   int16_t             pad16;
00075   union p8est_hang2_data
00076   {
00077     void               *unused;
00078     p4est_topidx_t      which_tree;
00079     struct
00080     {
00081       p4est_topidx_t      which_tree;
00082       int                 owner_rank;
00083     }
00084     piggy_unused1;
00085     struct
00086     {
00087       p4est_topidx_t      which_tree;
00088       p4est_topidx_t      from_tree;
00089     }
00090     piggy_unused2;
00091     struct
00092     {
00093       p4est_topidx_t      which_tree;
00094       p4est_locidx_t      local_num;
00095     }
00096     piggy_unused3;
00097     struct
00098     {
00099       p4est_topidx_t      which_tree;
00100       p4est_locidx_t      depends[2];
00101     }
00102     piggy;
00103   }
00104   p;
00105 }
00106 p8est_hang2_t;
00107 
00111 typedef struct p8est_hang4
00112 {
00113   p4est_qcoord_t      x, y, z;
00114   int8_t              level, pad8;
00115   int16_t             pad16;
00116   union p8est_hang4_data
00117   {
00118     void               *unused;
00119     p4est_topidx_t      which_tree;
00120     struct
00121     {
00122       p4est_topidx_t      which_tree;
00123       int                 owner_rank;
00124     }
00125     piggy_unused1;
00126     struct
00127     {
00128       p4est_topidx_t      which_tree;
00129       p4est_topidx_t      from_tree;
00130     }
00131     piggy_unused2;
00132     struct
00133     {
00134       p4est_topidx_t      which_tree;
00135       p4est_locidx_t      local_num;
00136     }
00137     piggy_unused3;
00138     struct
00139     {
00140       p4est_topidx_t      which_tree;
00141       p4est_locidx_t      depends[4];
00142     }
00143     piggy;
00144   }
00145   p;
00146 }
00147 p8est_hang4_t;
00148 
00183 typedef struct p8est_nodes
00184 {
00185   p4est_locidx_t      num_local_quadrants;
00186   p4est_locidx_t      num_owned_indeps, num_owned_shared;
00187   p4est_locidx_t      offset_owned_indeps;
00188   sc_array_t          indep_nodes;
00189   sc_array_t          face_hangings;
00190   sc_array_t          edge_hangings;
00191   p4est_locidx_t     *local_nodes;
00192   sc_array_t          shared_indeps;
00193   p4est_locidx_t     *shared_offsets;
00194   int                *nonlocal_ranks;
00195   p4est_locidx_t     *global_owned_indeps;
00196 }
00197 p8est_nodes_t;
00198 
00208 p8est_nodes_t      *p8est_nodes_new (p8est_t * p8est, p8est_ghost_t * ghost);
00209 
00211 void                p8est_nodes_destroy (p8est_nodes_t * nodes);
00212 
00214 int                 p8est_nodes_is_valid (p8est_t * p8est,
00215                                           p8est_nodes_t * nodes);
00216 
00217 SC_EXTERN_C_END;
00218 
00219 #endif /* !P8EST_NODES_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines