/[escript]/trunk/finley/src/BasisFunctions.c
ViewVC logotype

Contents of /trunk/finley/src/BasisFunctions.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2881 - (show annotations)
Thu Jan 28 02:03:15 2010 UTC (9 years, 10 months ago) by jfenwick
File MIME type: text/plain
File size: 22229 byte(s)
Don't panic.
Updating copyright stamps

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

  ViewVC Help
Powered by ViewVC 1.1.26