ADflow  v1.0
ADflow is a finite volume RANS solver tailored for gradient-based aerodynamic design optimization.
struct.h
Go to the documentation of this file.
1 /*
2  * Copyright 1997, Regents of the University of Minnesota
3  *
4  * struct.h
5  *
6  * This file contains data structures for ILU routines.
7  *
8  * Started 9/26/95
9  * George
10  *
11  * $Id$
12  */
13 
14 /* Modified by Edwin van der Weide, 02-12-2003, such that idxtype */
15 /* is set to the integer type used in the entire code. */
16 
17 #include <ADflow_c_types.h>
18 
20 
21 #define MAXIDX (((idxtype) 1)<<(8*sizeof(idxtype)-2))
22 
23 
24 /*************************************************************************
25 * The following data structure stores key-value pair
26 **************************************************************************/
27 struct KeyValueType {
30 };
31 
32 typedef struct KeyValueType KeyValueType;
33 
34 
35 /*************************************************************************
36 * The following data structure will hold a node of a doubly-linked list.
37 **************************************************************************/
38 struct ListNodeType {
39  int id; /* The id value of the node */
40  struct ListNodeType *prev, *next; /* It's a doubly-linked list */
41 };
42 
43 typedef struct ListNodeType ListNodeType;
44 
45 
46 
47 /*************************************************************************
48 * The following data structure is used to store the buckets for the
49 * refinment algorithms
50 **************************************************************************/
51 struct PQueueType {
52  int type; /* The type of the representation used */
53  int nnodes;
54  int maxnodes;
55  int mustfree;
56 
57  /* Linear array version of the data structures */
58  int pgainspan, ngainspan; /* plus and negative gain span */
59  int maxgain;
62 
63  /* Heap version of the data structure */
66 };
67 
68 typedef struct PQueueType PQueueType;
69 
70 
71 /*************************************************************************
72 * The following data structure stores an edge
73 **************************************************************************/
74 struct edegreedef {
77 };
78 typedef struct edegreedef EDegreeType;
79 
80 
81 /*************************************************************************
82 * The following data structure stores an edge for vol
83 **************************************************************************/
84 struct vedegreedef {
88 };
89 typedef struct vedegreedef VEDegreeType;
90 
91 
92 /*************************************************************************
93 * This data structure holds various working space data
94 **************************************************************************/
95 struct workspacedef {
96  idxtype *core; /* Where pairs, indices, and degrees are coming from */
97  int maxcore, ccore;
98 
101  int cdegree;
102 
103  idxtype *auxcore; /* This points to the memory of the edegrees */
104 
105  idxtype *pmat; /* An array of k^2 used for eliminating domain
106  connectivity in k-way refinement */
107 };
108 
109 typedef struct workspacedef WorkSpaceType;
110 
111 
112 /*************************************************************************
113 * The following data structure holds information on degrees for k-way
114 * partition
115 **************************************************************************/
116 struct rinfodef {
117  int id, ed; /* ID/ED of nodes */
118  int ndegrees; /* The number of different ext-degrees */
119  EDegreeType *edegrees; /* List of edges */
120 };
121 
122 typedef struct rinfodef RInfoType;
123 
124 
125 /*************************************************************************
126 * The following data structure holds information on degrees for k-way
127 * vol-based partition
128 **************************************************************************/
129 struct vrinfodef {
130  int id, ed, nid; /* ID/ED of nodes */
131  int gv; /* IV/EV of nodes */
132  int ndegrees; /* The number of different ext-degrees */
133  VEDegreeType *edegrees; /* List of edges */
134 };
135 
136 typedef struct vrinfodef VRInfoType;
137 
138 
139 /*************************************************************************
140 * The following data structure holds information on degrees for k-way
141 * partition
142 **************************************************************************/
143 struct nrinfodef {
145 };
146 
147 typedef struct nrinfodef NRInfoType;
148 
149 
150 /*************************************************************************
151 * This data structure holds the input graph
152 **************************************************************************/
153 struct graphdef {
154  idxtype *gdata, *rdata; /* Memory pools for graph and refinement data.
155  This is where memory is allocated and used
156  the rest of the fields in this structure */
157 
158  int nvtxs, nedges; /* The # of vertices and edges in the graph */
159  idxtype *xadj; /* Pointers to the locally stored vertices */
160  idxtype *vwgt; /* Vertex weights */
161  idxtype *vsize; /* Vertex sizes for min-volume formulation */
162  idxtype *adjncy; /* Array that stores the adjacency lists of nvtxs */
163  idxtype *adjwgt; /* Array that stores the weights of the adjacency lists */
164 
165  idxtype *adjwgtsum; /* The sum of the adjacency weight of each vertex */
166 
168 
170 
171  /* Partition parameters */
174  int nbnd;
176 
177  /* Bisection refinement parameters */
179 
180  /* K-way refinement parameters */
182 
183  /* K-way volume refinement parameters */
185 
186  /* Node refinement information */
188 
189 
190  /* Additional info needed by the MOC routines */
191  int ncon; /* The # of constrains */
192  float *nvwgt; /* Normalized vertex weights */
193  float *npwgts; /* The normalized partition weights */
194 
195  struct graphdef *coarser, *finer;
196 };
197 
198 typedef struct graphdef GraphType;
199 
200 
201 
202 /*************************************************************************
203 * The following data type implements a timer
204 **************************************************************************/
205 typedef double timer;
206 
207 
208 /*************************************************************************
209 * The following structure stores information used by Metis
210 **************************************************************************/
211 struct controldef {
212  int CoarsenTo; /* The # of vertices in the coarsest graph */
213  int dbglvl; /* Controls the debuging output of the program */
214  int CType; /* The type of coarsening */
215  int IType; /* The type of initial partitioning */
216  int RType; /* The type of refinement */
217  int maxvwgt; /* The maximum allowed weight for a vertex */
218  float nmaxvwgt; /* The maximum allowed weight for a vertex for each constrain */
219  int optype; /* Type of operation */
220  int pfactor; /* .1*prunning factor */
221  int nseps; /* The number of separators to be found during multiple bisections */
222  int oflags;
223 
224  WorkSpaceType wspace; /* Work Space Informations */
225 
226  /* Various Timers */
229 
230 };
231 
232 typedef struct controldef CtrlType;
233 
234 
235 /*************************************************************************
236 * The following data structure stores max-partition weight info for
237 * Vertical MOC k-way refinement
238 **************************************************************************/
239 struct vpwgtdef {
240  float max[2][MAXNCON];
241  int imax[2][MAXNCON];
242 };
243 
244 typedef struct vpwgtdef VPInfoType;
int ADflow_intT
#define MAXNCON
Definition: defs.h:20
ADflow_intT idxtype
Definition: struct.h:19
double timer
Definition: struct.h:205
idxtype key
Definition: struct.h:28
idxtype val
Definition: struct.h:29
int id
Definition: struct.h:39
struct ListNodeType * next
Definition: struct.h:40
struct ListNodeType * prev
Definition: struct.h:40
int mustfree
Definition: struct.h:55
idxtype * locator
Definition: struct.h:65
int type
Definition: struct.h:52
int pgainspan
Definition: struct.h:58
ListNodeType * nodes
Definition: struct.h:60
ListNodeType ** buckets
Definition: struct.h:61
int maxnodes
Definition: struct.h:54
int maxgain
Definition: struct.h:59
KeyValueType * heap
Definition: struct.h:64
int ngainspan
Definition: struct.h:58
int nnodes
Definition: struct.h:53
timer AuxTmr3
Definition: struct.h:228
int dbglvl
Definition: struct.h:213
timer ContractTmr
Definition: struct.h:227
WorkSpaceType wspace
Definition: struct.h:224
timer ProjectTmr
Definition: struct.h:228
timer AuxTmr2
Definition: struct.h:228
int pfactor
Definition: struct.h:220
timer RefTmr
Definition: struct.h:228
timer CoarsenTmr
Definition: struct.h:227
timer AuxTmr6
Definition: struct.h:228
int CType
Definition: struct.h:214
timer UncoarsenTmr
Definition: struct.h:227
timer InitPartTmr
Definition: struct.h:227
int optype
Definition: struct.h:219
int IType
Definition: struct.h:215
int nseps
Definition: struct.h:221
int maxvwgt
Definition: struct.h:217
int CoarsenTo
Definition: struct.h:212
int RType
Definition: struct.h:216
timer SepTmr
Definition: struct.h:228
timer MatchTmr
Definition: struct.h:227
timer AuxTmr1
Definition: struct.h:228
float nmaxvwgt
Definition: struct.h:218
int oflags
Definition: struct.h:222
timer AuxTmr4
Definition: struct.h:228
timer AuxTmr5
Definition: struct.h:228
timer TotalTmr
Definition: struct.h:227
timer SplitTmr
Definition: struct.h:228
idxtype pid
Definition: struct.h:75
idxtype ed
Definition: struct.h:76
int nbnd
Definition: struct.h:174
idxtype * adjncy
Definition: struct.h:162
VRInfoType * vrinfo
Definition: struct.h:184
idxtype * bndind
Definition: struct.h:175
idxtype * where
Definition: struct.h:173
idxtype * rdata
Definition: struct.h:154
int nvtxs
Definition: struct.h:158
idxtype * gdata
Definition: struct.h:154
idxtype * ed
Definition: struct.h:178
idxtype * vwgt
Definition: struct.h:160
float * nvwgt
Definition: struct.h:192
int minvol
Definition: struct.h:172
NRInfoType * nrinfo
Definition: struct.h:187
idxtype * adjwgtsum
Definition: struct.h:165
struct graphdef * finer
Definition: struct.h:195
RInfoType * rinfo
Definition: struct.h:181
idxtype * pwgts
Definition: struct.h:173
idxtype * label
Definition: struct.h:167
int ncon
Definition: struct.h:191
idxtype * id
Definition: struct.h:178
float * npwgts
Definition: struct.h:193
int nedges
Definition: struct.h:158
int mincut
Definition: struct.h:172
idxtype * adjwgt
Definition: struct.h:163
idxtype * bndptr
Definition: struct.h:175
idxtype * vsize
Definition: struct.h:161
struct graphdef * coarser
Definition: struct.h:195
idxtype * xadj
Definition: struct.h:159
idxtype * cmap
Definition: struct.h:169
idxtype edegrees[2]
Definition: struct.h:144
int id
Definition: struct.h:117
int ndegrees
Definition: struct.h:118
EDegreeType * edegrees
Definition: struct.h:119
int ed
Definition: struct.h:117
idxtype ed
Definition: struct.h:86
idxtype ned
Definition: struct.h:86
idxtype pid
Definition: struct.h:85
idxtype gv
Definition: struct.h:87
int imax[2][MAXNCON]
Definition: struct.h:241
float max[2][MAXNCON]
Definition: struct.h:240
int gv
Definition: struct.h:131
int id
Definition: struct.h:130
int ndegrees
Definition: struct.h:132
VEDegreeType * edegrees
Definition: struct.h:133
int nid
Definition: struct.h:130
int ed
Definition: struct.h:130
idxtype * core
Definition: struct.h:96
int ccore
Definition: struct.h:97
EDegreeType * edegrees
Definition: struct.h:99
int maxcore
Definition: struct.h:97
idxtype * auxcore
Definition: struct.h:103
int cdegree
Definition: struct.h:101
VEDegreeType * vedegrees
Definition: struct.h:100
idxtype * pmat
Definition: struct.h:105