p4est  1.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
p8est_nodes.h
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  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 #ifndef P8EST_NODES_H
25 #define P8EST_NODES_H
26 
27 #include <p8est.h>
28 #include <p8est_ghost.h>
29 
30 SC_EXTERN_C_BEGIN;
31 
35 typedef struct p8est_indep
36 {
37  p4est_qcoord_t x, y, z;
38  int8_t level, pad8;
39  int16_t pad16;
41  {
42  void *unused;
43  p4est_topidx_t which_tree;
44  struct
45  {
46  p4est_topidx_t which_tree;
47  int owner_rank;
48  }
49  piggy1;
50  struct
51  {
52  p4est_topidx_t which_tree;
53  p4est_topidx_t from_tree;
54  }
55  piggy_unused2;
56  struct
57  {
58  p4est_topidx_t which_tree;
59  p4est_locidx_t local_num;
60  }
61  piggy3;
62  }
63  p;
64 }
66 
70 typedef struct p8est_hang2
71 {
72  p4est_qcoord_t x, y, z;
73  int8_t level, pad8;
74  int16_t pad16;
76  {
77  void *unused;
78  p4est_topidx_t which_tree;
79  struct
80  {
81  p4est_topidx_t which_tree;
82  int owner_rank;
83  }
84  piggy_unused1;
85  struct
86  {
87  p4est_topidx_t which_tree;
88  p4est_topidx_t from_tree;
89  }
90  piggy_unused2;
91  struct
92  {
93  p4est_topidx_t which_tree;
94  p4est_locidx_t local_num;
95  }
96  piggy_unused3;
97  struct
98  {
99  p4est_topidx_t which_tree;
100  p4est_locidx_t depends[2];
101  }
102  piggy;
103  }
104  p;
105 }
107 
111 typedef struct p8est_hang4
112 {
113  p4est_qcoord_t x, y, z;
114  int8_t level, pad8;
115  int16_t pad16;
117  {
118  void *unused;
119  p4est_topidx_t which_tree;
120  struct
121  {
122  p4est_topidx_t which_tree;
123  int owner_rank;
124  }
125  piggy_unused1;
126  struct
127  {
128  p4est_topidx_t which_tree;
129  p4est_topidx_t from_tree;
130  }
131  piggy_unused2;
132  struct
133  {
134  p4est_topidx_t which_tree;
135  p4est_locidx_t local_num;
136  }
137  piggy_unused3;
138  struct
139  {
140  p4est_topidx_t which_tree;
141  p4est_locidx_t depends[4];
142  }
143  piggy;
144  }
145  p;
146 }
148 
183 typedef struct p8est_nodes
184 {
185  p4est_locidx_t num_local_quadrants;
186  p4est_locidx_t num_owned_indeps, num_owned_shared;
187  p4est_locidx_t offset_owned_indeps;
188  sc_array_t indep_nodes;
189  sc_array_t face_hangings;
190  sc_array_t edge_hangings;
191  p4est_locidx_t *local_nodes;
192  sc_array_t shared_indeps;
193  p4est_locidx_t *shared_offsets;
194  int *nonlocal_ranks;
195  p4est_locidx_t *global_owned_indeps;
196 }
198 
208 p8est_nodes_t *p8est_nodes_new (p8est_t * p8est, p8est_ghost_t * ghost);
209 
211 void p8est_nodes_destroy (p8est_nodes_t * nodes);
212 
214 int p8est_nodes_is_valid (p8est_t * p8est,
215  p8est_nodes_t * nodes);
216 
217 SC_EXTERN_C_END;
218 
219 #endif /* !P8EST_NODES_H */
int32_t p4est_qcoord_t
Typedef for quadrant coordinates.
Definition: p4est_base.h:53
passing quadrants and data to neighboring processes
quadrants that neighbor the local domain
Definition: p8est_ghost.h:39
Definition: p8est_nodes.h:75
Definition: p8est_nodes.h:116
The top-level 3D p8est interface.
Store a hanging node that depends on two independent nodes.
Definition: p8est_nodes.h:70
Definition: p8est_nodes.h:40
Store a hanging node that depends on four independent nodes.
Definition: p8est_nodes.h:111
The p8est forest datatype.
Definition: p8est.h:125
The sc_array object provides a large array of equal-size elements.
Definition: sc_containers.h:92
int32_t p4est_topidx_t
Typedef for counting topological entities (trees, tree vertices).
Definition: p4est_base.h:63
int32_t p4est_locidx_t
Typedef for processor-local indexing of quadrants and nodes.
Definition: p4est_base.h:74
This structure holds complete parallel node information.
Definition: p8est_nodes.h:183
Store an independent node.
Definition: p8est_nodes.h:35