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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4327 - (show annotations)
Wed Mar 20 05:09:11 2013 UTC (6 years, 6 months ago) by jfenwick
File size: 22451 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
25 /************************************************************************************/
26
27 Finley_ReferenceElementInfo Finley_ReferenceElement_InfoList[]={
28 {Point1, "Point1", 0, 0, 1, 1, 1, 1,
29 Point1, {0},
30 Finley_Shape_Point1, Finley_Quad_getNodesPoint, Finley_Quad_getNumNodesPoint,
31 1,{0},
32 1,{0}, {0},{-1}},
33 {Line2, "Line2", 1, 1, 2, 2, 1, 2,
34 Line2, {0,1},
35 Finley_Shape_Line2, Finley_Quad_getNodesLine, Finley_Quad_getNumNodesLine,
36 2,{0,1},
37 2,{0,1}, {1,0},{-1}},
38
39 {Line3, "Line3", 1, 1, 3, 3, 2, 2,
40 Line2, {0,1},
41 Finley_Shape_Line3, Finley_Quad_getNodesLine, Finley_Quad_getNumNodesLine,
42 3,{0,1,2},
43 3,{0,1,2}, {1,0,2},{-1}},
44
45 {Line4, "Line4", 1, 1, 4, 4, 3, 2,
46 Line2, {0,1},
47 Finley_Shape_Line4, Finley_Quad_getNodesLine, Finley_Quad_getNumNodesLine,
48 4,{0,1,2,3},
49 4,{0,1,2,3}, {1,0,3,2},{-1}},
50 {Tri3, "Tri3", 2, 2, 3, 3, 1, 3,
51 Tri3, {0,1,2},
52 Finley_Shape_Tri3, Finley_Quad_getNodesTri, Finley_Quad_getNumNodesTri,
53 3,{0,1,2},
54 3,{0,1,2}, {1,2,0},{0,2,1}},
55 {Tri6, "Tri6", 2, 2, 6, 6, 2, 3,
56 Tri3, {0,1,2},
57 Finley_Shape_Tri6, Finley_Quad_getNodesTri, Finley_Quad_getNumNodesTri,
58 6,{0,1,2,3,4,5},
59 6,{0,1,2,3,4,5}, {1,2,0,4,5,3},{0,2,1,5,4,3}},
60 {Tri9, "Tri9", 2, 2, 9, 9, 3, 3,
61 Tri3, {0,1,2},
62 Finley_Shape_Tri9, Finley_Quad_getNodesTri, Finley_Quad_getNumNodesTri,
63 9,{0,1,2,3,4,5,6,7,8},
64 9,{0,1,2,3,4,5,6,7,8}, {1,2,0,5,6,7,8,3,4},{0,2,1,8,7,6,5,4,3}},
65 {Tri10, "Tri10", 2, 2, 10, 10, 3, 3,
66 Tri3, {0,1,2},
67 Finley_Shape_Tri10, Finley_Quad_getNodesTri, Finley_Quad_getNumNodesTri,
68 10,{0,1,2,3,4,5,6,7,8,9},
69 10,{0,1,2,3,4,5,6,7,8,9}, {1,2,0,5,6,7,8,3,4,9},{0,2,1,8,7,6,5,4,3,9}},
70 {Rec4, "Rec4", 2, 2, 4, 4, 1, 4,
71 Rec4, {0,1,2,3},
72 Finley_Shape_Rec4, Finley_Quad_getNodesRec, Finley_Quad_getNumNodesRec,
73 4,{0,1,2,3},
74 4,{0,1,2,3}, {1,2,3,0},{0,3,2,1}},
75 {Rec8, "Rec8", 2, 2, 8, 8, 2, 4,
76 Rec4, {0,1,2,3},
77 Finley_Shape_Rec8, Finley_Quad_getNodesRec, Finley_Quad_getNumNodesRec,
78 8,{0,1,2,3,4,5,6,7},
79 8,{0,1,2,3,4,5,6,7}, {1,2,3,0,5,6,7,4},{0,3,2,1,7,6,5,4}},
80 {Rec9, "Rec9", 2, 2, 9, 9, 2, 4,
81 Rec4, {0,1,2,3},
82 Finley_Shape_Rec9, Finley_Quad_getNodesRec, Finley_Quad_getNumNodesRec,
83 9,{0,1,2,3,4,5,6,7,8},
84 9,{0,1,2,3,4,5,6,7,8}, {1,2,3,0,5,6,7,4,8},{0,3,2,1,7,6,5,4,8}},
85 {Rec12, "Rec12", 2, 2, 12, 12, 3, 4,
86 Rec4, {0,1,2,3},
87 Finley_Shape_Rec12, Finley_Quad_getNodesRec, Finley_Quad_getNumNodesRec,
88 12,{0,1,2,3,4,5,6,7,8,9,10,11},
89 12,{0,1,2,3,4,5,6,7,8,9,10,11}, {1,2,3,0,6,7,8,9,10,11,4,5},{0,3,2,1,11,10,9,8,7,6,5,4}},
90 {Rec16, "Rec16", 2, 2, 16, 16, 3, 4,
91 Rec4, {0,1,2,3},
92 Finley_Shape_Rec16, Finley_Quad_getNodesRec, Finley_Quad_getNumNodesRec,
93 16,{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15},
94 16,{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}, {1,2,3,0,6,7,8,9,10,11,4,5,13,14,15,12},{0,3,2,1,11,10,9,8,7,6,5,4,12,15,14,13}},
95 {Tet4, "Tet4", 3, 3, 4, 4, 1, 4,
96 Tet4, {0,1,2,3},
97 Finley_Shape_Tet4, Finley_Quad_getNodesTet, Finley_Quad_getNumNodesTet,
98 4,{0,1,2,3},
99 -1,{999}, {999},{999}},
100 {Tet10, "Tet10", 3, 3, 10, 10, 2, 4,
101 Tet4, {0,1,2,3},
102 Finley_Shape_Tet10, Finley_Quad_getNodesTet, Finley_Quad_getNumNodesTet,
103 10,{0,1,2,3,4,5,6,7,8,9},
104 -1,{999}, {999},{999}},
105 {Tet16, "Tet16", 3, 3, 16, 16, 3, 4,
106 Tet4, {0,1,2,3},
107 Finley_Shape_Tet16, Finley_Quad_getNodesTet, Finley_Quad_getNumNodesTet,
108 16,{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15},
109 -1,{999}, {999},{999}},
110 {Hex8, "Hex8", 3, 3, 8, 8, 1, 8,
111 Hex8, {0,1,2,3,4,5,6,7},
112 Finley_Shape_Hex8, Finley_Quad_getNodesHex, Finley_Quad_getNumNodesHex,
113 8,{0,1,2,3,4,5,6,7},
114 -1,{999}, {999},{999}},
115 {Hex20, "Hex20", 3, 3, 20, 20, 2, 8,
116 Hex8, {0,1,2,3,4,5,6,7},
117 Finley_Shape_Hex20, Finley_Quad_getNodesHex, Finley_Quad_getNumNodesHex,
118 20,{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19},
119 -1,{999}, {999},{999}},
120 {Hex27, "Hex27", 3, 3, 27, 27, 2, 8,
121 Hex8, {0,1,2,3,4,5,6,7},
122 Finley_Shape_Hex27, Finley_Quad_getNodesHex, Finley_Quad_getNumNodesHex,
123 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},
124 -1,{999}, {999},{999}},
125 {Hex32, "Hex32", 3, 3, 32, 32, 3, 8,
126 Hex8, {0,1,2,3,4,5,6,7},
127 Finley_Shape_Hex32, Finley_Quad_getNodesHex, Finley_Quad_getNumNodesHex,
128 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},
129 -1,{999}, {999},{999}},
130 {Line2Face, "Line2Face", 0, 1, 2, 2, 1, 1,
131 Line2Face, {0,1},
132 Finley_Shape_Line2, Finley_Quad_getNodesPointOnFace, Finley_Quad_getNumNodesPoint,
133 1,{0},
134 1,{0}, {0,1,2},{-1}},
135 {Line3Face, "Line3Face", 0, 1, 3, 3, 2, 1,
136 Line2Face, {0,1},
137 Finley_Shape_Line3, Finley_Quad_getNodesPointOnFace, Finley_Quad_getNumNodesPoint,
138 1,{0},
139 1,{0}, {0,1,2},{-1}},
140 {Line4Face, "Line4Face", 0, 1, 4, 4, 3, 1,
141 Line2Face, {0,1},
142 Finley_Shape_Line4, Finley_Quad_getNodesPointOnFace, Finley_Quad_getNumNodesPoint,
143 1,{0},
144 1,{0}, {0,1,2},{-1}},
145 {Tri3Face, "Tri3Face", 1, 2, 3, 3, 1, 2,
146 Tri3Face, {0,1,2},
147 Finley_Shape_Tri3, Finley_Quad_getNodesLineOnFace, Finley_Quad_getNumNodesLine,
148 2,{0,1},
149 2,{0,1}, {1,0,2},{-1}},
150 {Tri6Face, "Tri6Face", 1, 2, 6, 6, 2, 2,
151 Tri3Face, {0,1,2},
152 Finley_Shape_Tri6, Finley_Quad_getNodesLineOnFace, Finley_Quad_getNumNodesLine,
153 3,{0,1,3},
154 3,{0,1,3}, {1,0,2,3,5,4},{-1}},
155 {Tri9Face, "Tri9Face", 1, 2, 9, 9, 3, 2,
156 Tri3Face, {0,1,2},
157 Finley_Shape_Tri9, Finley_Quad_getNodesLineOnFace, Finley_Quad_getNumNodesLine,
158 4,{0,1,3,4},
159 4,{0,1,3,4}, {1,0,2,4,3,7,8,6,5},{-1}},
160 {Tri10Face, "Tri10Face", 1, 2, 10, 10, 3, 2,
161 Tri3Face, {0,1,2},
162 Finley_Shape_Tri10, Finley_Quad_getNodesLineOnFace, Finley_Quad_getNumNodesLine,
163 4,{0,1,3,4},
164 4,{0,1,3,4}, {1,0,2,4,3,7,8,6,5,9},{-1}},
165 {Rec4Face, "Rec4Face", 1, 2, 4, 4, 1, 2,
166 Rec4Face, {0,1,2,3},
167 Finley_Shape_Rec4, Finley_Quad_getNodesLineOnFace, Finley_Quad_getNumNodesLine,
168 2,{0,1},
169 2,{0,1}, {1,0,3,2},{-1}},
170 {Rec8Face, "Rec8Face", 1, 2, 8, 8, 2, 2,
171 Rec4Face, {0,1,2,3},
172 Finley_Shape_Rec8, Finley_Quad_getNodesLineOnFace, Finley_Quad_getNumNodesLine,
173 3,{0,1,4},
174 3,{0,1,4}, {1,0,3,2,4,7,6,5},{-1}},
175 {Rec9Face, "Rec9Face", 1, 2, 9, 9, 2, 2,
176 Rec4Face, {0,1,2,3},
177 Finley_Shape_Rec9, Finley_Quad_getNodesLineOnFace, Finley_Quad_getNumNodesLine,
178 3,{0,1,4},
179 3,{0,1,4}, {1,0,3,2,4,7,6,5,8},{-1}},
180 {Rec12Face, "Rec12Face", 1, 2, 12, 12, 3, 2,
181 Rec4Face, {0,1,2,3},
182 Finley_Shape_Rec12, Finley_Quad_getNodesLineOnFace, Finley_Quad_getNumNodesLine,
183 4,{0,1,4,5},
184 4,{0,1,4,5}, {1,0,3,2,5,4,11,10,9,8,7,6},{-1}},
185 {Rec16Face, "Rec16Face", 1, 2, 16, 16, 3, 2,
186 Rec4Face, {0,1,2,3},
187 Finley_Shape_Rec16, Finley_Quad_getNodesLineOnFace, Finley_Quad_getNumNodesLine,
188 4,{0,1,4,5},
189 4,{0,1,4,5}, {1,0,3,2,5,4,11,10,9,8,7,6,13,12,15,14},{-1}},
190 {Tet4Face, "Tet4Face", 2, 3, 4, 4, 1, 3,
191 Tet4Face, {0,1,2,3},
192 Finley_Shape_Tet4, Finley_Quad_getNodesTriOnFace, Finley_Quad_getNumNodesTri,
193 3,{0,1,2},
194 3,{0,1,2}, {1,2,0,3},{0,2,1,3}},
195 {Tet10Face, "Tet10Face", 2, 3, 10, 10, 2, 3,
196 Tet4Face, {0,1,2,3},
197 Finley_Shape_Tet10, Finley_Quad_getNodesTriOnFace, Finley_Quad_getNumNodesTri,
198 4,{0,1,2,4,5,6},
199 4,{0,1,2,4,5,6}, {1,2,0,3,5,6,4,8,9,7},{0,2,1,3,6,7,9,8}},
200 {Tet16Face, "Tet16Face", 2, 3, 16, 16, 3, 3,
201 Tet4Face, {0,1,2,3},
202 Finley_Shape_Tet16, Finley_Quad_getNodesTriOnFace, Finley_Quad_getNumNodesTri,
203 5,{0,1,2,4,5,6,7,8,9},
204 5,{0,1,2,4,5,6,7,8,9}, {1,2,0,3,6,7,8,9,4,5,11,12,10,14,15,13},{0,2,1,3,9,8,7,6,5,4,9,8,7,6,10,12,11,13,15,14}},
205 {Hex8Face, "Hex8Face", 2, 3, 8, 8, 1, 4,
206 Hex8Face, {0,1,2,3,4,5,6,7},
207 Finley_Shape_Hex8, Finley_Quad_getNodesRecOnFace, Finley_Quad_getNumNodesRec,
208 4,{0,1,2,3},
209 4,{0,1,2,3}, {1,2,3,0,5,6,7,4},{0,3,2,1,4,7,6,5}},
210 {Hex20Face, "Hex20Face", 2, 3, 20, 20, 2, 4,
211 Hex8Face, {0,1,2,3,4,5,6,7},
212 Finley_Shape_Hex20, Finley_Quad_getNodesRecOnFace, Finley_Quad_getNumNodesRec,
213 8,{0,1,2,3,8,9,10,11},
214 8,{0,1,2,3,8,9,10,11}, {1,2,3,0,5,6,7,4,9,10,11,8,13,14,15,12,17,18,19,16},{0,3,2,1,4,7,6,5,11,10,9,8,12,15,14,13,19,18,17,16}},
215 {Hex27Face, "Hex27Face", 2, 3, 27, 27, 2, 4,
216 Hex8Face, {0,1,2,3,4,5,6,7},
217 Finley_Shape_Hex27, Finley_Quad_getNodesRecOnFace, Finley_Quad_getNumNodesRec,
218 9,{0,1,2,3,8,9,10,11,20},
219 9,{0,1,2,3,8,9,10,11,20}, {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},{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}},
220 {Hex32Face, "Hex32Face", 2, 3, 32, 32, 3, 4,
221 Hex8Face, {0,1,2,3,4,5,6,7},
222 Finley_Shape_Hex32, Finley_Quad_getNodesRecOnFace, Finley_Quad_getNumNodesRec,
223 12,{0,1,2,3,8,9,10,11,12,13,14,15},
224 12,{0,1,2,3,8,9,10,11,12,13,14,15},
225 {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},
226 {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}},
227
228 {Point1_Contact, "Point1_Contact", 0, 0, 2, 1, 1, 1,
229 Point1_Contact, {0,1},
230 Finley_Shape_Point1, Finley_Quad_getNodesPoint, Finley_Quad_getNumNodesPoint,
231 1,{0},
232 -1,{999}, {999},{999}},
233 {Line2_Contact, "Line2_Contact", 1, 1, 4, 2, 1, 2,
234 Line2_Contact, {0,1,2,3},
235 Finley_Shape_Line2, Finley_Quad_getNodesLine, Finley_Quad_getNumNodesLine,
236 2,{0,1},
237 -1,{999}, {999},{999}},
238 {Line3_Contact, "Line3_Contact", 1, 1, 6, 3, 2, 2,
239 Line2_Contact, {0,1,3,4},
240 Finley_Shape_Line3, Finley_Quad_getNodesLine, Finley_Quad_getNumNodesLine,
241 3,{0,1,2},
242 -1,{999}, {999},{999}},
243 {Line4_Contact, "Line4_Contact", 1, 1, 8, 4, 3, 2,
244 Line2_Contact, {0,1,4,5},
245 Finley_Shape_Line4, Finley_Quad_getNodesLine, Finley_Quad_getNumNodesLine,
246 4,{0,1,2,3},
247 -1,{999}, {999},{999}},
248 {Tri3_Contact, "Tri3_Contact", 2, 2, 6, 3, 1, 3,
249 Tri3_Contact, {0,1,2,3,4,5},
250 Finley_Shape_Tri3, Finley_Quad_getNodesTri, Finley_Quad_getNumNodesTri,
251 3,{0,1,2},
252 -1,{999}, {999},{999}},
253 {Tri6_Contact, "Tri6_Contact", 2, 2, 12, 6, 2, 3,
254 Tri3_Contact, {0,1,2,6,7,8},
255 Finley_Shape_Tri6, Finley_Quad_getNodesTri, Finley_Quad_getNumNodesTri,
256 6,{0,1,2,3,4,5},
257 -1,{999}, {999},{999}},
258 {Tri9_Contact, "Tri9_Contact", 2, 2, 18, 9, 3, 3,
259 Tri3_Contact, {0,1,2,9,10,11},
260 Finley_Shape_Tri9, Finley_Quad_getNodesTri, Finley_Quad_getNumNodesTri,
261 9,{0,1,2,3,4,5,6,7,8},
262 -1,{999}, {999},{999}},
263 {Tri10_Contact, "Tri10_Contact", 2, 2, 20, 10, 3, 3,
264 Tri3_Contact, {0,1,2,10,11,12},
265 Finley_Shape_Tri10, Finley_Quad_getNodesTri, Finley_Quad_getNumNodesTri,
266 10,{0,1,2,3,4,5,6,7,8,9},
267 -1,{999}, {999},{999}},
268 {Rec4_Contact, "Rec4_Contact", 2, 2, 8, 4, 1, 4,
269 Rec4_Contact, {0,1,2,3,4,5,6,7},
270 Finley_Shape_Rec4, Finley_Quad_getNodesRec, Finley_Quad_getNumNodesRec,
271 4,{0,1,2,3},
272 -1,{999}, {999},{999}},
273 {Rec8_Contact, "Rec8_Contact", 2, 2, 16, 8, 2, 4,
274 Rec4_Contact, {0,1,2,3,8,9,10,11},
275 Finley_Shape_Rec8, Finley_Quad_getNodesRec, Finley_Quad_getNumNodesRec,
276 8,{0,1,2,3,4,5,6,7},
277 -1,{999}, {999},{999}},
278 {Rec9_Contact, "Rec9_Contact", 2, 2, 18, 9, 2, 4,
279 Rec4_Contact, {0,1,2,3,9,10,11,12},
280 Finley_Shape_Rec9, Finley_Quad_getNodesRec, Finley_Quad_getNumNodesRec,
281 9,{0,1,2,3,4,5,6,7,8},
282 -1,{999}, {999},{999}},
283 {Rec12_Contact, "Rec12_Contact", 2, 2, 24, 12, 3, 4,
284 Rec4_Contact, {0,1,2,3,12,13,14,15},
285 Finley_Shape_Rec12, Finley_Quad_getNodesRec, Finley_Quad_getNumNodesRec,
286 12,{0,1,2,3,4,5,6,7,8,9,10,11},
287 -1,{999}, {999},{999}},
288 {Rec16_Contact, "Rec16_Contact", 2, 2, 32, 16, 3, 4,
289 Rec4_Contact, {0,1,2,3,16,17,18,19},
290 Finley_Shape_Rec16, Finley_Quad_getNodesRec, Finley_Quad_getNumNodesRec,
291 16,{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15},
292 -1,{999}, {999},{999}},
293 {Line2Face_Contact, "Line2Face_Contact", 0, 1, 4, 2, 1, 1,
294 Line2Face_Contact, {0,1,2,3},
295 Finley_Shape_Line2, Finley_Quad_getNodesPointOnFace, Finley_Quad_getNumNodesPoint,
296 1,{0},
297 -1,{999}, {999},{999}},
298 {Line3Face_Contact, "Line3Face_Contact", 0, 1, 6, 3, 2, 1,
299 Line2Face_Contact, {0,1,3,4},
300 Finley_Shape_Line3, Finley_Quad_getNodesPointOnFace, Finley_Quad_getNumNodesPoint,
301 1,{0},
302 -1,{999}, {999},{999}},
303 {Line4Face_Contact, "Line4Face_Contact", 0, 1, 8, 4, 3, 1,
304 Line2Face_Contact, {0,1,4,5},
305 Finley_Shape_Line4, Finley_Quad_getNodesPointOnFace, Finley_Quad_getNumNodesPoint,
306 1,{0},
307 -1,{999}, {999},{999}},
308 {Tri3Face_Contact, "Tri3Face_Contact", 1, 2, 6, 3, 1, 2,
309 Tri3Face_Contact, {0,1,2,3,4,5},
310 Finley_Shape_Tri3, Finley_Quad_getNodesLineOnFace, Finley_Quad_getNumNodesLine,
311 2,{0,1},
312 -1,{999}, {999},{999}},
313 {Tri6Face_Contact, "Tri6Face_Contact", 1, 2, 12, 6, 2, 2,
314 Tri3Face_Contact, {0,1,2,6,7,8},
315 Finley_Shape_Tri6, Finley_Quad_getNodesLineOnFace, Finley_Quad_getNumNodesLine,
316 3,{0,1,3},
317 -1,{999}, {999},{999}},
318 {Tri9Face_Contact, "Tri9Face_Contact", 1, 2, 18, 9, 3, 2,
319 Tri3Face_Contact, {0,1,2,9,10,11},
320 Finley_Shape_Tri9, Finley_Quad_getNodesLineOnFace, Finley_Quad_getNumNodesLine,
321 4,{0,1,3,4},
322 -1,{999}, {999},{999}},
323 {Tri10Face_Contact, "Tri10Face_Contact", 1, 2, 20, 10, 3, 2,
324 Tri3Face_Contact, {0,1,2,10,11,12},
325 Finley_Shape_Tri10, Finley_Quad_getNodesLineOnFace, Finley_Quad_getNumNodesLine,
326 4,{0,1,3,4},
327 -1,{999}, {999},{999}},
328 {Rec4Face_Contact, "Rec4Face_Contact", 1, 2, 8, 4, 1, 2,
329 Rec4Face_Contact, {0,1,2,3,4,5,6,7},
330 Finley_Shape_Rec4, Finley_Quad_getNodesLineOnFace, Finley_Quad_getNumNodesLine,
331 2,{0,1},
332 -1,{999}, {999},{999}},
333 {Rec8Face_Contact, "Rec8Face_Contact", 1, 2, 16, 8, 2, 2,
334 Rec4Face_Contact, {0,1,2,3,8,9,10,11},
335 Finley_Shape_Rec8, Finley_Quad_getNodesLineOnFace, Finley_Quad_getNumNodesLine,
336 3,{0,1,4},
337 -1,{999}, {999},{999}},
338 {Rec9Face_Contact, "Rec9Face_Contact", 1, 2, 18, 9, 2, 2,
339 Rec4Face_Contact, {0,1,2,3,9,10,11,12},
340 Finley_Shape_Rec9, Finley_Quad_getNodesLineOnFace, Finley_Quad_getNumNodesLine,
341 3,{0,1,4},
342 -1,{999}, {999},{999}},
343 {Rec12Face_Contact, "Rec12Face_Contact", 1, 2, 24, 12, 3, 2,
344 Rec4Face_Contact, {0,1,2,3,12,13,14,15},
345 Finley_Shape_Rec12, Finley_Quad_getNodesLineOnFace, Finley_Quad_getNumNodesLine,
346 4,{0,1,4,5},
347 -1,{999}, {999},{999}},
348 {Rec16Face_Contact, "Rec16Face_Contact", 1, 2, 32, 16, 3, 2,
349 Rec4Face_Contact, {0,1,2,3,16,17,18,19},
350 Finley_Shape_Rec16, Finley_Quad_getNodesLineOnFace, Finley_Quad_getNumNodesLine,
351 4,{0,1,4,5},
352 -1,{999}, {999},{999}},
353 {Tet4Face_Contact, "Tet4Face_Contact", 2, 3, 8, 4, 1, 3,
354 Tet4Face_Contact, {0,1,2,3,4,5,6,7},
355 Finley_Shape_Tet4, Finley_Quad_getNodesTriOnFace, Finley_Quad_getNumNodesTri,
356 3,{0,1,2},
357 -1,{999}, {999},{999}},
358 {Tet10Face_Contact, "Tet10Face_Contact", 2, 3, 20, 10, 2, 3,
359 Tet4Face_Contact, {0,1,2,3,10,11,12,13},
360 Finley_Shape_Tet10, Finley_Quad_getNodesTriOnFace, Finley_Quad_getNumNodesTri,
361 4,{0,1,2,4,5,6},
362 -1,{999}, {999},{999}},
363 {Tet16Face_Contact, "Tet16Face_Contact", 2, 3, 32, 16, 3, 3,
364 Tet4Face_Contact, {0,1,2,3,16,17,18,19},
365 Finley_Shape_Tet16, Finley_Quad_getNodesTriOnFace, Finley_Quad_getNumNodesTri,
366 5,{0,1,2,4,5,6,7,8,9},
367 -1,{999}, {999},{999}},
368 {Hex8Face_Contact, "Hex8Face_Contact", 2, 3, 16, 8, 1, 4,
369 Hex8Face_Contact, {0,1,2,3,4,5,6,7, 8,9,10,11,12,13,14,15},
370 Finley_Shape_Hex8, Finley_Quad_getNodesRecOnFace, Finley_Quad_getNumNodesRec,
371 4,{0,1,2,3},
372 -1,{999}, {999},{999}},
373 {Hex20Face_Contact, "Hex20Face_Contact", 2, 3, 40, 20, 2, 4,
374 Hex8Face_Contact, {0,1,2,3,4,5,6,7, 20,21,22,23,24,25,26,27},
375 Finley_Shape_Hex20, Finley_Quad_getNodesRecOnFace, Finley_Quad_getNumNodesRec,
376 8,{0,1,2,3,8,9,10,11},
377 -1,{999}, {999},{999}},
378 {Hex27Face_Contact, "Hex27Face_Contact", 2, 3, 54, 27, 2, 4,
379 Hex8Face_Contact, {0,1,2,3,4,5,6,7, 27,28,29,30,31,32,33,34},
380 Finley_Shape_Hex27, Finley_Quad_getNodesRecOnFace, Finley_Quad_getNumNodesRec,
381 9,{0,1,2,3,8,9,10,11,20},
382 -1,{999}, {999},{999}},
383 {Hex32Face_Contact, "Hex32Face_Contact", 2, 3, 64, 32, 3, 4,
384 Hex8Face_Contact, {0,1,2,3,4,5,6,7, 32,33,34,35,36,37,38,39},
385 Finley_Shape_Hex32, Finley_Quad_getNodesRecOnFace, Finley_Quad_getNumNodesRec,
386 12,{0,1,2,3,8,9,10,11,12,13,14,15},
387 -1,{999}, {999},{999}},
388
389 {Line3Macro, "Line3Macro", 1, 1, 3, 3, 2, 2,
390 Line2, {0,1},
391 Finley_Shape_Line3, Finley_Quad_getNodesLine, Finley_Quad_getNumNodesLine,
392 3,{0,1,2},
393 3,{0,1,2}, {1,0,2},{-1}},
394
395 {Tri6Macro, "Tri6Macro", 2, 2, 6, 6, 2, 3,
396 Tri3, {0,1,2},
397 Finley_Shape_Tri6, Finley_Quad_getNodesTri, Finley_Quad_getNumNodesTri,
398 6,{0,1,2,3,4,5},
399 6,{0,1,2,3,4,5}, {1,2,0,4,5,3},{0,2,1,5,4,3}},
400
401 {Rec9Macro, "Rec9Macro", 2, 2, 9, 9, 2, 4,
402 Rec4, {0,1,2,3},
403 Finley_Shape_Rec9, Finley_Quad_getNodesRec, Finley_Quad_getNumNodesRec,
404 9,{0,1,2,3,4,5,6,7,8},
405 9,{0,1,2,3,4,5,6,7,8}, {1,2,3,0,5,6,7,4,8},{0,3,2,1,7,6,5,4,8}},
406
407 {Tet10Macro, "Tet10Macro", 3, 3, 10, 10, 2, 4,
408 Tet4, {0,1,2,3},
409 Finley_Shape_Tet10, Finley_Quad_getNodesTet, Finley_Quad_getNumNodesTet,
410 10,{0,1,2,3,4,5,6,7,8,9},
411 -1,{999}, {999},{999}},
412
413 {Hex27Macro, "Hex27Macro", 3, 3, 27, 27, 2, 8,
414 Hex8, {0,1,2,3,4,5,6,7},
415 Finley_Shape_Hex27, Finley_Quad_getNodesHex, Finley_Quad_getNumNodesHex,
416 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},
417 -1,{999}, {999},{999}},
418
419 {NoType, "noElement", 0, 0, 0, 0, 0, 0, NoType, {999}, Finley_Shape_Point1, Finley_Quad_getNodesPoint, Finley_Quad_getNumNodesPoint,0,{999},-1,{999},{999},{999}} /* marks end of list */
420 };
421
422 /************************************************************************************/
423
424 /* get a quadrature scheme with NumQuadNodes quadrature nodes for the tri */
425 /* as a squeezed scheme on a quad [0,1]^2 */
426
427 Finley_ReferenceElement* Finley_ReferenceElement_alloc(ElementTypeId id,int numQuadNodes) {
428 Finley_ReferenceElement *out=NULL;
429 int Ndim, NS;
430
431 /* allocate the Finley_ReferenceElement to be returned: */
432
433 out=new Finley_ReferenceElement;
434 if (Finley_checkPtr(out)) return NULL;
435 out->Type=&(Finley_ReferenceElement_InfoList[id]);
436 out->numQuadNodes=numQuadNodes;
437 out->QuadNodes=NULL;
438 out->QuadWeights=NULL;
439 out->S=NULL;
440 out->dSdv=NULL;
441
442 /* allocate memory: */
443
444 Ndim=Finley_ReferenceElement_InfoList[id].numDim;
445 NS=Finley_ReferenceElement_InfoList[id].numShapes;
446 out->QuadNodes=new double[numQuadNodes*Ndim];
447 out->QuadWeights=new double[numQuadNodes];
448 out->S=new double[NS*numQuadNodes];
449 out->dSdv=new double[NS*Ndim*numQuadNodes];
450 if ( Finley_checkPtr(out->QuadNodes) || Finley_checkPtr(out->QuadWeights) || Finley_checkPtr(out->S) || Finley_checkPtr(out->dSdv) ) {
451 Finley_ReferenceElement_dealloc(out);
452 return NULL;
453 }
454
455 /* set the quadrature nodes: */
456
457 Finley_ReferenceElement_InfoList[id].getQuadNodes(numQuadNodes,out->QuadNodes,out->QuadWeights);
458 if (! Finley_noError()) {
459 Finley_ReferenceElement_dealloc(out);
460 return NULL;
461 }
462
463 /* eval shape functions on quadrature node: */
464
465 Finley_ReferenceElement_InfoList[id].getValues(numQuadNodes,out->QuadNodes,out->S,out->dSdv);
466 if (! Finley_noError()) {
467 Finley_ReferenceElement_dealloc(out);
468 return NULL;
469 }
470
471 /* all done: */
472
473 #ifdef Finley_TRACE
474 printf("reference element %s with %d quadrature nodes allocated.\n",Finley_ReferenceElement_InfoList[id].Name,numQuadNodes);
475 #endif
476 return out;
477 }
478
479 /************************************************************************************/
480
481 void Finley_ReferenceElement_dealloc(Finley_ReferenceElement* in) {
482 if (in!=NULL) {
483 #ifdef Finley_TRACE
484 printf("reference element %s is deallocated.\n",in->Type->Name);
485 #endif
486 delete[] in->QuadNodes;
487 delete[] in->QuadWeights;
488 delete[] in->S;
489 delete[] in->dSdv;
490 delete in;
491 }
492 }
493
494 /************************************************************************************/
495
496 ElementTypeId Finley_ReferenceElement_getTypeId(char* element_type) {
497 int ptr=0;
498 ElementTypeId out=NoType;
499 while (Finley_ReferenceElement_InfoList[ptr].TypeId!=NoType && out==NoType) {
500 if (strcmp(element_type,Finley_ReferenceElement_InfoList[ptr].Name)==0) out=Finley_ReferenceElement_InfoList[ptr].TypeId;
501 ptr++;
502 }
503 return out;
504 }

  ViewVC Help
Powered by ViewVC 1.1.26