-
Notifications
You must be signed in to change notification settings - Fork 2
/
block.h
143 lines (135 loc) · 3.51 KB
/
block.h
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
// ************************************************************************
//
// miniAMR: stencil computations with boundary exchange and AMR.
//
// Copyright (2014) Sandia Corporation. Under the terms of Contract
// DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government
// retains certain rights in this software.
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// Questions? Contact Courtenay T. Vaughan (ctvaugh@sandia.gov)
// Richard F. Barrett (rfbarre@sandia.gov)
//
// ************************************************************************
typedef struct {
int number;
int level;
int refine;
int new_proc;
int parent; // if original block -1,
// else if on node, number in structure
// else (-2 - parent->number)
int parent_node;
int child_number;
int nei_refine[6];
int nei_level[6]; /* 0 to 5 = W, E, S, N, D, U; use -2 for boundary */
int nei[6][2][2]; /* negative if off processor (-1 - proc) */
int cen[3];
double ****array;
} block;
block *blocks;
typedef struct {
int number;
int level;
int parent; // -1 if original block
int parent_node;
int child_number;
int refine;
int child[8]; // n if on node, number if not
// if negative, then onnode child is a parent (-1 - n)
int child_node[8];
int cen[3];
} parent;
parent *parents;
typedef struct {
int number; // number of block
int n; // position in block array
} sorted_block;
sorted_block *sorted_list;
int *sorted_index;
int my_pe;
int num_pes;
int max_num_blocks;
int target_active;
int target_max;
int target_min;
int num_refine;
int uniform_refine;
int x_block_size, y_block_size, z_block_size;
int num_vars;
int comm_vars;
int init_block_x, init_block_y, init_block_z;
int reorder;
int npx, npy, npz;
int inbalance;
int refine_freq;
int report_diffusion;
int checksum_freq;
int stages_per_ts;
int error_tol;
int num_tsteps;
int stencil;
int report_perf;
int plot_freq;
int lb_opt;
int block_change;
int code;
int permute;
int nonblocking;
int refine_ghost;
int max_num_parents;
int num_parents;
int max_active_parent;
int cur_max_level;
int *num_blocks;
int *local_num_blocks;
int *block_start;
int num_active;
int max_active_block;
int global_active;
int x_block_half, y_block_half, z_block_half;
double tol;
double *grid_sum;
int *p8, *p2;
int mesh_size[3];
int max_mesh_size;
int *from, *to;
int msg_len[3][4];
int local_max_b;
int global_max_b;
int num_objects;
typedef struct {
int type;
int bounce;
double cen[3];
double orig_cen[3];
double move[3];
double orig_move[3];
double size[3];
double orig_size[3];
double inc[3];
} object;
object *objects;
int num_dots;
int max_num_dots;
int max_active_dot;
typedef struct {
int cen[3];
int number;
int n;
int proc;
int new_proc;
} dot;
dot *dots;