/[escript]/branches/doubleplusgood/finley/src/ReferenceElements.cpp
ViewVC logotype

Contents of /branches/doubleplusgood/finley/src/ReferenceElements.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4327 - (show annotations)
Wed Mar 20 05:09:11 2013 UTC (6 years, 7 months ago) by jfenwick
File size: 30543 byte(s)
some finley memory
1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2013 by University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development since 2012 by School of Earth Sciences
13 *
14 *****************************************************************************/
15
16
17 /************************************************************************************/
18
19 /* Finley: Reference elements */
20
21 /************************************************************************************/
22
23 #include "ReferenceElements.h"
24 #include "esysUtils/mem.h"
25 #include <string.h>
26
27 #define MAX(X,Y) ((X)>(Y)?(X):(Y))
28
29 /************************************************************************************
30
31 this list has been generated by generateReferenceElementList.py:.
32 */
33
34 Finley_ReferenceElementInfo Finley_ReferenceElement_InfoList[]={
35 { Finley_Point1, "Point1", 1, 1, 1, { 0, 1 }, Finley_Point1,
36 { 0 }, PointQuad, Point1Shape, Point1Shape,
37 { 0 },
38 1, { 0 },
39 1, { 0 },
40 { 0 },
41 { -1 } },
42 { Finley_Line2, "Line2", 2, 1, 1, { 0, 2 }, Finley_Line2,
43 { 0, 1 }, LineQuad, Line2Shape, Line2Shape,
44 { 0, 1 },
45 2, { 0, 1 },
46 2, { 0, 1 },
47 { 1, 0 },
48 { -1 } },
49 { Finley_Line3, "Line3", 3, 1, 1, { 0, 3 }, Finley_Line2,
50 { 0, 1 }, LineQuad, Line3Shape, Line3Shape,
51 { 0, 1, 2 },
52 3, { 0, 1, 2 },
53 3, { 0, 1, 2 },
54 { 1, 0, 2 },
55 { -1 } },
56 { Finley_Line4, "Line4", 4, 1, 1, { 0, 4 }, Finley_Line2,
57 { 0, 1 }, LineQuad, Line4Shape, Line4Shape,
58 { 0, 1, 2, 3 },
59 4, { 0, 1, 2, 3 },
60 4, { 0, 1, 2, 3 },
61 { 1, 0, 3, 2 },
62 { -1 } },
63 { Finley_Tri3, "Tri3", 3, 1, 1, { 0, 3 }, Finley_Tri3,
64 { 0, 1, 2 }, TriQuad, Tri3Shape, Tri3Shape,
65 { 0, 1, 2 },
66 3, { 0, 1, 2 },
67 3, { 0, 1, 2 },
68 { 1, 2, 0 },
69 { 0, 2, 1 } },
70 { Finley_Tri6, "Tri6", 6, 1, 1, { 0, 6 }, Finley_Tri3,
71 { 0, 1, 2 }, TriQuad, Tri6Shape, Tri6Shape,
72 { 0, 1, 2, 3, 4, 5 },
73 6, { 0, 1, 2, 3, 4, 5 },
74 6, { 0, 1, 2, 3, 4, 5 },
75 { 1, 2, 0, 4, 5, 3 },
76 { 0, 2, 1, 5, 4, 3 } },
77 { Finley_Tri9, "Tri9", 9, 1, 1, { 0, 9 }, Finley_Tri3,
78 { 0, 1, 2 }, TriQuad, Tri9Shape, Tri9Shape,
79 { 0, 1, 2, 3, 4, 5, 6, 7, 8 },
80 9, { 0, 1, 2, 3, 4, 5, 6, 7, 8 },
81 9, { 0, 1, 2, 3, 4, 5, 6, 7, 8 },
82 { 1, 2, 0, 5, 6, 7, 8, 3, 4 },
83 { 0, 2, 1, 8, 7, 6, 5, 4, 3 } },
84 { Finley_Tri10, "Tri10", 10, 1, 1, { 0, 10 }, Finley_Tri3,
85 { 0, 1, 2 }, TriQuad, Tri10Shape, Tri10Shape,
86 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 },
87 10, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 },
88 10, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 },
89 { 1, 2, 0, 5, 6, 7, 8, 3, 4, 9 },
90 { 0, 2, 1, 8, 7, 6, 5, 4, 3, 9 } },
91 { Finley_Rec4, "Rec4", 4, 1, 1, { 0, 4 }, Finley_Rec4,
92 { 0, 1, 2, 3 }, RecQuad, Rec4Shape, Rec4Shape,
93 { 0, 1, 2, 3 },
94 4, { 0, 1, 2, 3 },
95 4, { 0, 1, 2, 3 },
96 { 1, 2, 3, 0 },
97 { 0, 3, 2, 1 } },
98 { Finley_Rec8, "Rec8", 8, 1, 1, { 0, 8 }, Finley_Rec4,
99 { 0, 1, 2, 3 }, RecQuad, Rec8Shape, Rec8Shape,
100 { 0, 1, 2, 3, 4, 5, 6, 7 },
101 8, { 0, 1, 2, 3, 4, 5, 6, 7 },
102 8, { 0, 1, 2, 3, 4, 5, 6, 7 },
103 { 1, 2, 3, 0, 5, 6, 7, 4 },
104 { 0, 3, 2, 1, 7, 6, 5, 4 } },
105 { Finley_Rec9, "Rec9", 9, 1, 1, { 0, 9 }, Finley_Rec4,
106 { 0, 1, 2, 3 }, RecQuad, Rec9Shape, Rec9Shape,
107 { 0, 1, 2, 3, 4, 5, 6, 7, 8 },
108 9, { 0, 1, 2, 3, 4, 5, 6, 7, 8 },
109 9, { 0, 1, 2, 3, 4, 5, 6, 7, 8 },
110 { 1, 2, 3, 0, 5, 6, 7, 4, 8 },
111 { 0, 3, 2, 1, 7, 6, 5, 4, 8 } },
112 { Finley_Rec12, "Rec12", 12, 1, 1, { 0, 12 }, Finley_Rec4,
113 { 0, 1, 2, 3 }, RecQuad, Rec12Shape, Rec12Shape,
114 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 },
115 12, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 },
116 12, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 },
117 { 1, 2, 3, 0, 6, 7, 8, 9, 10, 11, 4, 5 },
118 { 0, 3, 2, 1, 11, 10, 9, 8, 7, 6, 5, 4 } },
119 { Finley_Rec16, "Rec16", 16, 1, 1, { 0, 16 }, Finley_Rec4,
120 { 0, 1, 2, 3 }, RecQuad, Rec16Shape, Rec16Shape,
121 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
122 16, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
123 16, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
124 { 1, 2, 3, 0, 6, 7, 8, 9, 10, 11, 4, 5, 13, 14, 15, 12 },
125 { 0, 3, 2, 1, 11, 10, 9, 8, 7, 6, 5, 4, 12, 15, 14, 13 } },
126 { Finley_Tet4, "Tet4", 4, 1, 1, { 0, 4 }, Finley_Tet4,
127 { 0, 1, 2, 3 }, TetQuad, Tet4Shape, Tet4Shape,
128 { 0, 1, 2, 3 },
129 4, { 0, 1, 2, 3 },
130 4, { 0, 1, 2, 3 },
131 { -1 },
132 { -1 } },
133 { Finley_Tet10, "Tet10", 10, 1, 1, { 0, 10 }, Finley_Tet4,
134 { 0, 1, 2, 3 }, TetQuad, Tet10Shape, Tet10Shape,
135 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 },
136 10, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 },
137 10, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 },
138 { -1 },
139 { -1 } },
140 { Finley_Tet16, "Tet16", 16, 1, 1, { 0, 16 }, Finley_Tet4,
141 { 0, 1, 2, 3 }, TetQuad, Tet16Shape, Tet16Shape,
142 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
143 16, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
144 16, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
145 { -1 },
146 { -1 } },
147 { Finley_Hex8, "Hex8", 8, 1, 1, { 0, 8 }, Finley_Hex8,
148 { 0, 1, 2, 3, 4, 5, 6, 7 }, HexQuad, Hex8Shape, Hex8Shape,
149 { 0, 1, 2, 3, 4, 5, 6, 7 },
150 8, { 0, 1, 2, 3, 4, 5, 6, 7 },
151 8, { 0, 1, 2, 3, 4, 5, 6, 7 },
152 { -1 },
153 { -1 } },
154 { Finley_Hex20, "Hex20", 20, 1, 1, { 0, 20 }, Finley_Hex8,
155 { 0, 1, 2, 3, 4, 5, 6, 7 }, HexQuad, Hex20Shape, Hex20Shape,
156 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 },
157 20, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 },
158 20, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 },
159 { -1 },
160 { -1 } },
161 { Finley_Hex27, "Hex27", 27, 1, 1, { 0, 27 }, Finley_Hex8,
162 { 0, 1, 2, 3, 4, 5, 6, 7 }, HexQuad, Hex27Shape, Hex27Shape,
163 { 0, 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 },
164 27, { 0, 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 },
165 27, { 0, 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 },
166 { -1 },
167 { -1 } },
168 { Finley_Hex32, "Hex32", 32, 1, 1, { 0, 32 }, Finley_Hex8,
169 { 0, 1, 2, 3, 4, 5, 6, 7 }, HexQuad, Hex32Shape, Hex32Shape,
170 { 0, 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 },
171 32, { 0, 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 },
172 32, { 0, 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 },
173 { -1 },
174 { -1 } },
175 { Finley_Line2Face, "Line2Face", 2, 1, 1, { 0, 2 }, Finley_Line2Face,
176 { 0, 1 }, PointQuad, Line2Shape, Line2Shape,
177 { 0, 1 },
178 1, { 0 },
179 1, { 0 },
180 { 0, 1, 2 },
181 { -1 } },
182 { Finley_Line3Face, "Line3Face", 3, 1, 1, { 0, 3 }, Finley_Line2Face,
183 { 0, 1 }, PointQuad, Line3Shape, Line3Shape,
184 { 0, 1, 2 },
185 1, { 0 },
186 1, { 0 },
187 { 0, 1, 2 },
188 { -1 } },
189 { Finley_Line4Face, "Line4Face", 4, 1, 1, { 0, 4 }, Finley_Line2Face,
190 { 0, 1 }, PointQuad, Line4Shape, Line4Shape,
191 { 0, 1, 2, 3 },
192 1, { 0 },
193 1, { 0 },
194 { 0, 1, 2 },
195 { -1 } },
196 { Finley_Tri3Face, "Tri3Face", 3, 1, 1, { 0, 3 }, Finley_Tri3Face,
197 { 0, 1, 2 }, LineQuad, Tri3Shape, Tri3Shape,
198 { 0, 1, 2 },
199 2, { 0, 1 },
200 2, { 0, 1 },
201 { 1, 0, 2 },
202 { -1 } },
203 { Finley_Tri6Face, "Tri6Face", 6, 1, 1, { 0, 6 }, Finley_Tri3Face,
204 { 0, 1, 2 }, LineQuad, Tri6Shape, Tri6Shape,
205 { 0, 1, 2, 3, 4, 5 },
206 3, { 0, 1, 3 },
207 3, { 0, 1, 3 },
208 { 1, 0, 2, 3, 5, 4 },
209 { -1 } },
210 { Finley_Tri9Face, "Tri9Face", 9, 1, 1, { 0, 9 }, Finley_Tri3Face,
211 { 0, 1, 2 }, LineQuad, Tri9Shape, Tri9Shape,
212 { 0, 1, 2, 3, 4, 5, 6, 7, 8 },
213 4, { 0, 1, 3, 4 },
214 4, { 0, 1, 3, 4 },
215 { 1, 0, 2, 4, 3, 7, 8, 6, 5 },
216 { -1 } },
217 { Finley_Tri10Face, "Tri10Face", 10, 1, 1, { 0, 10 }, Finley_Tri3Face,
218 { 0, 1, 2 }, LineQuad, Tri10Shape, Tri10Shape,
219 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 },
220 4, { 0, 1, 3, 4 },
221 4, { 0, 1, 3, 4 },
222 { 1, 0, 2, 4, 3, 7, 8, 6, 5, 9 },
223 { -1 } },
224 { Finley_Rec4Face, "Rec4Face", 4, 1, 1, { 0, 4 }, Finley_Rec4Face,
225 { 0, 1, 2, 3 }, LineQuad, Rec4Shape, Rec4Shape,
226 { 0, 1, 2, 3 },
227 2, { 0, 1 },
228 2, { 0, 1 },
229 { 1, 0, 3, 2 },
230 { -1 } },
231 { Finley_Rec8Face, "Rec8Face", 8, 1, 1, { 0, 8 }, Finley_Rec4Face,
232 { 0, 1, 2, 3 }, LineQuad, Rec8Shape, Rec8Shape,
233 { 0, 1, 2, 3, 4, 5, 6, 7 },
234 3, { 0, 1, 4 },
235 3, { 0, 1, 4 },
236 { 1, 0, 3, 2, 4, 7, 6, 5 },
237 { -1 } },
238 { Finley_Rec9Face, "Rec9Face", 9, 1, 1, { 0, 9 }, Finley_Rec4Face,
239 { 0, 1, 2, 3 }, LineQuad, Rec9Shape, Rec9Shape,
240 { 0, 1, 2, 3, 4, 5, 6, 7, 8 },
241 3, { 0, 1, 4 },
242 3, { 0, 1, 4 },
243 { 1, 0, 3, 2, 4, 7, 6, 5, 8 },
244 { -1 } },
245 { Finley_Rec12Face, "Rec12Face", 12, 1, 1, { 0, 12 }, Finley_Rec4Face,
246 { 0, 1, 2, 3 }, LineQuad, Rec12Shape, Rec12Shape,
247 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 },
248 4, { 0, 1, 4, 5 },
249 4, { 0, 1, 4, 5 },
250 { 1, 0, 3, 2, 5, 4, 11, 10, 9, 8, 7, 6 },
251 { -1 } },
252 { Finley_Rec16Face, "Rec16Face", 16, 1, 1, { 0, 16 }, Finley_Rec4Face,
253 { 0, 1, 2, 3 }, LineQuad, Rec16Shape, Rec16Shape,
254 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
255 4, { 0, 1, 4, 5 },
256 4, { 0, 1, 4, 5 },
257 { 1, 0, 3, 2, 5, 4, 11, 10, 9, 8, 7, 6, 13, 12, 15, 14 },
258 { -1 } },
259 { Finley_Tet4Face, "Tet4Face", 4, 1, 1, { 0, 4 }, Finley_Tet4Face,
260 { 0, 1, 2, 3 }, TriQuad, Tet4Shape, Tet4Shape,
261 { 0, 1, 2, 3 },
262 3, { 0, 1, 2 },
263 4, { 0, 1, 2, 3 },
264 { 1, 2, 0, 3 },
265 { 0, 2, 1, 3 } },
266 { Finley_Tet10Face, "Tet10Face", 10, 1, 1, { 0, 10 }, Finley_Tet4Face,
267 { 0, 1, 2, 3 }, TriQuad, Tet10Shape, Tet10Shape,
268 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 },
269 6, { 0, 1, 2, 4, 5, 6 },
270 6, { 0, 1, 2, 4, 5, 6 },
271 { 1, 2, 0, 3, 5, 6, 4, 8, 9, 7 },
272 { 0, 2, 1, 3, 6, 7, 9, 8 } },
273 { Finley_Tet16Face, "Tet16Face", 16, 1, 1, { 0, 16 }, Finley_Tet4Face,
274 { 0, 1, 2, 3 }, TriQuad, Tet16Shape, Tet16Shape,
275 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
276 9, { 0, 1, 2, 4, 5, 6, 7, 8, 9 },
277 9, { 0, 1, 2, 4, 5, 6, 7, 8, 9 },
278 { 1, 2, 0, 3, 6, 7, 8, 9, 4, 5, 11, 12, 10, 14, 15, 13 },
279 { 0, 2, 1, 3, 9, 8, 7, 6, 5, 4, 9, 8, 7, 6, 10, 12, 11, 13, 15, 14 } },
280 { Finley_Hex8Face, "Hex8Face", 8, 1, 1, { 0, 8 }, Finley_Hex8Face,
281 { 0, 1, 2, 3, 4, 5, 6, 7 }, RecQuad, Hex8Shape, Hex8Shape,
282 { 0, 1, 2, 3, 4, 5, 6, 7 },
283 4, { 0, 1, 2, 3 },
284 4, { 0, 1, 2, 3 },
285 { 1, 2, 3, 0, 5, 6, 7, 4 },
286 { 0, 3, 2, 1, 4, 7, 6, 5 } },
287 { Finley_Hex20Face, "Hex20Face", 20, 1, 1, { 0, 20 }, Finley_Hex8Face,
288 { 0, 1, 2, 3, 4, 5, 6, 7 }, RecQuad, Hex20Shape, Hex20Shape,
289 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 },
290 8, { 0, 1, 2, 3, 8, 9, 10, 11 },
291 8, { 0, 1, 2, 3, 8, 9, 10, 11 },
292 { 1, 2, 3, 0, 5, 6, 7, 4, 9, 10, 11, 8, 13, 14, 15, 12, 17, 18, 19, 16 },
293 { 0, 3, 2, 1, 4, 7, 6, 5, 11, 10, 9, 8, 12, 15, 14, 13, 19, 18, 17, 16 } },
294 { Finley_Hex27Face, "Hex27Face", 27, 1, 1, { 0, 27 }, Finley_Hex8Face,
295 { 0, 1, 2, 3, 4, 5, 6, 7 }, RecQuad, Hex27Shape, Hex27Shape,
296 { 0, 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 },
297 9, { 0, 1, 2, 3, 8, 9, 10, 11, 20 },
298 9, { 0, 1, 2, 3, 8, 9, 10, 11, 20 },
299 { 1, 2, 3, 0, 5, 6, 7, 4, 9, 10, 11, 8, 13, 14, 15, 12, 17, 18, 19, 16, 20, 22, 23, 24, 22, 25, 26 },
300 { 0, 3, 2, 1, 4, 7, 6, 5, 11, 10, 9, 8, 12, 15, 14, 13, 19, 18, 17, 16, 20, 24, 23, 22, 21, 25, 26 } },
301 { Finley_Hex32Face, "Hex32Face", 32, 1, 1, { 0, 32 }, Finley_Hex8Face,
302 { 0, 1, 2, 3, 4, 5, 6, 7 }, RecQuad, Hex32Shape, Hex32Shape,
303 { 0, 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 },
304 12, { 0, 1, 2, 3, 8, 9, 10, 11, 12, 13, 14, 15 },
305 12, { 0, 1, 2, 3, 8, 9, 10, 11, 12, 13, 14, 15 },
306 { 1, 2, 3, 0, 5, 6, 7, 4, 10, 11, 12, 13, 14, 15, 8, 9, 17, 18, 19, 16, 21, 22, 23, 20, 26, 27, 28, 29, 30, 31, 34, 25 },
307 { 0, 3, 2, 1, 4, 7, 6, 5, 15, 14, 13, 12, 11, 10, 9, 8, 16, 19, 18, 17, 20, 23, 22, 21, 31, 30, 29, 28, 27, 26, 25, 24 } },
308 { Finley_Point1_Contact, "Point1_Contact", 2, 1, 2, { 0, 1, 2 }, Finley_Point1_Contact,
309 { 0, 1 }, PointQuad, Point1Shape, Point1Shape,
310 { 0, 1 },
311 1, { 0 },
312 -1, { -1 },
313 { -1 },
314 { -1 } },
315 { Finley_Line2_Contact, "Line2_Contact", 4, 1, 2, { 0, 2, 4 }, Finley_Line2_Contact,
316 { 0, 1, 2, 3 }, LineQuad, Line2Shape, Line2Shape,
317 { 0, 1, 2, 3 },
318 2, { 0, 1 },
319 -1, { -1 },
320 { -1 },
321 { -1 } },
322 { Finley_Line3_Contact, "Line3_Contact", 6, 1, 2, { 0, 3, 6 }, Finley_Line2_Contact,
323 { 0, 1, 3, 4 }, LineQuad, Line3Shape, Line3Shape,
324 { 0, 1, 2, 3, 4, 5 },
325 3, { 0, 1, 2 },
326 -1, { -1 },
327 { -1 },
328 { -1 } },
329 { Finley_Line4_Contact, "Line4_Contact", 8, 1, 2, { 0, 4, 8 }, Finley_Line2_Contact,
330 { 0, 1, 4, 5 }, LineQuad, Line4Shape, Line4Shape,
331 { 0, 1, 2, 3, 4, 5, 6, 7 },
332 4, { 0, 1, 2, 3 },
333 -1, { -1 },
334 { -1 },
335 { -1 } },
336 { Finley_Tri3_Contact, "Tri3_Contact", 6, 1, 2, { 0, 3, 6 }, Finley_Tri3_Contact,
337 { 0, 1, 2, 3, 4, 5 }, TriQuad, Tri3Shape, Tri3Shape,
338 { 0, 1, 2, 3, 4, 5 },
339 3, { 0, 1, 2 },
340 -1, { -1 },
341 { -1 },
342 { -1 } },
343 { Finley_Tri6_Contact, "Tri6_Contact", 12, 1, 2, { 0, 6, 12 }, Finley_Tri3_Contact,
344 { 0, 1, 2, 6, 7, 8 }, TriQuad, Tri6Shape, Tri6Shape,
345 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 },
346 6, { 0, 1, 2, 3, 4, 5 },
347 -1, { -1 },
348 { -1 },
349 { -1 } },
350 { Finley_Tri9_Contact, "Tri9_Contact", 18, 1, 2, { 0, 9, 18 }, Finley_Tri3_Contact,
351 { 0, 1, 2, 9, 10, 11 }, TriQuad, Tri9Shape, Tri9Shape,
352 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 },
353 9, { 0, 1, 2, 3, 4, 5, 6, 7, 8 },
354 -1, { -1 },
355 { -1 },
356 { -1 } },
357 { Finley_Tri10_Contact, "Tri10_Contact", 20, 1, 2, { 0, 10, 20 }, Finley_Tri3_Contact,
358 { 0, 1, 2, 10, 11, 12 }, TriQuad, Tri10Shape, Tri10Shape,
359 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 },
360 10, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 },
361 -1, { -1 },
362 { -1 },
363 { -1 } },
364 { Finley_Rec4_Contact, "Rec4_Contact", 8, 1, 2, { 0, 4, 8 }, Finley_Rec4_Contact,
365 { 0, 1, 2, 3, 4, 5, 6, 7 }, RecQuad, Rec4Shape, Rec4Shape,
366 { 0, 1, 2, 3, 4, 5, 6, 7 },
367 4, { 0, 1, 2, 3 },
368 -1, { -1 },
369 { -1 },
370 { -1 } },
371 { Finley_Rec8_Contact, "Rec8_Contact", 16, 1, 2, { 0, 8, 16 }, Finley_Rec4_Contact,
372 { 0, 1, 2, 3, 8, 9, 10, 11 }, RecQuad, Rec8Shape, Rec8Shape,
373 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
374 8, { 0, 1, 2, 3, 4, 5, 6, 7 },
375 -1, { -1 },
376 { -1 },
377 { -1 } },
378 { Finley_Rec9_Contact, "Rec9_Contact", 18, 1, 2, { 0, 9, 18 }, Finley_Rec4_Contact,
379 { 0, 1, 2, 3, 9, 10, 11, 12 }, RecQuad, Rec9Shape, Rec9Shape,
380 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 },
381 9, { 0, 1, 2, 3, 4, 5, 6, 7, 8 },
382 -1, { -1 },
383 { -1 },
384 { -1 } },
385 { Finley_Rec12_Contact, "Rec12_Contact", 24, 1, 2, { 0, 12, 24 }, Finley_Rec4_Contact,
386 { 0, 1, 2, 3, 12, 13, 14, 15 }, RecQuad, Rec12Shape, Rec12Shape,
387 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 },
388 12, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 },
389 -1, { -1 },
390 { -1 },
391 { -1 } },
392 { Finley_Rec16_Contact, "Rec16_Contact", 32, 1, 2, { 0, 16, 32 }, Finley_Rec4_Contact,
393 { 0, 1, 2, 3, 16, 17, 18, 19 }, RecQuad, Rec16Shape, Rec16Shape,
394 { 0, 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 },
395 16, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
396 -1, { -1 },
397 { -1 },
398 { -1 } },
399 { Finley_Line2Face_Contact, "Line2Face_Contact", 4, 1, 2, { 0, 2, 4 }, Finley_Line2Face_Contact,
400 { 0, 1, 2, 3 }, PointQuad, Line2Shape, Line2Shape,
401 { 0, 1, 2, 3 },
402 1, { 0 },
403 -1, { -1 },
404 { -1 },
405 { -1 } },
406 { Finley_Line3Face_Contact, "Line3Face_Contact", 6, 1, 2, { 0, 3, 6 }, Finley_Line2Face_Contact,
407 { 0, 1, 3, 4 }, PointQuad, Line3Shape, Line3Shape,
408 { 0, 1, 2, 3, 4, 5 },
409 1, { 0 },
410 -1, { -1 },
411 { -1 },
412 { -1 } },
413 { Finley_Line4Face_Contact, "Line4Face_Contact", 8, 1, 2, { 0, 4, 8 }, Finley_Line2Face_Contact,
414 { 0, 1, 4, 5 }, PointQuad, Line4Shape, Line4Shape,
415 { 0, 1, 2, 3, 4, 5, 6, 7 },
416 1, { 0 },
417 -1, { -1 },
418 { -1 },
419 { -1 } },
420 { Finley_Tri3Face_Contact, "Tri3Face_Contact", 6, 1, 2, { 0, 3, 6 }, Finley_Tri3Face_Contact,
421 { 0, 1, 2, 3, 4, 5 }, LineQuad, Tri3Shape, Tri3Shape,
422 { 0, 1, 2, 3, 4, 5 },
423 2, { 0, 1 },
424 -1, { -1 },
425 { -1 },
426 { -1 } },
427 { Finley_Tri6Face_Contact, "Tri6Face_Contact", 12, 1, 2, { 0, 6, 12 }, Finley_Tri3Face_Contact,
428 { 0, 1, 2, 6, 7, 8 }, LineQuad, Tri6Shape, Tri6Shape,
429 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 },
430 3, { 0, 1, 3 },
431 -1, { -1 },
432 { -1 },
433 { -1 } },
434 { Finley_Tri9Face_Contact, "Tri9Face_Contact", 18, 1, 2, { 0, 9, 18 }, Finley_Tri3Face_Contact,
435 { 0, 1, 2, 9, 10, 11 }, LineQuad, Tri9Shape, Tri9Shape,
436 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 },
437 4, { 0, 1, 3, 4 },
438 -1, { -1 },
439 { -1 },
440 { -1 } },
441 { Finley_Tri10Face_Contact, "Tri10Face_Contact", 20, 1, 2, { 0, 10, 20 }, Finley_Tri3Face_Contact,
442 { 0, 1, 2, 10, 11, 12 }, LineQuad, Tri10Shape, Tri10Shape,
443 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 },
444 4, { 0, 1, 3, 4 },
445 -1, { -1 },
446 { -1 },
447 { -1 } },
448 { Finley_Rec4Face_Contact, "Rec4Face_Contact", 8, 1, 2, { 0, 4, 8 }, Finley_Rec4Face_Contact,
449 { 0, 1, 2, 3, 4, 5, 6, 7 }, LineQuad, Rec4Shape, Rec4Shape,
450 { 0, 1, 2, 3, 4, 5, 6, 7 },
451 2, { 0, 1 },
452 -1, { -1 },
453 { -1 },
454 { -1 } },
455 { Finley_Rec8Face_Contact, "Rec8Face_Contact", 16, 1, 2, { 0, 8, 16 }, Finley_Rec4Face_Contact,
456 { 0, 1, 2, 3, 8, 9, 10, 11 }, LineQuad, Rec8Shape, Rec8Shape,
457 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
458 3, { 0, 1, 4 },
459 -1, { -1 },
460 { -1 },
461 { -1 } },
462 { Finley_Rec9Face_Contact, "Rec9Face_Contact", 18, 1, 2, { 0, 9, 18 }, Finley_Rec4Face_Contact,
463 { 0, 1, 2, 3, 9, 10, 11, 12 }, LineQuad, Rec9Shape, Rec9Shape,
464 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 },
465 3, { 0, 1, 4 },
466 -1, { -1 },
467 { -1 },
468 { -1 } },
469 { Finley_Rec12Face_Contact, "Rec12Face_Contact", 24, 1, 2, { 0, 12, 24 }, Finley_Rec4Face_Contact,
470 { 0, 1, 2, 3, 12, 13, 14, 15 }, LineQuad, Rec12Shape, Rec12Shape,
471 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 },
472 4, { 0, 1, 4, 5 },
473 -1, { -1 },
474 { -1 },
475 { -1 } },
476 { Finley_Rec16Face_Contact, "Rec16Face_Contact", 32, 1, 2, { 0, 16, 32 }, Finley_Rec4Face_Contact,
477 { 0, 1, 2, 3, 16, 17, 18, 19 }, LineQuad, Rec16Shape, Rec16Shape,
478 { 0, 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 },
479 4, { 0, 1, 4, 5 },
480 -1, { -1 },
481 { -1 },
482 { -1 } },
483 { Finley_Tet4Face_Contact, "Tet4Face_Contact", 8, 1, 2, { 0, 4, 8 }, Finley_Tet4Face_Contact,
484 { 0, 1, 2, 3, 4, 5, 6, 7 }, TriQuad, Tet4Shape, Tet4Shape,
485 { 0, 1, 2, 3, 4, 5, 6, 7 },
486 3, { 0, 1, 2 },
487 -1, { -1 },
488 { -1 },
489 { -1 } },
490 { Finley_Tet10Face_Contact, "Tet10Face_Contact", 20, 1, 2, { 0, 10, 20 }, Finley_Tet4Face_Contact,
491 { 0, 1, 2, 3, 10, 11, 12, 13 }, TriQuad, Tet10Shape, Tet10Shape,
492 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 },
493 6, { 0, 1, 2, 4, 5, 6 },
494 -1, { -1 },
495 { -1 },
496 { -1 } },
497 { Finley_Tet16Face_Contact, "Tet16Face_Contact", 32, 1, 2, { 0, 16, 32 }, Finley_Tet4Face_Contact,
498 { 0, 1, 2, 3, 16, 17, 18, 19 }, TriQuad, Tet16Shape, Tet16Shape,
499 { 0, 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 },
500 9, { 0, 1, 2, 4, 5, 6, 7, 8, 9 },
501 -1, { -1 },
502 { -1 },
503 { -1 } },
504 { Finley_Hex8Face_Contact, "Hex8Face_Contact", 16, 1, 2, { 0, 8, 16 }, Finley_Hex8Face_Contact,
505 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, RecQuad, Hex8Shape, Hex8Shape,
506 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
507 4, { 0, 1, 2, 3 },
508 -1, { -1 },
509 { -1 },
510 { -1 } },
511 { Finley_Hex20Face_Contact, "Hex20Face_Contact", 40, 1, 2, { 0, 20, 40 }, Finley_Hex8Face_Contact,
512 { 0, 1, 2, 3, 4, 5, 6, 7, 20, 21, 22, 23, 24, 25, 26, 27 }, RecQuad, Hex20Shape, Hex20Shape,
513 { 0, 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 },
514 8, { 0, 1, 2, 3, 8, 9, 10, 11 },
515 -1, { -1 },
516 { -1 },
517 { -1 } },
518 { Finley_Hex27Face_Contact, "Hex27Face_Contact", 54, 1, 2, { 0, 27, 54 }, Finley_Hex8Face_Contact,
519 { 0, 1, 2, 3, 4, 5, 6, 7, 27, 28, 29, 30, 31, 32, 33, 34 }, RecQuad, Hex27Shape, Hex27Shape,
520 { 0, 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 },
521 9, { 0, 1, 2, 3, 8, 9, 10, 11, 20 },
522 -1, { -1 },
523 { -1 },
524 { -1 } },
525 { Finley_Hex32Face_Contact, "Hex32Face_Contact", 64, 1, 2, { 0, 32, 64 }, Finley_Hex8Face_Contact,
526 { 0, 1, 2, 3, 4, 5, 6, 7, 32, 33, 34, 35, 36, 37, 38, 39 }, RecQuad, Hex32Shape, Hex32Shape,
527 { 0, 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 },
528 12, { 0, 1, 2, 3, 8, 9, 10, 11, 12, 13, 14, 15 },
529 -1, { -1 },
530 { -1 },
531 { -1 } },
532 { Finley_Line3Macro, "Line3Macro", 3, 2, 1, { 0, 3 }, Finley_Line2,
533 { 0, 1 }, LineQuad, Line3Shape, Line2Shape,
534 { 0, 2, 2, 1 },
535 3, { 0, 1, 2 },
536 3, { 0, 1, 2 },
537 { 1, 0, 2 },
538 { -1 } },
539 { Finley_Tri6Macro, "Tri6Macro", 6, 4, 1, { 0, 6 }, Finley_Tri3,
540 { 0, 1, 2 }, TriQuad, Tri6Shape, Tri3Shape,
541 { 0, 3, 5, 5, 4, 2, 3, 1, 4, 4, 5, 3},
542 6, { 0, 1, 2, 3, 4, 5 },
543 6, { 0, 1, 2, 3, 4, 5 },
544 { 1, 2, 0, 4, 5, 3 },
545 { 0, 2, 1, 5, 4, 3 } },
546 { Finley_Rec9Macro, "Rec9Macro", 9, 4, 1, { 0, 9 }, Finley_Rec4,
547 { 0, 1, 2, 3 }, RecQuad, Rec9Shape, Rec4Shape,
548 { 0, 4, 8, 7, 7, 8, 6, 3, 4, 1, 5, 8, 8, 5, 2, 6 },
549 9, { 0, 1, 2, 3, 4, 5, 6, 7, 8 },
550 9, { 0, 1, 2, 3, 4, 5, 6, 7, 8 },
551 { 1, 2, 3, 0, 5, 6, 7, 4, 8 },
552 { 0, 3, 2, 1, 7, 6, 5, 4, 8 } },
553 { Finley_Tet10Macro, "Tet10Macro", 10, 8, 1, { 0, 10 }, Finley_Tet4,
554 { 0, 1, 2, 3 }, TetQuad, Tet10Shape, Tet4Shape,
555 { 0, 4, 6, 7, 4, 1, 5, 8, 6, 5, 2, 9, 7, 8, 9, 3, 4, 5, 6, 8, 5, 9, 8, 6, 9, 7, 6, 8, 7, 4, 6, 8 },
556 10, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 },
557 10, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 },
558 { -1 },
559 { -1 } },
560 { Finley_Hex27Macro, "Hex27Macro", 27, 8, 1, { 0, 27 }, Finley_Hex8,
561 { 0, 1, 2, 3, 4, 5, 6, 7 }, HexQuad, Hex27Shape, Hex8Shape,
562 { 0, 8, 20, 11, 12, 21, 26, 24, 8, 1, 9, 20, 21, 13, 22, 26, 11, 20, 10, 3, 24, 26, 23, 15, 20, 9, 2, 10, 26, 22, 14, 23, 12, 21, 26, 24, 4, 16, 25, 19, 21, 13, 22, 26, 16, 5, 17, 25, 24, 26, 23, 15, 19, 25, 18, 7, 26, 22, 14, 23, 25, 17, 6, 18 },
563 27, { 0, 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 },
564 27, { 0, 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 },
565 { -1 },
566 { -1 } },
567 { Finley_NoRef, "noElement", 0, 0, 0, { 0 }, Finley_NoRef,
568 { 0 }, NoQuad, NoShape, NoShape,
569 { 0 },
570 -1, { 0 },
571 -1, { 0 },
572 { 0 },
573 { 0 } }
574
575 };
576 /************************************************************************************
577
578 creates a ReferenceElement of type id and a given integration order
579
580 */
581
582
583 Finley_ReferenceElement* Finley_ReferenceElement_alloc(Finley_ElementTypeId id, int order)
584 {
585 dim_t nsub, numQuadNodes, numQuadNodes2;
586 double *quadWeights=NULL, *quadNodes=NULL, *quadWeights2=NULL, *quadNodes2=NULL;
587 Finley_ReferenceElement *out=NULL;
588 Finley_QuadInfo* quadscheme;
589 Finley_ShapeFunctionInfo* parametrization, *basisfunction, *linearbasisfunction;
590 Finley_ReferenceElementInfo *type, *linear_type;
591
592 type=Finley_ReferenceElement_getInfo(id);
593 if (type == NULL) {
594 Finley_setError(VALUE_ERROR,"Finley_ReferenceElement_alloc: unable to identify element type.");
595 return NULL;
596 }
597 linear_type=Finley_ReferenceElement_getInfo(type->LinearTypeId);
598 if (linear_type == NULL) {
599 Finley_setError(VALUE_ERROR,"Finley_ReferenceElement_alloc: unable to identify linear element type.");
600 return NULL;
601 }
602
603
604
605 out=new Finley_ReferenceElement;
606 if (Finley_checkPtr(out)) return NULL;
607
608 out->reference_counter=0;
609 out->Parametrization=NULL;
610 out->BasisFunctions=NULL;
611 out->LinearBasisFunctions=NULL;
612 out->Type=type;
613 out->numNodes=out->Type->numNodes;
614 out->LinearType=linear_type;
615 out->numLinearNodes=out->LinearType->numNodes;
616 out->integrationOrder=-1;
617 out->DBasisFunctionDv=NULL;
618 out->DBasisFunctionDvShared=TRUE;
619
620 quadscheme=Finley_QuadInfo_getInfo(out->Type->Quadrature);
621 parametrization=Finley_ShapeFunction_getInfo(out->Type->Parametrization);
622 basisfunction=Finley_ShapeFunction_getInfo(out->Type->BasisFunctions);
623 linearbasisfunction=Finley_ShapeFunction_getInfo(Finley_ReferenceElement_InfoList[out->Type->LinearTypeId].BasisFunctions);
624 nsub=out->Type->numSubElements;
625 out->numLocalDim=quadscheme->numDim;
626
627
628 /* set up the basic integration scheme
629 note that quadscheme->numDim is not necessarily the dimension of the element
630 */
631
632 if (order<0) order=MAX(2*basisfunction->numOrder,0);
633 out->integrationOrder=order;
634
635 numQuadNodes=quadscheme->getNumQuadNodes(order);
636
637 quadNodes=new double[numQuadNodes*quadscheme->numDim*nsub];
638 quadWeights=new double[numQuadNodes*nsub];
639 if ( !( Finley_checkPtr(quadNodes) || Finley_checkPtr(quadWeights) ) ) {
640
641 quadscheme->getQuadNodes(numQuadNodes, quadNodes, quadWeights);
642
643 /* set the basis functions on the quadrature points:
644 * note: Finley_ShapeFunction_alloc will introduce 0. If the dimensions of the quadrature scheme and the dimension of the element don't match.
645 */
646
647
648 /*
649 * before we can set the shape function for the parametrization the quadrature scheme needs to be replicated :
650 */
651
652 if (nsub>1) {
653 out->DBasisFunctionDv=new double [numQuadNodes*nsub* (basisfunction->numShapes) * (basisfunction->numDim)];
654 out->DBasisFunctionDvShared=FALSE;
655
656 out->BasisFunctions=Finley_ShapeFunction_alloc(basisfunction->TypeId, quadscheme->numDim, numQuadNodes, quadNodes, quadWeights);
657 quadNodes2=new double[numQuadNodes*quadscheme->numDim*nsub];
658 quadWeights2=new double[numQuadNodes*nsub];
659 if ( !( Finley_checkPtr(quadNodes2) || Finley_checkPtr(quadWeights2) || Finley_checkPtr(out->DBasisFunctionDv)) ) {
660
661 numQuadNodes2=quadscheme->getMacro(nsub,out->BasisFunctions->numQuadNodes,
662 out->BasisFunctions->QuadNodes,
663 out->BasisFunctions->QuadWeights,
664 out->BasisFunctions->Type->numShapes, out->BasisFunctions->dSdv,
665 numQuadNodes*nsub, quadNodes2, quadWeights2,
666 out->DBasisFunctionDv);
667 if (Finley_noError()) {
668 out->Parametrization=Finley_ShapeFunction_alloc(parametrization->TypeId, quadscheme->numDim, numQuadNodes2, quadNodes2, quadWeights2);
669 out->LinearBasisFunctions=Finley_ShapeFunction_alloc(linearbasisfunction->TypeId, quadscheme->numDim, numQuadNodes2, quadNodes2, quadWeights2);
670 }
671
672 }
673 delete[] quadNodes2;
674 delete[] quadWeights2;
675
676 } else {
677 out->Parametrization=Finley_ShapeFunction_alloc(parametrization->TypeId, quadscheme->numDim, numQuadNodes*nsub, quadNodes, quadWeights);
678 out->BasisFunctions=Finley_ShapeFunction_alloc(basisfunction->TypeId, quadscheme->numDim, numQuadNodes, quadNodes, quadWeights);
679 out->LinearBasisFunctions=Finley_ShapeFunction_alloc(linearbasisfunction->TypeId, quadscheme->numDim, numQuadNodes, quadNodes, quadWeights);
680 out->DBasisFunctionDv=out->BasisFunctions->dSdv;
681 out->DBasisFunctionDvShared=TRUE;
682 }
683 }
684 delete[] quadNodes;
685 delete[] quadWeights;
686 if (Finley_noError()) {
687 return Finley_ReferenceElement_reference(out);
688 } else {
689 Finley_ReferenceElement_dealloc(out);
690 return NULL;
691 }
692 }
693
694 /************************************************************************************/
695
696 void Finley_ReferenceElement_dealloc(Finley_ReferenceElement* in) {
697 if (in!=NULL) {
698 in->reference_counter--;
699 if (in->reference_counter<1) {
700 Finley_ShapeFunction_dealloc(in->Parametrization);
701 Finley_ShapeFunction_dealloc(in->BasisFunctions);
702 Finley_ShapeFunction_dealloc(in->LinearBasisFunctions);
703 if (! in->DBasisFunctionDvShared) delete[] in->DBasisFunctionDv;
704 delete in;
705 }
706 }
707
708 }
709
710 /************************************************************************************/
711
712 Finley_ElementTypeId Finley_ReferenceElement_getTypeId(char* element_type) {
713 int ptr=0;
714 Finley_ElementTypeId out=Finley_NoRef;
715 while (Finley_ReferenceElement_InfoList[ptr].TypeId!=Finley_NoRef && out==Finley_NoRef) {
716 if (strcmp(element_type,Finley_ReferenceElement_InfoList[ptr].Name)==0) out=Finley_ReferenceElement_InfoList[ptr].TypeId;
717 ptr++;
718 }
719 return out;
720 }
721
722 Finley_ReferenceElement* Finley_ReferenceElement_reference(Finley_ReferenceElement* in) {
723 if (in!=NULL) ++(in->reference_counter);
724 return in;
725 }
726
727 Finley_ReferenceElementInfo* Finley_ReferenceElement_getInfo(Finley_ElementTypeId id)
728 {
729 int ptr=0;
730 Finley_ReferenceElementInfo* out=NULL;
731 while (Finley_ReferenceElement_InfoList[ptr].TypeId!=Finley_NoRef && out==NULL) {
732 if (Finley_ReferenceElement_InfoList[ptr].TypeId==id) out=&(Finley_ReferenceElement_InfoList[ptr]);
733 ptr++;
734 }
735 if (out==NULL) {
736 Finley_setError(VALUE_ERROR,"Finley_ReferenceElement_getInfo: cannot find requested reference element.");
737 }
738 return out;
739 }
740
741

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26