-
Notifications
You must be signed in to change notification settings - Fork 35
/
jigsaw_msh_t.h
258 lines (202 loc) · 6.92 KB
/
jigsaw_msh_t.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
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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
/*
--------------------------------------------------------
* JIGSAW's "msh" mesh type definition.
--------------------------------------------------------
*
* This program may be freely redistributed under the
* condition that the copyright notices (including this
* entire header) are not removed, and no compensation
* is received through use of the software. Private,
* research, and institutional use is free. You may
* distribute modified versions of this code UNDER THE
* CONDITION THAT THIS CODE AND ANY MODIFICATIONS MADE
* TO IT IN THE SAME FILE REMAIN UNDER COPYRIGHT OF THE
* ORIGINAL AUTHOR, BOTH SOURCE AND OBJECT CODE ARE
* MADE FREELY AVAILABLE WITHOUT CHARGE, AND CLEAR
* NOTICE IS GIVEN OF THE MODIFICATIONS. Distribution
* of this code as part of a commercial system is
* permissible ONLY BY DIRECT ARRANGEMENT WITH THE
* AUTHOR. (If you are not directly supplying this
* code to a customer, and you are instead telling them
* how they can obtain it for free, then you are not
* required to make any arrangement with me.)
*
* Disclaimer: Neither I nor THE CONTRIBUTORS warrant
* this code in any way whatsoever. This code is
* provided "as-is" to be used at your own risk.
*
* THE CONTRIBUTORS include:
* (a) The University of Sydney
* (b) The Massachusetts Institute of Technology
* (c) Columbia University
* (d) The National Aeronautics & Space Administration
* (e) Los Alamos National Laboratory
*
--------------------------------------------------------
*
* Last updated: 08 Feb., 2021
*
* Copyright 2013-2021
* Darren Engwirda
* d.engwirda@gmail.com
* https://github.com/dengwirda
*
--------------------------------------------------------
*/
# pragma once
# ifndef __JIGSAW_MSH_T__
# define __JIGSAW_MSH_T__
/*------------------------------------------- geom. types */
typedef struct
{
real_t _ppos [2] ; // coord.'s
indx_t _itag ; // ID tag
} jigsaw_VERT2_t ;
typedef struct
{
real_t _ppos [3] ; // coord.'s
indx_t _itag ; // ID tag
} jigsaw_VERT3_t ;
typedef struct
{
indx_t _node [2] ; // indexing
indx_t _itag ; // ID tag
} jigsaw_EDGE2_t ;
typedef struct
{
indx_t _node [3] ; // indexing
indx_t _itag ; // ID tag
} jigsaw_TRIA3_t ;
typedef struct
{
indx_t _node [4] ; // indexing
indx_t _itag ; // ID tag
} jigsaw_QUAD4_t ;
typedef struct
{
indx_t _node [4] ; // indexing
indx_t _itag ; // ID tag
} jigsaw_TRIA4_t ;
typedef struct
{
indx_t _node [8] ; // indexing
indx_t _itag ; // ID tag
} jigsaw_HEXA8_t ;
typedef struct
{
indx_t _node [6] ; // indexing
indx_t _itag ; // ID tag
} jigsaw_WEDG6_t ;
typedef struct
{
indx_t _node [5] ; // indexing
indx_t _itag ; // ID tag
} jigsaw_PYRA5_t ;
typedef struct
{
indx_t _itag ; // ID tag
indx_t _indx ; // MSH num.
indx_t _kind ; // MSH obj.
} jigsaw_BOUND_t ;
/*------------------------------------------- array types */
typedef struct
{
size_t _size ;
jigsaw_VERT2_t *_data ;
} jigsaw_VERT2_array_t ;
typedef struct
{
size_t _size ;
jigsaw_VERT3_t *_data ;
} jigsaw_VERT3_array_t ;
typedef struct
{
size_t _size ;
jigsaw_EDGE2_t *_data ;
} jigsaw_EDGE2_array_t ;
typedef struct
{
size_t _size ;
jigsaw_TRIA3_t *_data ;
} jigsaw_TRIA3_array_t ;
typedef struct
{
size_t _size ;
jigsaw_QUAD4_t *_data ;
} jigsaw_QUAD4_array_t ;
typedef struct
{
size_t _size ;
jigsaw_TRIA4_t *_data ;
} jigsaw_TRIA4_array_t ;
typedef struct
{
size_t _size ;
jigsaw_HEXA8_t *_data ;
} jigsaw_HEXA8_array_t ;
typedef struct
{
size_t _size ;
jigsaw_WEDG6_t *_data ;
} jigsaw_WEDG6_array_t ;
typedef struct
{
size_t _size ;
jigsaw_PYRA5_t *_data ;
} jigsaw_PYRA5_array_t ;
typedef struct
{
size_t _size ;
jigsaw_BOUND_t *_data ;
} jigsaw_BOUND_array_t ;
typedef struct
{
size_t _size ;
indx_t *_data ;
} jigsaw_INDEX_array_t ;
typedef struct
{
size_t _size ;
real_t *_data ;
} jigsaw_REALS_array_t ;
typedef struct
{
size_t _size ;
fp32_t *_data ;
} jigsaw_FLT32_array_t ;
/*------------------------------------------- "msh" class */
typedef struct
{
indx_t _flags;
/* if (_flags == EUCLIDEAN_MESH) */
jigsaw_VERT2_array_t _vert2;
jigsaw_VERT3_array_t _vert3;
jigsaw_REALS_array_t _power;
jigsaw_EDGE2_array_t _edge2;
jigsaw_TRIA3_array_t _tria3;
jigsaw_QUAD4_array_t _quad4;
jigsaw_TRIA4_array_t _tria4;
jigsaw_HEXA8_array_t _hexa8;
jigsaw_WEDG6_array_t _wedg6;
jigsaw_PYRA5_array_t _pyra5;
jigsaw_BOUND_array_t _bound;
jigsaw_VERT2_array_t _seed2;
jigsaw_VERT3_array_t _seed3;
/* if (_flags == ELLIPSOID_MESH) */
jigsaw_REALS_array_t _radii;
/* if (_flags == EUCLIDEAN_GRID) */
/* OR (_flags == ELLIPSOID_GRID) */
jigsaw_REALS_array_t _xgrid;
jigsaw_REALS_array_t _ygrid;
jigsaw_REALS_array_t _zgrid;
/* if (_flags == EUCLIDEAN_MESH) */
/* OR (_flags == EUCLIDEAN_GRID) */
/* OR (_flags == ELLIPSOID_MESH) */
/* OR (_flags == ELLIPSOID_GRID) */
jigsaw_FLT32_array_t _value;
/* for |dfdx| limiting in MARCHE */
jigsaw_FLT32_array_t _slope;
/* if (_flags == EUCLIDEAN_DUAL) */
/*!! todo: dual-mesh data here!! */
} jigsaw_msh_t ;
# endif //__JIGSAW_MSH_T__