/usr/include/p8est_nodes.h is in libp4est-dev 1.1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 | /*
This file is part of p4est.
p4est is a C library to manage a collection (a forest) of multiple
connected adaptive quadtrees or octrees in parallel.
Copyright (C) 2010 The University of Texas System
Written by Carsten Burstedde, Lucas C. Wilcox, and Tobin Isaac
p4est is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
p4est is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with p4est; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef P8EST_NODES_H
#define P8EST_NODES_H
#include <p8est.h>
#include <p8est_ghost.h>
SC_EXTERN_C_BEGIN;
/** Store an independent node.
* Keep this in sync with the p8est_t data structure.
*/
typedef struct p8est_indep
{
p4est_qcoord_t x, y, z;
int8_t level, pad8;
int16_t pad16;
union p4est_indep_data
{
void *unused;
p4est_topidx_t which_tree;
struct
{
p4est_topidx_t which_tree;
int owner_rank;
}
piggy1;
struct
{
p4est_topidx_t which_tree;
p4est_topidx_t from_tree;
}
piggy_unused2;
struct
{
p4est_topidx_t which_tree;
p4est_locidx_t local_num;
}
piggy3;
}
p;
}
p8est_indep_t;
/** Store a hanging node that depends on two independent nodes.
* Keep this in sync with the p8est_t data structure.
*/
typedef struct p8est_hang2
{
p4est_qcoord_t x, y, z;
int8_t level, pad8;
int16_t pad16;
union p8est_hang2_data
{
void *unused;
p4est_topidx_t which_tree;
struct
{
p4est_topidx_t which_tree;
int owner_rank;
}
piggy_unused1;
struct
{
p4est_topidx_t which_tree;
p4est_topidx_t from_tree;
}
piggy_unused2;
struct
{
p4est_topidx_t which_tree;
p4est_locidx_t local_num;
}
piggy_unused3;
struct
{
p4est_topidx_t which_tree;
p4est_locidx_t depends[2];
}
piggy;
}
p;
}
p8est_hang2_t;
/** Store a hanging node that depends on four independent nodes.
* Keep this in sync with the p8est_t data structure.
*/
typedef struct p8est_hang4
{
p4est_qcoord_t x, y, z;
int8_t level, pad8;
int16_t pad16;
union p8est_hang4_data
{
void *unused;
p4est_topidx_t which_tree;
struct
{
p4est_topidx_t which_tree;
int owner_rank;
}
piggy_unused1;
struct
{
p4est_topidx_t which_tree;
p4est_topidx_t from_tree;
}
piggy_unused2;
struct
{
p4est_topidx_t which_tree;
p4est_locidx_t local_num;
}
piggy_unused3;
struct
{
p4est_topidx_t which_tree;
p4est_locidx_t depends[4];
}
piggy;
}
p;
}
p8est_hang4_t;
/** This structure holds complete parallel node information.
*
* Nodes are unique and either independent, face or edge hanging.
* Independent nodes store their owner's tree id in piggy3.which_tree.
* The index in their owner's ordering is stored in piggy3.local_num.
* Hanging nodes store their owner's tree id in piggy.which_tree.
* The numbers of their associated independent nodes are in piggy.depends[].
*
* The local_nodes table is of dimension 8 * num_local_quadrants
* and encodes the node indexes for all corners of all quadrants. Let
* ni := indep_nodes.elem_count,
* fi := face_hangings.elem_count,
* ei := edge_hangings.elem_count.
* If for l := local_nodes[k]
* l >= 0 && l < ni: l indexes into indep_nodes.
* l >= ni && l < ni + fi: l - ni indexes into face_hangings.
* l >= ni + fi && l < ni + fi + ei: l - ni - fi indexes into edge_hangings.
* No other values for l are permitted.
*
* The array shared_indeps holds lists of node sharers (not including rank).
* The entry shared_indeps[i] is of type sc_recycle_array_t
* and holds the list of nodes with i + 1 sharers.
* For each independent node, its member pad8 holds the number of sharers
* and its member pad16 holds the position in the assigned recycle array
* if this number fits into an int16_t. If this limit is exceeded, the
* array shared_offsets is filled with these positions as one p4est_locidx_t
* per independent node, and all pad16 members are set to -1. To recognize
* the latter situation you can check for shared_offsets != NULL.
*
* Each processor owns num_owned_indeps of the stored independent nodes.
* The first independent owned node is at index offset_owned_indeps.
* The table nonlocal_ranks contains the ranks of all stored non-owned nodes.
* The table global_owned_indeps holds the number of owned nodes for each rank.
*/
typedef struct p8est_nodes
{
p4est_locidx_t num_local_quadrants;
p4est_locidx_t num_owned_indeps, num_owned_shared;
p4est_locidx_t offset_owned_indeps;
sc_array_t indep_nodes;
sc_array_t face_hangings;
sc_array_t edge_hangings;
p4est_locidx_t *local_nodes;
sc_array_t shared_indeps;
p4est_locidx_t *shared_offsets;
int *nonlocal_ranks;
p4est_locidx_t *global_owned_indeps;
}
p8est_nodes_t;
/** Create node information.
* \param [in] ghost Ghost layer. If this is NULL, then only
* tree- and processor-local nodes will be matched
* and all others duplicated, all nodes will be
* counted as independent with no sharers, and
* nodes->global_owned_indeps will be NULL;
* this also works for a corner-unbalanced forest,
* but nodes may not be numbered uniquely in this case.
*/
p8est_nodes_t *p8est_nodes_new (p8est_t * p8est, p8est_ghost_t * ghost);
/** Destroy node information. */
void p8est_nodes_destroy (p8est_nodes_t * nodes);
/** Check node information for internal consistency. */
int p8est_nodes_is_valid (p8est_t * p8est,
p8est_nodes_t * nodes);
SC_EXTERN_C_END;
#endif /* !P8EST_NODES_H */
|