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

Annotation of /trunk/finley/src/Quadrature.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2748 - (hide annotations)
Tue Nov 17 07:32:59 2009 UTC (9 years, 9 months ago) by gross
File MIME type: text/plain
File size: 68021 byte(s)
Macro elements are implemented now. VTK writer for macro elements still needs testing.
1 jgs 82
2 ksteube 1312 /*******************************************************
3 ksteube 1811 *
4 jfenwick 2548 * Copyright (c) 2003-2009 by University of Queensland
5 ksteube 1811 * 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 jgs 82
14 ksteube 1811
15 jgs 82 /**************************************************************/
16    
17 gross 2748 /* Finley: quadrature schemes */
18 jgs 82
19     /**************************************************************/
20    
21     #include "Quadrature.h"
22    
23 gross 2748
24 jgs 82 #define QUADNODES(_K_,_I_) quadNodes[INDEX2(_K_,_I_,DIM)]
25     #define QUADWEIGHTS(_I_) quadWeights[_I_]
26    
27     /**************************************************************/
28    
29 gross 2748 Finley_QuadInfo Finley_QuadInfoList[]={
30     {PointQuad, "Point", 0, 1, Finley_Quad_getNodesPoint, Finley_Quad_getNumNodesPoint, Finley_Quad_MacroPoint} ,
31     {LineQuad, "Line", 1, 2, Finley_Quad_getNodesLine, Finley_Quad_getNumNodesLine, Finley_Quad_MacroLine} ,
32     {TriQuad, "Tri", 2, 3, Finley_Quad_getNodesTri, Finley_Quad_getNumNodesTri, Finley_Quad_MacroTri},
33     {RecQuad, "Rec", 2, 4, Finley_Quad_getNodesRec, Finley_Quad_getNumNodesRec, Finley_Quad_MacroRec},
34     {TetQuad, "Tet", 3, 4, Finley_Quad_getNodesTet, Finley_Quad_getNumNodesTet, Finley_Quad_MacroTet},
35     {HexQuad, "Hex", 3, 8, Finley_Quad_getNodesHex, Finley_Quad_getNumNodesHex, Finley_Quad_MacroHex},
36     {NoQuad, "NoType", 0, 1, Finley_Quad_getNodesPoint, Finley_Quad_getNumNodesPoint, Finley_Quad_MacroPoint}
37     };
38    
39     Finley_QuadInfo* Finley_QuadInfo_getInfo(Finley_QuadTypeId id)
40     {
41     int ptr=0;
42     Finley_QuadInfo* out=NULL;
43     while (Finley_QuadInfoList[ptr].TypeId!=NoQuad && out==NULL) {
44     if (Finley_QuadInfoList[ptr].TypeId==id) out=&(Finley_QuadInfoList[ptr]);
45     ptr++;
46     }
47     if (out==NULL) {
48     Finley_setError(VALUE_ERROR,"Finley_QuadInfo_getInfo: canot find requested quadrature scheme.");
49     }
50     return out;
51     }
52    
53     /**************************************************************/
54    
55 jgs 82 /* get a quadrature scheme with numQuadNodes quadrature nodes for the tri */
56     /* as a queezed scheme on a quad [0,1]^2 */
57    
58     void Finley_Quad_getNodesTri(int numQuadNodes,double* quadNodes,double* quadWeights) {
59     int i;
60 gross 1342 double Q1,Q2,a,b,c,d,e,f,g,u,v,w;
61 jgs 82 #define DIM 2
62    
63 btully 1170 /* the easy cases: */
64 jgs 82
65     if (numQuadNodes==1) {
66     QUADNODES(0,0)=1./3.;
67     QUADNODES(1,0)=1./3.;
68 btully 1170 QUADWEIGHTS(0)=1./2.;
69     } else if (numQuadNodes==3){
70     QUADNODES(0,0)=1./2.;
71     QUADNODES(1,0)=0.;
72     QUADWEIGHTS(0)=1./6.;
73     QUADNODES(0,1)=0.;
74     QUADNODES(1,1)=1./2.;
75     QUADWEIGHTS(1)=1./6.;
76     QUADNODES(0,2)=1./2.;
77     QUADNODES(1,2)=1./2.;
78     QUADWEIGHTS(2)=1./6.;
79     } else if (numQuadNodes==4){
80     QUADNODES(0,0)=1./3.;
81     QUADNODES(1,0)=1./3.;
82     QUADWEIGHTS(0)=-27./96.;
83     QUADNODES(0,1)=0.2;
84     QUADNODES(1,1)=0.2;
85     QUADWEIGHTS(1)=25./96.;
86     QUADNODES(0,2)=0.6;
87     QUADNODES(1,2)=0.2;
88     QUADWEIGHTS(2)=25./96.;
89     QUADNODES(0,3)=0.2;
90     QUADNODES(1,3)=0.6;
91     QUADWEIGHTS(3)=25./96.;
92 gross 1342 } else if (numQuadNodes==6){
93     QUADWEIGHTS(0) = 0.109951743655322/2.;
94     QUADWEIGHTS(1) = 0.109951743655322/2.;
95     QUADWEIGHTS(2) = 0.109951743655322/2.;
96     QUADWEIGHTS(3) = 0.223381589678011/2.;
97     QUADWEIGHTS(4) = 0.223381589678011/2.;
98     QUADWEIGHTS(5) = 0.223381589678011/2.;
99    
100     QUADNODES(0,0) = 0.816847572980459;
101     QUADNODES(0,1) = 0.091576213509771;
102     QUADNODES(0,2) = 0.091576213509771;
103     QUADNODES(0,3) = 0.108103018168070;
104     QUADNODES(0,4) = 0.445948490915965;
105     QUADNODES(0,5) = 0.445948490915965;
106    
107     QUADNODES(1,0) = 0.091576213509771;
108     QUADNODES(1,1) = 0.816847572980459;
109     QUADNODES(1,2) = 0.091576213509771;
110     QUADNODES(1,3) = 0.445948490915965;
111     QUADNODES(1,4) = 0.108103018168070;
112     QUADNODES(1,5) = 0.445948490915965;
113    
114     } else if (numQuadNodes==7){
115     QUADNODES(0,0) = 0.33333333333333333;
116     QUADNODES(0,1) = 0.7974269853530872;
117     QUADNODES(0,2) = 0.10128650732345633;
118     QUADNODES(0,3) = 0.10128650732345633;
119     QUADNODES(0,4) = 0.059715871789769809;
120     QUADNODES(0,5) = 0.47014206410511505;
121     QUADNODES(0,6) = 0.47014206410511505;
122    
123     QUADNODES(1,0) = 0.33333333333333333;
124     QUADNODES(1,1) = 0.10128650732345633;
125     QUADNODES(1,2) = 0.7974269853530872;
126     QUADNODES(1,3) = 0.10128650732345633;
127     QUADNODES(1,4) = 0.47014206410511505;
128     QUADNODES(1,5) = 0.059715871789769809;
129     QUADNODES(1,6) = 0.47014206410511505;
130    
131     QUADWEIGHTS(0) = 0.225/2.;
132     QUADWEIGHTS(1) = 0.12593918054482717/2.;
133     QUADWEIGHTS(2) = 0.12593918054482717/2.;
134     QUADWEIGHTS(3) = 0.12593918054482717/2.;
135     QUADWEIGHTS(4) = 0.13239415278850616/2.;
136     QUADWEIGHTS(5) = 0.13239415278850616/2.;
137     QUADWEIGHTS(6) = 0.13239415278850616/2.;
138    
139     } else if (numQuadNodes==12){
140     a = 0.873821971016996;
141     b = 0.063089014491502;
142     c = 0.501426509658179;
143     d = 0.249286745170910;
144     e = 0.636502499121399;
145     f = 0.310352451033785;
146     g = 0.053145049844816;
147    
148     u = 0.050844906370207/2.;
149     v = 0.116786275726379/2.;
150     w = 0.082851075618374/2.;
151    
152     QUADNODES(0,0) = a;
153     QUADNODES(0,1) = b;
154     QUADNODES(0,2) = b;
155     QUADNODES(0,3) = c;
156     QUADNODES(0,4) = d;
157     QUADNODES(0,5) = d;
158     QUADNODES(0,6) = e;
159     QUADNODES(0,7) = e;
160     QUADNODES(0,8) = f;
161     QUADNODES(0,9) = f;
162     QUADNODES(0,10) = g;
163     QUADNODES(0,11) = g;
164    
165     QUADNODES(1,0) = b;
166     QUADNODES(1,1) = a;
167     QUADNODES(1,2) = b;
168     QUADNODES(1,3) = d;
169     QUADNODES(1,4) = c;
170     QUADNODES(1,5) = d;
171     QUADNODES(1,6) = f;
172     QUADNODES(1,7) = g;
173     QUADNODES(1,8) = e;
174     QUADNODES(1,9) = g;
175     QUADNODES(1,10) = e;
176     QUADNODES(1,11) = f;
177    
178     QUADWEIGHTS(0)= u;
179     QUADWEIGHTS(1)= u;
180     QUADWEIGHTS(2)= u;
181     QUADWEIGHTS(3)= v;
182     QUADWEIGHTS(4)= v;
183     QUADWEIGHTS(5)= v;
184     QUADWEIGHTS(6)= w;
185     QUADWEIGHTS(7)= w;
186     QUADWEIGHTS(8)= w;
187     QUADWEIGHTS(9)= w;
188     QUADWEIGHTS(10)= w;
189     QUADWEIGHTS(11)= w;
190    
191     } else if (numQuadNodes==13){
192     QUADWEIGHTS(0) =-0.149570044467670/2.;
193     QUADWEIGHTS(1) = 0.175615257433204/2.;
194     QUADWEIGHTS(2) = 0.175615257433204/2.;
195     QUADWEIGHTS(3) = 0.175615257433204/2.;
196     QUADWEIGHTS(4) = 0.053347235608839/2.;
197     QUADWEIGHTS(5) = 0.053347235608839/2.;
198     QUADWEIGHTS(6) = 0.053347235608839/2.;
199     QUADWEIGHTS(7) = 0.077113760890257/2.;
200     QUADWEIGHTS(8) = 0.077113760890257/2.;
201     QUADWEIGHTS(9) = 0.077113760890257/2.;
202     QUADWEIGHTS(10) = 0.077113760890257/2.;
203     QUADWEIGHTS(11) = 0.077113760890257/2.;
204     QUADWEIGHTS(12) = 0.077113760890257/2.;
205    
206     QUADNODES(0,0) = 0.3333333333333333;
207     QUADNODES(0,1) = 0.479308067841923;
208     QUADNODES(0,2) = 0.260345966079038;
209     QUADNODES(0,3) = 0.260345966079038;
210     QUADNODES(0,4) = 0.869739794195568;
211     QUADNODES(0,5) = 0.065130102902216;
212     QUADNODES(0,6) = 0.065130102902216;
213     QUADNODES(0,7) = 0.638444188569809;
214     QUADNODES(0,8) = 0.638444188569809;
215     QUADNODES(0,9) = 0.048690315425316;
216     QUADNODES(0,10) = 0.048690315425316;
217     QUADNODES(0,11) = 0.312865496004875;
218     QUADNODES(0,12) = 0.312865496004875;
219    
220     QUADNODES(1,0) = 0.3333333333333333;
221     QUADNODES(1,1) = 0.260345966079038;
222     QUADNODES(1,2) = 0.479308067841923;
223     QUADNODES(1,3) = 0.260345966079038;
224     QUADNODES(1,4) = 0.065130102902216;
225     QUADNODES(1,5) = 0.869739794195568;
226     QUADNODES(1,6) = 0.065130102902216;
227     QUADNODES(1,7) = 0.048690315425316;
228     QUADNODES(1,8) = 0.312865496004875;
229     QUADNODES(1,9) = 0.638444188569809;
230     QUADNODES(1,10) = 0.312865496004875;
231     QUADNODES(1,11) = 0.638444188569809;
232     QUADNODES(1,12) = 0.048690315425316;
233    
234     } else if (numQuadNodes==16){
235     QUADWEIGHTS(0) = 0.07215780;
236     QUADWEIGHTS(1) = 0.04754582;
237     QUADWEIGHTS(2) = 0.04754582;
238     QUADWEIGHTS(3) = 0.04754582;
239     QUADWEIGHTS(4) = 0.01622925;
240     QUADWEIGHTS(5) = 0.01622925;
241     QUADWEIGHTS(6) = 0.01622925;
242     QUADWEIGHTS(7) = 0.05160869;
243     QUADWEIGHTS(8) = 0.05160869;
244     QUADWEIGHTS(9) = 0.05160869;
245     QUADWEIGHTS(10) = 0.01361516;
246     QUADWEIGHTS(11) = 0.01361516;
247     QUADWEIGHTS(12) = 0.01361516;
248     QUADWEIGHTS(13) = 0.01361516;
249     QUADWEIGHTS(14) = 0.01361516;
250     QUADWEIGHTS(15) = 0.01361516;
251    
252     QUADNODES(0,0) = 0.3333333;
253     QUADNODES(0,1) = 0.08141482;
254     QUADNODES(0,2) = 0.4592926;
255     QUADNODES(0,3) = 0.4592926;
256     QUADNODES(0,4) = 0.8989055;
257     QUADNODES(0,5) = 0.05054723;
258     QUADNODES(0,6) = 0.05054723;
259     QUADNODES(0,7) = 0.6588614;
260     QUADNODES(0,8) = 0.1705693;
261     QUADNODES(0,9) = 0.1705693;
262     QUADNODES(0,10) = 0.008394777;
263     QUADNODES(0,11) = 0.008394777;
264     QUADNODES(0,12) = 0.7284924;
265     QUADNODES(0,13) = 0.7284924;
266     QUADNODES(0,14) = 0.2631128;
267     QUADNODES(0,15) = 0.2631128;
268    
269     QUADNODES(1,0) = 0.3333333;
270     QUADNODES(1,1) = 0.4592926;
271     QUADNODES(1,2) = 0.08141482;
272     QUADNODES(1,3) = 0.4592926;
273     QUADNODES(1,4) = 0.05054723;
274     QUADNODES(1,5) = 0.8989055;
275     QUADNODES(1,6) = 0.05054723;
276     QUADNODES(1,7) = 0.1705693;
277     QUADNODES(1,8) = 0.6588614;
278     QUADNODES(1,9) = 0.1705693;
279     QUADNODES(1,10) = 0.7284924;
280     QUADNODES(1,11) = 0.2631128;
281     QUADNODES(1,12) = 0.008394777;
282     QUADNODES(1,13) = 0.2631128;
283     QUADNODES(1,14) = 0.008394777;
284     QUADNODES(1,15) = 0.7284924;
285    
286     } else if (numQuadNodes==19){
287     QUADWEIGHTS(0) = 0.04856790;
288     QUADWEIGHTS(1) = 0.01566735;
289     QUADWEIGHTS(2) = 0.01566735;
290     QUADWEIGHTS(3) = 0.01566735;
291     QUADWEIGHTS(4) = 0.03891377;
292     QUADWEIGHTS(5) = 0.03891377;
293     QUADWEIGHTS(6) = 0.03891377;
294     QUADWEIGHTS(7) = 0.03982387;
295     QUADWEIGHTS(8) = 0.03982387;
296     QUADWEIGHTS(9) = 0.03982387;
297     QUADWEIGHTS(10) = 0.01278884;
298     QUADWEIGHTS(11) = 0.01278884;
299     QUADWEIGHTS(12) = 0.01278884;
300     QUADWEIGHTS(13) = 0.02164177;
301     QUADWEIGHTS(14) = 0.02164177;
302     QUADWEIGHTS(15) = 0.02164177;
303     QUADWEIGHTS(16) = 0.02164177;
304     QUADWEIGHTS(17) = 0.02164177;
305     QUADWEIGHTS(18) = 0.02164177;
306    
307     QUADNODES(0,0) = 0.3333333;
308     QUADNODES(0,1) = 0.02063496;
309     QUADNODES(0,2) = 0.4896825;
310     QUADNODES(0,3) = 0.4896825;
311     QUADNODES(0,4) = 0.1258208;
312     QUADNODES(0,5) = 0.4370896;
313     QUADNODES(0,6) = 0.4370896;
314     QUADNODES(0,7) = 0.6235929;
315     QUADNODES(0,8) = 0.1882035;
316     QUADNODES(0,9) = 0.1882035;
317     QUADNODES(0,10) = 0.9105410;
318     QUADNODES(0,11) = 0.04472951;
319     QUADNODES(0,12) = 0.04472951;
320     QUADNODES(0,13) = 0.03683841;
321     QUADNODES(0,14) = 0.03683841;
322     QUADNODES(0,15) = 0.7411986;
323     QUADNODES(0,16) = 0.7411986;
324     QUADNODES(0,17) = 0.2219630;
325     QUADNODES(0,18) = 0.2219630;
326    
327     QUADNODES(1,0) = 0.3333333;
328     QUADNODES(1,1) = 0.4896825;
329     QUADNODES(1,2) = 0.02063496;
330     QUADNODES(1,3) = 0.4896825;
331     QUADNODES(1,4) = 0.4370896;
332     QUADNODES(1,5) = 0.1258208;
333     QUADNODES(1,6) = 0.4370896;
334     QUADNODES(1,7) = 0.1882035;
335     QUADNODES(1,8) = 0.6235929;
336     QUADNODES(1,9) = 0.1882035;
337     QUADNODES(1,10) = 0.04472951;
338     QUADNODES(1,11) = 0.9105410;
339     QUADNODES(1,12) = 0.04472951;
340     QUADNODES(1,13) = 0.7411986;
341     QUADNODES(1,14) = 0.2219630;
342     QUADNODES(1,15) = 0.03683841;
343     QUADNODES(1,16) = 0.2219630;
344     QUADNODES(1,17) = 0.03683841;
345     QUADNODES(1,18) = 0.7411986;
346 jgs 82 } else {
347    
348     /* get scheme on [0.1]^2 */
349     Finley_Quad_getNodesRec(numQuadNodes,quadNodes,quadWeights);
350 jgs 150 if (! Finley_noError()) return;
351 jgs 82
352     /* squeeze it: */
353    
354     for (i=0;i<numQuadNodes;i++) {
355     Q1=QUADNODES(0,i);
356     Q2=QUADNODES(1,i);
357     QUADWEIGHTS(i)=QUADWEIGHTS(i)*(1.-(1./2.)*(Q1+Q2));
358     QUADNODES(0,i)=Q1*(1.-(1./2.)*Q2);
359     QUADNODES(1,i)=Q2*(1.-(1./2.)*Q1);
360     }
361     }
362     #undef DIM
363 gross 1342
364    
365 jgs 82 }
366    
367     /**************************************************************/
368    
369     /* get a quadrature scheme with numQuadNodes quadrature nodes for the tet */
370     /* as a queezed scheme on a hex [0,1]^3 */
371    
372     void Finley_Quad_getNodesTet(int numQuadNodes,double* quadNodes,double* quadWeights) {
373     int i;
374     double Q1,Q2,Q3,JA11,JA12,JA13,JA21,JA22,JA23,JA31,JA32,JA33,DET;
375 gross 1342 double a,b,c,d,e,f,g,h;
376     double alpha=0.58541019662496852;
377     double beta =0.1381966011250105;
378 jgs 82 #define DIM 3
379    
380 btully 1170 /* the easy cases: */
381 jgs 82 if (numQuadNodes==1) {
382 btully 1170 QUADNODES(0,0)=0.25;
383     QUADNODES(1,0)=0.25;
384     QUADNODES(2,0)=0.25;
385 jgs 82 QUADWEIGHTS(0)=1./6.;
386 btully 1170 } else if (numQuadNodes==4){
387     QUADNODES(0,0)=beta;
388     QUADNODES(1,0)=beta;
389     QUADNODES(2,0)=beta;
390     QUADWEIGHTS(0)=1./24.;
391     QUADNODES(0,1)=alpha;
392     QUADNODES(1,1)=beta;
393     QUADNODES(2,1)=beta;
394     QUADWEIGHTS(1)=1./24.;
395     QUADNODES(0,2)=beta;
396     QUADNODES(1,2)=alpha;
397     QUADNODES(2,2)=beta;
398     QUADWEIGHTS(2)=1./24.;
399     QUADNODES(0,3)=beta;
400     QUADNODES(1,3)=beta;
401     QUADNODES(2,3)=alpha;
402     QUADWEIGHTS(3)=1./24.;
403     } else if (numQuadNodes==5){
404     QUADNODES(0,0)=1./4.;
405     QUADNODES(1,0)=1./4.;
406     QUADNODES(2,0)=1./4.;
407     QUADWEIGHTS(0)=-2./15.;
408     QUADNODES(0,1)=1./6.;
409     QUADNODES(1,1)=1./6.;
410     QUADNODES(2,1)=1./6.;
411     QUADWEIGHTS(1)=3./40.;
412     QUADNODES(0,2)=1./2.;
413     QUADNODES(1,2)=1./6.;
414     QUADNODES(2,2)=1./6.;
415     QUADWEIGHTS(2)=3./40.;
416     QUADNODES(0,3)=1./6.;
417     QUADNODES(1,3)=1./2.;
418     QUADNODES(2,3)=1./6.;
419     QUADWEIGHTS(3)=3./40.;
420     QUADNODES(0,4)=1./6.;
421     QUADNODES(1,4)=1./6.;
422     QUADNODES(2,4)=1./2.;
423     QUADWEIGHTS(4)=3./40.;
424 gross 1342
425     } else if (numQuadNodes==11){
426    
427     a = 0.25;
428     b = 11.0/14.0;
429     c = 1.0/14.0;
430     d = 0.25 * (1.0 + sqrt ( 5.0 / 14.0 ) );
431     e = 0.25 * (1.0 - sqrt ( 5.0 / 14.0 ) );
432     f = -74.0 / 5625.0;
433     g = 343.0 / 45000.0;
434     h = 56.0 / 2250.0;
435    
436     QUADWEIGHTS(401-401) = f;
437     QUADWEIGHTS(402-401) = g;
438     QUADWEIGHTS(403-401) = g;
439     QUADWEIGHTS(404-401) = g;
440     QUADWEIGHTS(405-401) = g;
441     QUADWEIGHTS(406-401) = h;
442     QUADWEIGHTS(407-401) = h;
443     QUADWEIGHTS(408-401) = h;
444     QUADWEIGHTS(409-401) = h;
445     QUADWEIGHTS(410-401) = h;
446     QUADWEIGHTS(411-401) = h;
447    
448     QUADNODES(0,401-401) = a;
449     QUADNODES(0,402-401) = b;
450     QUADNODES(0,403-401) = c;
451     QUADNODES(0,404-401) = c;
452     QUADNODES(0,405-401) = c;
453     QUADNODES(0,406-401) = d;
454     QUADNODES(0,407-401) = d;
455     QUADNODES(0,408-401) = d;
456     QUADNODES(0,409-401) = e;
457     QUADNODES(0,410-401) = e;
458     QUADNODES(0,411-401) = e;
459    
460     QUADNODES(1,401-401) = a;
461     QUADNODES(1,402-401) = c;
462     QUADNODES(1,403-401) = b;
463     QUADNODES(1,404-401) = c;
464     QUADNODES(1,405-401) = c;
465     QUADNODES(1,406-401) = d;
466     QUADNODES(1,407-401) = e;
467     QUADNODES(1,408-401) = e;
468     QUADNODES(1,409-401) = d;
469     QUADNODES(1,410-401) = d;
470     QUADNODES(1,411-401) = e;
471    
472     QUADNODES(2,401-401) = a;
473     QUADNODES(2,402-401) = c;
474     QUADNODES(2,403-401) = c;
475     QUADNODES(2,404-401) = b;
476     QUADNODES(2,405-401) = c;
477     QUADNODES(2,406-401) = e;
478     QUADNODES(2,407-401) = d;
479     QUADNODES(2,408-401) = e;
480     QUADNODES(2,409-401) = d;
481     QUADNODES(2,410-401) = e;
482     QUADNODES(2,411-401) = d;
483    
484     } else if (numQuadNodes==15){
485     QUADWEIGHTS(412-412) = 0.019753086419753086;
486     QUADWEIGHTS(413-412) = 0.01198951396316977;
487     QUADWEIGHTS(414-412) = 0.01198951396316977;
488     QUADWEIGHTS(415-412) = 0.01198951396316977;
489     QUADWEIGHTS(416-412) = 0.01198951396316977;
490     QUADWEIGHTS(417-412) = 0.011511367871045397;
491     QUADWEIGHTS(418-412) = 0.011511367871045397;
492     QUADWEIGHTS(419-412) = 0.011511367871045397;
493     QUADWEIGHTS(420-412) = 0.011511367871045397;
494     QUADWEIGHTS(421-412) = 0.0088183421516754845;
495     QUADWEIGHTS(422-412) = 0.0088183421516754845;
496     QUADWEIGHTS(423-412) = 0.0088183421516754845;
497     QUADWEIGHTS(424-412) = 0.0088183421516754845;
498     QUADWEIGHTS(425-412) = 0.0088183421516754845;
499     QUADWEIGHTS(426-412) = 0.0088183421516754845;
500    
501     QUADNODES(0,412-412) = 0.2500000;
502     QUADNODES(0,413-412) = 0.091971078052723032;
503     QUADNODES(0,414-412) = 0.72408676584183096;
504     QUADNODES(0,415-412) = 0.091971078052723032;
505     QUADNODES(0,416-412) = 0.091971078052723032;
506     QUADNODES(0,417-412) = 0.31979362782962989;
507     QUADNODES(0,418-412) = 0.040619116511110234;
508     QUADNODES(0,419-412) = 0.31979362782962989;
509     QUADNODES(0,420-412) = 0.31979362782962989;
510     QUADNODES(0,421-412) = 0.056350832689629149;
511     QUADNODES(0,422-412) = 0.056350832689629149;
512     QUADNODES(0,423-412) = 0.056350832689629149;
513     QUADNODES(0,424-412) = 0.4436491673103708;
514     QUADNODES(0,425-412) = 0.4436491673103708;
515     QUADNODES(0,426-412) = 0.4436491673103708;
516    
517     QUADNODES(1,412-412) = 0.2500000;
518     QUADNODES(1,413-412) = 0.091971078052723032;
519     QUADNODES(1,414-412) = 0.091971078052723032;
520     QUADNODES(1,415-412) = 0.72408676584183096;
521     QUADNODES(1,416-412) = 0.091971078052723032;
522     QUADNODES(1,417-412) = 0.31979362782962989;
523     QUADNODES(1,418-412) = 0.31979362782962989;
524     QUADNODES(1,419-412) = 0.040619116511110234;
525     QUADNODES(1,420-412) = 0.31979362782962989;
526     QUADNODES(1,421-412) = 0.056350832689629149;
527     QUADNODES(1,422-412) = 0.4436491673103708;
528     QUADNODES(1,423-412) = 0.4436491673103708;
529     QUADNODES(1,424-412) = 0.056350832689629149;
530     QUADNODES(1,425-412) = 0.056350832689629149;
531     QUADNODES(1,426-412) = 0.4436491673103708;
532    
533     QUADNODES(2,412-412) = 0.2500000;
534     QUADNODES(2,413-412) = 0.091971078052723032;
535     QUADNODES(2,414-412) = 0.091971078052723032;
536     QUADNODES(2,415-412) = 0.091971078052723032;
537     QUADNODES(2,416-412) = 0.72408676584183096;
538     QUADNODES(2,417-412) = 0.31979362782962989;
539     QUADNODES(2,418-412) = 0.31979362782962989;
540     QUADNODES(2,419-412) = 0.31979362782962989;
541     QUADNODES(2,420-412) = 0.040619116511110234;
542     QUADNODES(2,421-412) = 0.4436491673103708;
543     QUADNODES(2,422-412) = 0.056350832689629149;
544     QUADNODES(2,423-412) = 0.4436491673103708;
545     QUADNODES(2,424-412) = 0.056350832689629149;
546     QUADNODES(2,425-412) = 0.4436491673103708;
547     QUADNODES(2,426-412) = 0.056350832689629149;
548    
549     } else if (numQuadNodes==24){
550     QUADWEIGHTS(427-427) = 0.006653792;
551     QUADWEIGHTS(428-427) = 0.006653792;
552     QUADWEIGHTS(429-427) = 0.006653792;
553     QUADWEIGHTS(430-427) = 0.006653792;
554     QUADWEIGHTS(431-427) = 0.001679535;
555     QUADWEIGHTS(432-427) = 0.001679535;
556     QUADWEIGHTS(433-427) = 0.001679535;
557     QUADWEIGHTS(434-427) = 0.001679535;
558     QUADWEIGHTS(435-427) = 0.009226197;
559     QUADWEIGHTS(436-427) = 0.009226197;
560     QUADWEIGHTS(437-427) = 0.009226197;
561     QUADWEIGHTS(438-427) = 0.009226197;
562     QUADWEIGHTS(439-427) = 0.008035714;
563     QUADWEIGHTS(440-427) = 0.008035714;
564     QUADWEIGHTS(441-427) = 0.008035714;
565     QUADWEIGHTS(442-427) = 0.008035714;
566     QUADWEIGHTS(443-427) = 0.008035714;
567     QUADWEIGHTS(444-427) = 0.008035714;
568     QUADWEIGHTS(445-427) = 0.008035714;
569     QUADWEIGHTS(446-427) = 0.008035714;
570     QUADWEIGHTS(447-427) = 0.008035714;
571     QUADWEIGHTS(448-427) = 0.008035714;
572     QUADWEIGHTS(449-427) = 0.008035714;
573     QUADWEIGHTS(450-427) = 0.008035714;
574    
575     QUADNODES(0,427-427) = 0.3561914;
576     QUADNODES(0,428-427) = 0.2146029;
577     QUADNODES(0,429-427) = 0.2146029;
578     QUADNODES(0,430-427) = 0.2146029;
579     QUADNODES(0,431-427) = 0.8779781;
580     QUADNODES(0,432-427) = 0.04067396;
581     QUADNODES(0,433-427) = 0.04067396;
582     QUADNODES(0,434-427) = 0.04067396;
583     QUADNODES(0,435-427) = 0.03298633;
584     QUADNODES(0,436-427) = 0.3223379;
585     QUADNODES(0,437-427) = 0.3223379;
586     QUADNODES(0,438-427) = 0.3223379;
587     QUADNODES(0,439-427) = 0.6030057;
588     QUADNODES(0,440-427) = 0.6030057;
589     QUADNODES(0,441-427) = 0.6030057;
590     QUADNODES(0,442-427) = 0.2696723;
591     QUADNODES(0,443-427) = 0.2696723;
592     QUADNODES(0,444-427) = 0.2696723;
593     QUADNODES(0,445-427) = 0.06366100;
594     QUADNODES(0,446-427) = 0.06366100;
595     QUADNODES(0,447-427) = 0.06366100;
596     QUADNODES(0,448-427) = 0.06366100;
597     QUADNODES(0,449-427) = 0.06366100;
598     QUADNODES(0,450-427) = 0.06366100;
599    
600     QUADNODES(1,427-427) = 0.2146029;
601     QUADNODES(1,428-427) = 0.3561914;
602     QUADNODES(1,429-427) = 0.2146029;
603     QUADNODES(1,430-427) = 0.2146029;
604     QUADNODES(1,431-427) = 0.04067396;
605     QUADNODES(1,432-427) = 0.8779781;
606     QUADNODES(1,433-427) = 0.04067396;
607     QUADNODES(1,434-427) = 0.04067396;
608     QUADNODES(1,435-427) = 0.3223379;
609     QUADNODES(1,436-427) = 0.03298633;
610     QUADNODES(1,437-427) = 0.3223379;
611     QUADNODES(1,438-427) = 0.3223379;
612     QUADNODES(1,439-427) = 0.2696723;
613     QUADNODES(1,440-427) = 0.06366100;
614     QUADNODES(1,441-427) = 0.06366100;
615     QUADNODES(1,442-427) = 0.6030057;
616     QUADNODES(1,443-427) = 0.06366100;
617     QUADNODES(1,444-427) = 0.06366100;
618     QUADNODES(1,445-427) = 0.6030057;
619     QUADNODES(1,446-427) = 0.6030057;
620     QUADNODES(1,447-427) = 0.2696723;
621     QUADNODES(1,448-427) = 0.2696723;
622     QUADNODES(1,449-427) = 0.06366100;
623     QUADNODES(1,450-427) = 0.06366100;
624    
625     QUADNODES(2,427-427) = 0.2146029;
626     QUADNODES(2,428-427) = 0.2146029;
627     QUADNODES(2,429-427) = 0.3561914;
628     QUADNODES(2,430-427) = 0.2146029;
629     QUADNODES(2,431-427) = 0.04067396;
630     QUADNODES(2,432-427) = 0.04067396;
631     QUADNODES(2,433-427) = 0.8779781;
632     QUADNODES(2,434-427) = 0.04067396;
633     QUADNODES(2,435-427) = 0.3223379;
634     QUADNODES(2,436-427) = 0.3223379;
635     QUADNODES(2,437-427) = 0.03298633;
636     QUADNODES(2,438-427) = 0.3223379;
637     QUADNODES(2,439-427) = 0.06366100;
638     QUADNODES(2,440-427) = 0.2696723;
639     QUADNODES(2,441-427) = 0.06366100;
640     QUADNODES(2,442-427) = 0.06366100;
641     QUADNODES(2,443-427) = 0.6030057;
642     QUADNODES(2,444-427) = 0.06366100;
643     QUADNODES(2,445-427) = 0.2696723;
644     QUADNODES(2,446-427) = 0.06366100;
645     QUADNODES(2,447-427) = 0.6030057;
646     QUADNODES(2,448-427) = 0.06366100;
647     QUADNODES(2,449-427) = 0.6030057;
648     QUADNODES(2,450-427) = 0.2696723;
649    
650     } else if (numQuadNodes==31){
651     QUADWEIGHTS(451-451) = 0.01826422;
652     QUADWEIGHTS(452-451) = 0.01059994;
653     QUADWEIGHTS(453-451) = 0.01059994;
654     QUADWEIGHTS(454-451) = 0.01059994;
655     QUADWEIGHTS(455-451) = 0.01059994;
656     QUADWEIGHTS(456-451) =-0.06251774;
657     QUADWEIGHTS(457-451) =-0.06251774;
658     QUADWEIGHTS(458-451) =-0.06251774;
659     QUADWEIGHTS(459-451) =-0.06251774;
660     QUADWEIGHTS(460-451) = 0.004891425;
661     QUADWEIGHTS(461-451) = 0.004891425;
662     QUADWEIGHTS(462-451) = 0.004891425;
663     QUADWEIGHTS(463-451) = 0.004891425;
664     QUADWEIGHTS(464-451) = 0.0009700176;
665     QUADWEIGHTS(465-451) = 0.0009700176;
666     QUADWEIGHTS(466-451) = 0.0009700176;
667     QUADWEIGHTS(467-451) = 0.0009700176;
668     QUADWEIGHTS(468-451) = 0.0009700176;
669     QUADWEIGHTS(469-451) = 0.0009700176;
670     QUADWEIGHTS(470-451) = 0.02755732;
671     QUADWEIGHTS(471-451) = 0.02755732;
672     QUADWEIGHTS(472-451) = 0.02755732;
673     QUADWEIGHTS(473-451) = 0.02755732;
674     QUADWEIGHTS(474-451) = 0.02755732;
675     QUADWEIGHTS(475-451) = 0.02755732;
676     QUADWEIGHTS(476-451) = 0.02755732;
677     QUADWEIGHTS(477-451) = 0.02755732;
678     QUADWEIGHTS(478-451) = 0.02755732;
679     QUADWEIGHTS(479-451) = 0.02755732;
680     QUADWEIGHTS(480-451) = 0.02755732;
681     QUADWEIGHTS(481-451) = 0.02755732;
682    
683     QUADNODES(0,451-451) = 0.2500000;
684     QUADNODES(0,452-451) = 0.7653604;
685     QUADNODES(0,453-451) = 0.07821319;
686     QUADNODES(0,454-451) = 0.07821319;
687     QUADNODES(0,455-451) = 0.07821319;
688     QUADNODES(0,456-451) = 0.6344704;
689     QUADNODES(0,457-451) = 0.1218432;
690     QUADNODES(0,458-451) = 0.1218432;
691     QUADNODES(0,459-451) = 0.1218432;
692     QUADNODES(0,460-451) = 0.002382507;
693     QUADNODES(0,461-451) = 0.3325392;
694     QUADNODES(0,462-451) = 0.3325392;
695     QUADNODES(0,463-451) = 0.3325392;
696     QUADNODES(0,464-451) = 0.0000000;
697     QUADNODES(0,465-451) = 0.0000000;
698     QUADNODES(0,466-451) = 0.0000000;
699     QUADNODES(0,467-451) = 0.5000000;
700     QUADNODES(0,468-451) = 0.5000000;
701     QUADNODES(0,469-451) = 0.5000000;
702     QUADNODES(0,470-451) = 0.6000000;
703     QUADNODES(0,471-451) = 0.6000000;
704     QUADNODES(0,472-451) = 0.6000000;
705     QUADNODES(0,473-451) = 0.2000000;
706     QUADNODES(0,474-451) = 0.2000000;
707     QUADNODES(0,475-451) = 0.2000000;
708     QUADNODES(0,476-451) = 0.1000000;
709     QUADNODES(0,477-451) = 0.1000000;
710     QUADNODES(0,478-451) = 0.1000000;
711     QUADNODES(0,479-451) = 0.1000000;
712     QUADNODES(0,480-451) = 0.1000000;
713     QUADNODES(0,481-451) = 0.1000000;
714    
715     QUADNODES(1,451-451) = 0.2500000;
716     QUADNODES(1,452-451) = 0.07821319;
717     QUADNODES(1,453-451) = 0.7653604;
718     QUADNODES(1,454-451) = 0.07821319;
719     QUADNODES(1,455-451) = 0.07821319;
720     QUADNODES(1,456-451) = 0.1218432;
721     QUADNODES(1,457-451) = 0.6344704;
722     QUADNODES(1,458-451) = 0.1218432;
723     QUADNODES(1,459-451) = 0.1218432;
724     QUADNODES(1,460-451) = 0.3325392;
725     QUADNODES(1,461-451) = 0.002382507;
726     QUADNODES(1,462-451) = 0.3325392;
727     QUADNODES(1,463-451) = 0.3325392;
728     QUADNODES(1,464-451) = 0.0000000;
729     QUADNODES(1,465-451) = 0.5000000;
730     QUADNODES(1,466-451) = 0.5000000;
731     QUADNODES(1,467-451) = 0.0000000;
732     QUADNODES(1,468-451) = 0.0000000;
733     QUADNODES(1,469-451) = 0.5000000;
734     QUADNODES(1,470-451) = 0.2000000;
735     QUADNODES(1,471-451) = 0.1000000;
736     QUADNODES(1,472-451) = 0.1000000;
737     QUADNODES(1,473-451) = 0.6000000;
738     QUADNODES(1,474-451) = 0.1000000;
739     QUADNODES(1,475-451) = 0.1000000;
740     QUADNODES(1,476-451) = 0.6000000;
741     QUADNODES(1,477-451) = 0.6000000;
742     QUADNODES(1,478-451) = 0.2000000;
743     QUADNODES(1,479-451) = 0.2000000;
744     QUADNODES(1,480-451) = 0.1000000;
745     QUADNODES(1,481-451) = 0.1000000;
746    
747     QUADNODES(2,451-451) = 0.2500000;
748     QUADNODES(2,452-451) = 0.07821319;
749     QUADNODES(2,453-451) = 0.07821319;
750     QUADNODES(2,454-451) = 0.7653604;
751     QUADNODES(2,455-451) = 0.07821319;
752     QUADNODES(2,456-451) = 0.1218432;
753     QUADNODES(2,457-451) = 0.1218432;
754     QUADNODES(2,458-451) = 0.6344704;
755     QUADNODES(2,459-451) = 0.1218432;
756     QUADNODES(2,460-451) = 0.3325392;
757     QUADNODES(2,461-451) = 0.3325392;
758     QUADNODES(2,462-451) = 0.002382507;
759     QUADNODES(2,463-451) = 0.3325392;
760     QUADNODES(2,464-451) = 0.5000000;
761     QUADNODES(2,465-451) = 0.0000000;
762     QUADNODES(2,466-451) = 0.5000000;
763     QUADNODES(2,467-451) = 0.0000000;
764     QUADNODES(2,468-451) = 0.5000000;
765     QUADNODES(2,469-451) = 0.0000000;
766     QUADNODES(2,470-451) = 0.1000000;
767     QUADNODES(2,471-451) = 0.2000000;
768     QUADNODES(2,472-451) = 0.1000000;
769     QUADNODES(2,473-451) = 0.1000000;
770     QUADNODES(2,474-451) = 0.6000000;
771     QUADNODES(2,475-451) = 0.1000000;
772     QUADNODES(2,476-451) = 0.2000000;
773     QUADNODES(2,477-451) = 0.1000000;
774     QUADNODES(2,478-451) = 0.6000000;
775     QUADNODES(2,479-451) = 0.1000000;
776     QUADNODES(2,480-451) = 0.6000000;
777     QUADNODES(2,481-451) = 0.2000000;
778    
779     } else if (numQuadNodes==45){
780     QUADWEIGHTS(482-482) =-0.03932701;
781     QUADWEIGHTS(483-482) = 0.004081316;
782     QUADWEIGHTS(484-482) = 0.004081316;
783     QUADWEIGHTS(485-482) = 0.004081316;
784     QUADWEIGHTS(486-482) = 0.004081316;
785     QUADWEIGHTS(487-482) = 0.0006580868;
786     QUADWEIGHTS(488-482) = 0.0006580868;
787     QUADWEIGHTS(489-482) = 0.0006580868;
788     QUADWEIGHTS(490-482) = 0.0006580868;
789     QUADWEIGHTS(491-482) = 0.004384259;
790     QUADWEIGHTS(492-482) = 0.004384259;
791     QUADWEIGHTS(493-482) = 0.004384259;
792     QUADWEIGHTS(494-482) = 0.004384259;
793     QUADWEIGHTS(495-482) = 0.004384259;
794     QUADWEIGHTS(496-482) = 0.004384259;
795     QUADWEIGHTS(497-482) = 0.01383006;
796     QUADWEIGHTS(498-482) = 0.01383006;
797     QUADWEIGHTS(499-482) = 0.01383006;
798     QUADWEIGHTS(500-482) = 0.01383006;
799     QUADWEIGHTS(501-482) = 0.01383006;
800     QUADWEIGHTS(502-482) = 0.01383006;
801     QUADWEIGHTS(503-482) = 0.004240437;
802     QUADWEIGHTS(504-482) = 0.004240437;
803     QUADWEIGHTS(505-482) = 0.004240437;
804     QUADWEIGHTS(506-482) = 0.004240437;
805     QUADWEIGHTS(507-482) = 0.004240437;
806     QUADWEIGHTS(508-482) = 0.004240437;
807     QUADWEIGHTS(509-482) = 0.004240437;
808     QUADWEIGHTS(510-482) = 0.004240437;
809     QUADWEIGHTS(511-482) = 0.004240437;
810     QUADWEIGHTS(512-482) = 0.004240437;
811     QUADWEIGHTS(513-482) = 0.004240437;
812     QUADWEIGHTS(514-482) = 0.004240437;
813     QUADWEIGHTS(515-482) = 0.002238740;
814     QUADWEIGHTS(516-482) = 0.002238740;
815     QUADWEIGHTS(517-482) = 0.002238740;
816     QUADWEIGHTS(518-482) = 0.002238740;
817     QUADWEIGHTS(519-482) = 0.002238740;
818     QUADWEIGHTS(520-482) = 0.002238740;
819     QUADWEIGHTS(521-482) = 0.002238740;
820     QUADWEIGHTS(522-482) = 0.002238740;
821     QUADWEIGHTS(523-482) = 0.002238740;
822     QUADWEIGHTS(524-482) = 0.002238740;
823     QUADWEIGHTS(525-482) = 0.002238740;
824     QUADWEIGHTS(526-482) = 0.002238740;
825    
826     QUADNODES(0,482-482) = 0.2500000;
827     QUADNODES(0,483-482) = 0.6175872;
828     QUADNODES(0,484-482) = 0.1274709;
829     QUADNODES(0,485-482) = 0.1274709;
830     QUADNODES(0,486-482) = 0.1274709;
831     QUADNODES(0,487-482) = 0.9037635;
832     QUADNODES(0,488-482) = 0.03207883;
833     QUADNODES(0,489-482) = 0.03207883;
834     QUADNODES(0,490-482) = 0.03207883;
835     QUADNODES(0,491-482) = 0.4502229;
836     QUADNODES(0,492-482) = 0.4502229;
837     QUADNODES(0,493-482) = 0.4502229;
838     QUADNODES(0,494-482) = 0.04977710;
839     QUADNODES(0,495-482) = 0.04977710;
840     QUADNODES(0,496-482) = 0.04977710;
841     QUADNODES(0,497-482) = 0.3162696;
842     QUADNODES(0,498-482) = 0.3162696;
843     QUADNODES(0,499-482) = 0.3162696;
844     QUADNODES(0,500-482) = 0.1837304;
845     QUADNODES(0,501-482) = 0.1837304;
846     QUADNODES(0,502-482) = 0.1837304;
847     QUADNODES(0,503-482) = 0.5132800;
848     QUADNODES(0,504-482) = 0.5132800;
849     QUADNODES(0,505-482) = 0.5132800;
850     QUADNODES(0,506-482) = 0.02291779;
851     QUADNODES(0,507-482) = 0.02291779;
852     QUADNODES(0,508-482) = 0.02291779;
853     QUADNODES(0,509-482) = 0.2319011;
854     QUADNODES(0,510-482) = 0.2319011;
855     QUADNODES(0,511-482) = 0.2319011;
856     QUADNODES(0,512-482) = 0.2319011;
857     QUADNODES(0,513-482) = 0.2319011;
858     QUADNODES(0,514-482) = 0.2319011;
859     QUADNODES(0,515-482) = 0.1937465;
860     QUADNODES(0,516-482) = 0.1937465;
861     QUADNODES(0,517-482) = 0.1937465;
862     QUADNODES(0,518-482) = 0.7303134;
863     QUADNODES(0,519-482) = 0.7303134;
864     QUADNODES(0,520-482) = 0.7303134;
865     QUADNODES(0,521-482) = 0.03797005;
866     QUADNODES(0,522-482) = 0.03797005;
867     QUADNODES(0,523-482) = 0.03797005;
868     QUADNODES(0,524-482) = 0.03797005;
869     QUADNODES(0,525-482) = 0.03797005;
870     QUADNODES(0,526-482) = 0.03797005;
871    
872     QUADNODES(1,482-482) = 0.2500000;
873     QUADNODES(1,483-482) = 0.1274709;
874     QUADNODES(1,484-482) = 0.6175872;
875     QUADNODES(1,485-482) = 0.1274709;
876     QUADNODES(1,486-482) = 0.1274709;
877     QUADNODES(1,487-482) = 0.03207883;
878     QUADNODES(1,488-482) = 0.9037635;
879     QUADNODES(1,489-482) = 0.03207883;
880     QUADNODES(1,490-482) = 0.03207883;
881     QUADNODES(1,491-482) = 0.4502229;
882     QUADNODES(1,492-482) = 0.04977710;
883     QUADNODES(1,493-482) = 0.04977710;
884     QUADNODES(1,494-482) = 0.4502229;
885     QUADNODES(1,495-482) = 0.4502229;
886     QUADNODES(1,496-482) = 0.04977710;
887     QUADNODES(1,497-482) = 0.3162696;
888     QUADNODES(1,498-482) = 0.1837304;
889     QUADNODES(1,499-482) = 0.1837304;
890     QUADNODES(1,500-482) = 0.3162696;
891     QUADNODES(1,501-482) = 0.3162696;
892     QUADNODES(1,502-482) = 0.1837304;
893     QUADNODES(1,503-482) = 0.02291779;
894     QUADNODES(1,504-482) = 0.2319011;
895     QUADNODES(1,505-482) = 0.2319011;
896     QUADNODES(1,506-482) = 0.5132800;
897     QUADNODES(1,507-482) = 0.2319011;
898     QUADNODES(1,508-482) = 0.2319011;
899     QUADNODES(1,509-482) = 0.5132800;
900     QUADNODES(1,510-482) = 0.5132800;
901     QUADNODES(1,511-482) = 0.02291779;
902     QUADNODES(1,512-482) = 0.02291779;
903     QUADNODES(1,513-482) = 0.2319011;
904     QUADNODES(1,514-482) = 0.2319011;
905     QUADNODES(1,515-482) = 0.7303134;
906     QUADNODES(1,516-482) = 0.03797005;
907     QUADNODES(1,517-482) = 0.03797005;
908     QUADNODES(1,518-482) = 0.1937465;
909     QUADNODES(1,519-482) = 0.03797005;
910     QUADNODES(1,520-482) = 0.03797005;
911     QUADNODES(1,521-482) = 0.1937465;
912     QUADNODES(1,522-482) = 0.1937465;
913     QUADNODES(1,523-482) = 0.7303134;
914     QUADNODES(1,524-482) = 0.7303134;
915     QUADNODES(1,525-482) = 0.03797005;
916     QUADNODES(1,526-482) = 0.03797005;
917    
918     QUADNODES(2,482-482) = 0.2500000;
919     QUADNODES(2,483-482) = 0.1274709;
920     QUADNODES(2,484-482) = 0.1274709;
921     QUADNODES(2,485-482) = 0.6175872;
922     QUADNODES(2,486-482) = 0.1274709;
923     QUADNODES(2,487-482) = 0.03207883;
924     QUADNODES(2,488-482) = 0.03207883;
925     QUADNODES(2,489-482) = 0.9037635;
926     QUADNODES(2,490-482) = 0.03207883;
927     QUADNODES(2,491-482) = 0.04977710;
928     QUADNODES(2,492-482) = 0.4502229;
929     QUADNODES(2,493-482) = 0.04977710;
930     QUADNODES(2,494-482) = 0.4502229;
931     QUADNODES(2,495-482) = 0.04977710;
932     QUADNODES(2,496-482) = 0.4502229;
933     QUADNODES(2,497-482) = 0.1837304;
934     QUADNODES(2,498-482) = 0.3162696;
935     QUADNODES(2,499-482) = 0.1837304;
936     QUADNODES(2,500-482) = 0.3162696;
937     QUADNODES(2,501-482) = 0.1837304;
938     QUADNODES(2,502-482) = 0.3162696;
939     QUADNODES(2,503-482) = 0.2319011;
940     QUADNODES(2,504-482) = 0.02291779;
941     QUADNODES(2,505-482) = 0.2319011;
942     QUADNODES(2,506-482) = 0.2319011;
943     QUADNODES(2,507-482) = 0.5132800;
944     QUADNODES(2,508-482) = 0.2319011;
945     QUADNODES(2,509-482) = 0.02291779;
946     QUADNODES(2,510-482) = 0.2319011;
947     QUADNODES(2,511-482) = 0.5132800;
948     QUADNODES(2,512-482) = 0.2319011;
949     QUADNODES(2,513-482) = 0.5132800;
950     QUADNODES(2,514-482) = 0.02291779;
951     QUADNODES(2,515-482) = 0.03797005;
952     QUADNODES(2,516-482) = 0.7303134;
953     QUADNODES(2,517-482) = 0.03797005;
954     QUADNODES(2,518-482) = 0.03797005;
955     QUADNODES(2,519-482) = 0.1937465;
956     QUADNODES(2,520-482) = 0.03797005;
957     QUADNODES(2,521-482) = 0.7303134;
958     QUADNODES(2,522-482) = 0.03797005;
959     QUADNODES(2,523-482) = 0.1937465;
960     QUADNODES(2,524-482) = 0.03797005;
961     QUADNODES(2,525-482) = 0.1937465;
962     QUADNODES(2,526-482) = 0.7303134;
963    
964 jgs 82 } else {
965    
966     /* get scheme on [0.1]^3 */
967    
968     Finley_Quad_getNodesHex(numQuadNodes,quadNodes,quadWeights);
969 jgs 150 if (! Finley_noError()) return;
970 jgs 82
971     /* squeeze it: */
972     for (i=0;i<numQuadNodes;i++) {
973     Q1=QUADNODES(0,i);
974     Q2=QUADNODES(1,i);
975     Q3=QUADNODES(2,i);
976    
977     JA11= (1./3.)*Q2*Q3-(1./2.)*(Q2+Q3) +1.;
978     JA12= (1./3.)*Q1*Q3-(1./2.)*Q1;
979     JA13= (1./3.)*Q1*Q2-(1./2.)*Q1;
980     JA21= (1./3.)*Q2*Q3-(1./2.)*Q2;
981     JA22= (1./3.)*Q1*Q3-(1./2.)*(Q1+Q3) +1.;
982     JA23= (1./3.)*Q1*Q2-(1./2.)*Q2;
983     JA31= (1./3.)*Q2*Q3-(1./2.)*Q3;
984     JA32= (1./3.)*Q1*Q3-(1./2.)*Q3;
985     JA33= (1./3.)*Q1*Q2-(1./2.)*(Q1+Q2) +1.;
986     DET=JA11*JA22*JA33+JA12*JA23*JA31+JA13*JA21*JA32-JA13*JA22*JA31-JA11*JA23*JA32-JA12*JA21*JA33;
987     quadWeights[i]=quadWeights[i]*ABS(DET);
988     QUADNODES(0,i)=Q1*((1./3.)*Q2*Q3-(1./2.)*(Q2+Q3)+1.);
989     QUADNODES(1,i)=Q2*((1./3.)*Q1*Q3-(1./2.)*(Q1+Q3)+1.);
990     QUADNODES(2,i)=Q3*((1./3.)*Q1*Q2-(1./2.)*(Q1+Q2)+1.);
991     }
992     }
993     #undef DIM
994     }
995    
996     /**************************************************************/
997    
998     /* get a quadrature scheme with numQuadNodes quadrature nodes for the quad [0.1]^2 */
999     /* as a X-product of a 1D scheme. */
1000    
1001     void Finley_Quad_getNodesRec(int numQuadNodes,double* quadNodes,double* quadWeights) {
1002 jgs 150 char error_msg[LenErrorMsg_MAX];
1003 jgs 82 int numQuadNodes1d,i,j,l;
1004 gross 1028 double *quadNodes1d=NULL,*quadWeights1d=NULL;
1005     bool_t set=FALSE;
1006 jgs 82 #define DIM 2
1007    
1008 gross 1028 quadNodes1d=TMPMEMALLOC(numQuadNodes,double);
1009     quadWeights1d=TMPMEMALLOC(numQuadNodes,double);
1010     if (! ( Finley_checkPtr(quadNodes1d) || Finley_checkPtr(quadWeights1d) ) ) {
1011     /* find numQuadNodes1d with numQuadNodes1d**2==numQuadNodes: */
1012    
1013     for (numQuadNodes1d=1;numQuadNodes1d<=MAX_numQuadNodesLine;numQuadNodes1d++) {
1014     if (numQuadNodes1d*numQuadNodes1d==numQuadNodes) {
1015 jgs 82
1016 gross 1028 /* get 1D scheme: */
1017    
1018     Finley_Quad_getNodesLine(numQuadNodes1d,quadNodes1d,quadWeights1d);
1019 jgs 82
1020 gross 1028 /* make 2D scheme: */
1021 jgs 82
1022 gross 1028 if (Finley_noError()) {
1023     l=0;
1024     for (i=0;i<numQuadNodes1d;i++) {
1025     for (j=0;j<numQuadNodes1d;j++) {
1026     QUADNODES(0,l)=quadNodes1d[i];
1027     QUADNODES(1,l)=quadNodes1d[j];
1028     QUADWEIGHTS(l)=quadWeights1d[i]*quadWeights1d[j];
1029     l++;
1030     }
1031     }
1032     set=TRUE;
1033     break;
1034     }
1035     }
1036     }
1037     if (!set) {
1038     sprintf(error_msg,"Finley_Quad_getNodesRec: Illegal number of quadrature nodes %d on hexahedron.",numQuadNodes);
1039     Finley_setError(VALUE_ERROR,error_msg);
1040     }
1041     TMPMEMFREE(quadNodes1d);
1042     TMPMEMFREE(quadWeights1d);
1043     }
1044     #undef DIM
1045 jgs 82 }
1046    
1047     /**************************************************************/
1048    
1049     /* get a quadrature scheme with numQuadNodes quadrature nodes for the hex [0.1]^3 */
1050     /* as a X-product of a 1D scheme. */
1051    
1052     void Finley_Quad_getNodesHex(int numQuadNodes,double* quadNodes,double* quadWeights) {
1053 jgs 150 char error_msg[LenErrorMsg_MAX];
1054 jgs 82 int numQuadNodes1d,i,j,k,l;
1055 gross 1028 double *quadNodes1d=NULL,*quadWeights1d=NULL;
1056 artak 2034 bool_t set=FALSE;
1057 jgs 82 #define DIM 3
1058    
1059     /* find numQuadNodes1d with numQuadNodes1d**3==numQuadNodes: */
1060    
1061 gross 1028 quadNodes1d=TMPMEMALLOC(numQuadNodes,double);
1062     quadWeights1d=TMPMEMALLOC(numQuadNodes,double);
1063     if (! ( Finley_checkPtr(quadNodes1d) || Finley_checkPtr(quadWeights1d) ) ) {
1064     for (numQuadNodes1d=1;numQuadNodes1d<=MAX_numQuadNodesLine;numQuadNodes1d++) {
1065     if (numQuadNodes1d*numQuadNodes1d*numQuadNodes1d==numQuadNodes) {
1066 jgs 82
1067 gross 1028 /* get 1D scheme: */
1068 jgs 82
1069 gross 1028 Finley_Quad_getNodesLine(numQuadNodes1d,quadNodes1d,quadWeights1d);
1070 jgs 82
1071 gross 1028 /* make 3D scheme: */
1072 jgs 82
1073 gross 1028 if (Finley_noError()) {
1074     l=0;
1075     for (i=0;i<numQuadNodes1d;i++) {
1076     for (j=0;j<numQuadNodes1d;j++) {
1077     for (k=0;k<numQuadNodes1d;k++) {
1078     QUADNODES(0,l)=quadNodes1d[i];
1079     QUADNODES(1,l)=quadNodes1d[j];
1080     QUADNODES(2,l)=quadNodes1d[k];
1081     QUADWEIGHTS(l)=quadWeights1d[i]*quadWeights1d[j]*quadWeights1d[k];
1082     l++;
1083     }
1084     }
1085     }
1086     set=TRUE;
1087     break;
1088     }
1089     }
1090     }
1091     if (!set) {
1092     sprintf(error_msg,"Finley_Quad_getNodesHex: Illegal number of quadrature nodes %d on hexahedron.",numQuadNodes);
1093     Finley_setError(VALUE_ERROR,error_msg);
1094     }
1095     TMPMEMFREE(quadNodes1d);
1096     TMPMEMFREE(quadWeights1d);
1097 jgs 82 }
1098     #undef DIM
1099     }
1100    
1101     /**************************************************************/
1102    
1103     /* get a quadrature scheme with numQuadNodes quadrature nodes for a point. As there */
1104     /* in no quadrature scheme for a point any value for numQuadNodes other than 0 throws */
1105     /* an error. */
1106    
1107     void Finley_Quad_getNodesPoint(int numQuadNodes,double* quadNodes,double* quadWeights) {
1108 gross 2748 if (numQuadNodes==0) {
1109     return;
1110     } else {
1111     Finley_setError(VALUE_ERROR,"Finley_Quad_getNodesPoint: Illegal number of quadrature nodes.");
1112 jgs 82 }
1113     }
1114    
1115     /**************************************************************/
1116    
1117     /* get a quadrature scheme with numQuadNodes quadrature nodes on the line [0,1]: */
1118     /* The nodes and weights are set from a table. */
1119    
1120     void Finley_Quad_getNodesLine(int numQuadNodes,double* quadNodes,double* quadWeights) {
1121     switch(numQuadNodes) {
1122     case 1:
1123     quadNodes[0]=0.5;
1124     quadWeights[0]=1.;
1125     break;
1126    
1127     case 2:
1128     quadNodes[0]=(1.-.577350269189626)/2.;
1129     quadNodes[1]=(1.+.577350269189626)/2.;
1130     quadWeights[0]=.5;
1131     quadWeights[1]=.5;
1132     break;
1133    
1134     case 3:
1135     quadNodes[0]=(1.-.774596669241483)/2.;
1136     quadNodes[1]=.5;
1137     quadNodes[2]=(1.+.774596669241483)/2.;
1138     quadWeights[0]=5./18.;
1139     quadWeights[1]=4./ 9.;
1140     quadWeights[2]=5./18.;
1141     break;
1142    
1143     case 4:
1144     quadNodes[0]=(1.-.861136311594053)/2.;
1145     quadNodes[1]=(1.-.339981043584856)/2.;
1146     quadNodes[2]=(1.+.339981043584856)/2.;
1147     quadNodes[3]=(1.+.861136311594053)/2.;
1148     quadWeights[0]=.347854845137454/2.;
1149     quadWeights[1]=.652145154862546/2.;
1150     quadWeights[2]=.652145154862546/2.;
1151     quadWeights[3]=.347854845137454/2.;
1152     break;
1153    
1154     case 5:
1155     quadNodes[0]=(1.-.906179845938664)/2.;
1156     quadNodes[1]=(1.-.538469310105683)/2.;
1157     quadNodes[2]= .5;
1158     quadNodes[3]=(1.+.538469310105683)/2.;
1159     quadNodes[4]=(1.+.906179845938664)/2.;
1160     quadWeights[0]=.236926885056189/2.;
1161     quadWeights[1]=.478628670499366/2.;
1162     quadWeights[2]=.568888888888889/2.;
1163     quadWeights[3]=.478628670499366/2.;
1164     quadWeights[4]=.236926885056189/2.;
1165     break;
1166    
1167     case 6:
1168     quadNodes[0]=(1.-.932469514203152)/2.;
1169     quadNodes[1]=(1.-.661209386466265)/2.;
1170     quadNodes[2]=(1.-.238619186083197)/2.;
1171     quadNodes[3]=(1.+.238619186083197)/2.;
1172     quadNodes[4]=(1.+.661209386466265)/2.;
1173     quadNodes[5]=(1.+.932469514203152)/2.;
1174     quadWeights[0]=.171324492379170/2.;
1175     quadWeights[1]=.360761573048139/2.;
1176     quadWeights[2]=.467913934572691/2.;
1177     quadWeights[3]=.467913934572691/2.;
1178     quadWeights[4]=.360761573048139/2.;
1179     quadWeights[5]=.171324492379170/2.;
1180     break;
1181    
1182     case 7:
1183     quadNodes[0]=(1.-.949107912342759)/2.;
1184     quadNodes[1]=(1.-.741531185599394)/2.;
1185     quadNodes[2]=(1.-.405845151377397)/2.;
1186     quadNodes[3]=0.5;
1187     quadNodes[4]=(1.+.405845151377397)/2.;
1188     quadNodes[5]=(1.+.741531185599394)/2.;
1189     quadNodes[6]=(1.+.949107912342759)/2.;
1190     quadWeights[0]= .129484966168870/2.;
1191     quadWeights[1]= .279705391489277/2.;
1192     quadWeights[2]= .381830050505119/2.;
1193     quadWeights[3]= .417959183673469/2.;
1194     quadWeights[4]= .381830050505119/2.;
1195     quadWeights[5]= .279705391489277/2.;
1196     quadWeights[6]= .129484966168870/2.;
1197     break;
1198    
1199     case 8:
1200     quadNodes[0]=(1.-.960289856497536)/2.;
1201     quadNodes[1]=(1.-.796666477413627)/2.;
1202     quadNodes[2]=(1.-.525532409916329)/2.;
1203     quadNodes[3]=(1.-.183434642495650)/2.;
1204     quadNodes[4]=(1.+.183434642495650)/2.;
1205     quadNodes[5]=(1.+.525532409916329)/2.;
1206     quadNodes[6]=(1.+.796666477413627)/2.;
1207     quadNodes[7]=(1.+.960289856497536)/2.;
1208     quadWeights[0]= .101228536290376/2.;
1209     quadWeights[1]= .222381034453374/2.;
1210     quadWeights[2]= .313706645877887/2.;
1211     quadWeights[3]= .362683783378362/2.;
1212     quadWeights[4]= .362683783378362/2.;
1213     quadWeights[5]= .313706645877887/2.;
1214     quadWeights[6]= .222381034453374/2.;
1215     quadWeights[7]= .101228536290376/2.;
1216     break;
1217    
1218     case 9:
1219     quadNodes[0]=(1.-.968160239507626)/2.;
1220     quadNodes[1]=(1.-.836031107326636)/2.;
1221     quadNodes[2]=(1.-.613371432700590)/2.;
1222     quadNodes[3]=(1.-.324253423403809)/2.;
1223     quadNodes[4]= .5;
1224     quadNodes[5]=(1.+.324253423403809)/2.;
1225     quadNodes[6]=(1.+.613371432700590)/2.;
1226     quadNodes[7]=(1.+.836031107326636)/2.;
1227     quadNodes[8]=(1.+.968160239507626)/2.;
1228     quadWeights[0]= .081274388361574/2.;
1229     quadWeights[1]= .180648160694857/2.;
1230     quadWeights[2]= .260610696402935/2.;
1231     quadWeights[3]= .312347077040003/2.;
1232     quadWeights[4]= .330239355001260/2.;
1233     quadWeights[5]= .312347077040003/2.;
1234     quadWeights[6]= .260610696402935/2.;
1235     quadWeights[7]= .180648160694857/2.;
1236     quadWeights[8]= .081274388361574/2.;
1237     break;
1238    
1239     case 10:
1240     quadNodes[0]=(1.-.973906528517172)/2.;
1241     quadNodes[1]=(1.-.865063366688985)/2.;
1242     quadNodes[2]=(1.-.679409568299024)/2.;
1243     quadNodes[3]=(1.-.433395394129247)/2.;
1244     quadNodes[4]=(1.-.148874338981631)/2.;
1245     quadNodes[5]=(1.+.148874338981631)/2.;
1246     quadNodes[6]=(1.+.433395394129247)/2.;
1247     quadNodes[7]=(1.+.679409568299024)/2.;
1248     quadNodes[8]=(1.+.865063366688985)/2.;
1249     quadNodes[9]=(1.+.973906528517172)/2.;
1250     quadWeights[0]= .066671344308688/2.;
1251     quadWeights[1]= .149451349150581/2.;
1252     quadWeights[2]= .219086362515982/2.;
1253     quadWeights[3]= .269266719309996/2.;
1254     quadWeights[4]= .295524224714753/2.;
1255     quadWeights[5]= .295524224714753/2.;
1256     quadWeights[6]= .269266719309996/2.;
1257     quadWeights[7]= .219086362515982/2.;
1258     quadWeights[8]= .149451349150581/2.;
1259     quadWeights[9]= .066671344308688/2.;
1260     break;
1261    
1262     default:
1263 gross 2748 Finley_setError(VALUE_ERROR,"Finley_Quad_getNodesLine: Negative intergration order.");
1264 jgs 82 break;
1265     }
1266     }
1267    
1268    
1269     /**************************************************************/
1270    
1271     /* The following functions Finley_Quad_getNumNodes* return the nmber of quadrature points needed to */
1272     /* achieve a certain accuracy. Notice that for Tet and Tri the the order is increased */
1273     /* to consider the accuracy reduction through the construction process. */
1274    
1275    
1276     int Finley_Quad_getNumNodesPoint(int order) {
1277     return 0;
1278     }
1279    
1280     int Finley_Quad_getNumNodesLine(int order) {
1281 jgs 150 char error_msg[LenErrorMsg_MAX];
1282 jgs 82 if (order <0 ) {
1283 gross 964 Finley_setError(VALUE_ERROR,"Finley_Quad_getNumNodesPoint: Negative intergration order.");
1284 jgs 82 return -1;
1285     } else {
1286     if (order > 2*MAX_numQuadNodesLine-1) {
1287 gross 964 sprintf(error_msg,"Finley_Quad_getNumNodesPoint: requested integration order %d on line is too large (>%d).",
1288 jgs 82 order,2*MAX_numQuadNodesLine-1);
1289 jgs 150 Finley_setError(VALUE_ERROR,error_msg);
1290 jgs 82 return -1;
1291     } else {
1292 jgs 150 Finley_resetError();
1293 jgs 82 return order/2+1;
1294     }
1295     }
1296     }
1297    
1298     int Finley_Quad_getNumNodesTri(int order) {
1299     int numQuadNodesLine;
1300 gross 1072 if (order<=1) {
1301 jgs 82 return 1;
1302 gross 1342 } else if (order<=2){
1303 btully 1170 return 3;
1304 gross 1342 } else if (order<=3){
1305 btully 1170 return 4;
1306 gross 1342 } else if (order<=4){
1307     return 6;
1308     } else if (order<=5){
1309     return 7;
1310     } else if (order<=6){
1311     return 12;
1312     } else if (order<=7){
1313     return 13;
1314     } else if (order<=8){
1315     return 16;
1316     } else if (order<=9){
1317     return 19;
1318 jgs 82 } else {
1319     numQuadNodesLine=Finley_Quad_getNumNodesLine(order+1);
1320 jgs 150 if (Finley_noError()) {
1321 jgs 82 return numQuadNodesLine*numQuadNodesLine;
1322     } else {
1323     return -1;
1324     }
1325     }
1326     }
1327    
1328     int Finley_Quad_getNumNodesRec(int order) {
1329     int numQuadNodesLine;
1330     numQuadNodesLine=Finley_Quad_getNumNodesLine(order);
1331 jgs 150 if (Finley_noError()) {
1332 jgs 82 return numQuadNodesLine*numQuadNodesLine;
1333     } else {
1334     return -1;
1335     }
1336     }
1337    
1338     int Finley_Quad_getNumNodesTet(int order) {
1339     int numQuadNodesLine;
1340 gross 1072 if (order<=1) {
1341     return 1;
1342 gross 1342 } else if (order<=2){
1343 btully 1170 return 4;
1344 gross 1342 } else if (order<=3){
1345 btully 1170 return 5;
1346 gross 1342 } else if (order<=4){
1347     return 11;
1348     } else if (order<=5){
1349     return 15;
1350     } else if (order<=6){
1351     return 24;
1352     } else if (order<=7){
1353     return 31;
1354     } else if (order<=8){
1355     return 45;
1356 jgs 82 } else {
1357 gross 1072 numQuadNodesLine=Finley_Quad_getNumNodesLine(order+2);
1358     if (Finley_noError()) {
1359     return numQuadNodesLine*numQuadNodesLine*numQuadNodesLine;
1360     } else {
1361     return -1;
1362     }
1363 jgs 82 }
1364     }
1365    
1366     int Finley_Quad_getNumNodesHex(int order) {
1367     int numQuadNodesLine;
1368     numQuadNodesLine=Finley_Quad_getNumNodesLine(order);
1369 jgs 150 if (Finley_noError()) {
1370 jgs 82 return numQuadNodesLine*numQuadNodesLine*numQuadNodesLine;
1371     } else {
1372     return -1;
1373     }
1374     }
1375 gross 2748 dim_t Finley_Quad_MacroPoint(dim_t numSubElements, int numQuadNodes, double* quadNodes, double* quadWeights, dim_t numF, double* dFdv,
1376     dim_t new_len, double* new_quadNodes, double* new_quadWeights, double* new_dFdv )
1377     {
1378     return 0;
1379    
1380     }
1381     dim_t Finley_Quad_MacroLine(dim_t numSubElements, int numQuadNodes, double* quadNodes, double* quadWeights, dim_t numF, double* dFdv,
1382     dim_t new_len, double* new_quadNodes, double* new_quadWeights, double* new_dFdv )
1383     {
1384     #define DIM 1
1385     dim_t s,q,i;
1386     register double x0, w;
1387     const double f=1./((double)numSubElements);
1388    
1389     if (new_len < numSubElements*numQuadNodes) {
1390     Finley_setError(MEMORY_ERROR,"Finley_Quad_MacroLine: array for new qurature scheme is too small");
1391     }
1392     for (q=0; q<numQuadNodes; ++q) {
1393    
1394     x0=quadNodes[INDEX2(0,q,DIM)];
1395     w=f*quadWeights[q];
1396    
1397     for (s=0; s<numSubElements; ++s) {
1398     new_quadWeights[INDEX2(q,s, numQuadNodes)] =w;
1399     new_quadNodes[INDEX3(0,q,s, DIM,numQuadNodes)] =(x0+s)*f;
1400     for (i=0;i<numF;i++) new_dFdv[INDEX4(i,0,q,s, numF, DIM,numQuadNodes)] = dFdv[INDEX3(i,0,numF, q,DIM)]*f;
1401     }
1402    
1403     }
1404     #undef DIM
1405     return numSubElements*numQuadNodes;
1406     }
1407     #define HALF 0.5
1408     #define TWO 2.
1409     dim_t Finley_Quad_MacroTri(dim_t numSubElements, int numQuadNodes, double* quadNodes, double* quadWeights, dim_t numF, double* dFdv,
1410     dim_t new_len, double* new_quadNodes, double* new_quadWeights, double* new_dFdv )
1411     {
1412    
1413     #define DIM 2
1414     dim_t q,i;
1415     register double x0, x1, w, df0, df1;
1416    
1417     if (new_len < numSubElements*numQuadNodes) {
1418     Finley_setError(MEMORY_ERROR,"Finley_Quad_MacroTri: array for new qurature scheme is too small");
1419     return -1;
1420     }
1421     if (numSubElements==1) {
1422    
1423     for (q=0; q<numQuadNodes; ++q) {
1424    
1425     x0=quadNodes[INDEX2(0,q,DIM)];
1426     x1=quadNodes[INDEX2(1,q,DIM)];
1427     w=quadWeights[q];
1428    
1429     new_quadWeights[INDEX2(q,0,numQuadNodes)] =w;
1430     new_quadNodes[INDEX3(0,q,0,DIM,numQuadNodes)] =x0;
1431     new_quadNodes[INDEX3(1,q,0,DIM,numQuadNodes)] =x1;
1432     for (i=0;i<numF;i++) {
1433     new_dFdv[INDEX4(i,0,q,0, numF,DIM,numQuadNodes)] = dFdv[INDEX3(i,0,q, numF, DIM)];
1434     new_dFdv[INDEX4(i,1,q,0, numF,DIM,numQuadNodes)] = dFdv[INDEX3(i,1,q, numF, DIM)];
1435     }
1436    
1437     }
1438    
1439     } else if (numSubElements==4) {
1440     const double f = 0.25;
1441     for (q=0; q<numQuadNodes; ++q) {
1442    
1443     x0=quadNodes[INDEX2(0,q,DIM)];
1444     x1=quadNodes[INDEX2(1,q,DIM)];
1445     w=f*quadWeights[q];
1446    
1447     new_quadWeights[INDEX2(q,0,numQuadNodes)] =w;
1448     new_quadNodes[INDEX3(0,q,0,DIM,numQuadNodes)] =HALF*x0;
1449     new_quadNodes[INDEX3(1,q,0,DIM,numQuadNodes)] =HALF*x1;
1450    
1451     new_quadWeights[INDEX2(q,1,numQuadNodes)] =w;
1452     new_quadNodes[INDEX3(0,q,1,DIM,numQuadNodes)] =HALF*x0;
1453     new_quadNodes[INDEX3(1,q,1,DIM,numQuadNodes)] =HALF*(x1+1);
1454    
1455     new_quadWeights[INDEX2(q,2,numQuadNodes)] =w;
1456     new_quadNodes[INDEX3(0,q,2,DIM,numQuadNodes)] =HALF*(x0+1);
1457     new_quadNodes[INDEX3(1,q,2,DIM,numQuadNodes)] =HALF*x1;
1458    
1459     new_quadWeights[INDEX2(q,3,numQuadNodes)] =w;
1460     new_quadNodes[INDEX3(0,q,3,DIM,numQuadNodes)] =HALF*(1-x0);
1461     new_quadNodes[INDEX3(1,q,3,DIM,numQuadNodes)] =HALF*(1-x1);
1462    
1463     for (i=0;i<numF;i++) {
1464     df0=dFdv[INDEX3(i,0,q, numF, DIM)]*TWO;
1465     df1=dFdv[INDEX3(i,1,q, numF, DIM)]*TWO;
1466    
1467     new_dFdv[INDEX4(i,0,q,0, numF,DIM,numQuadNodes)] = df0;
1468     new_dFdv[INDEX4(i,1,q,0, numF,DIM,numQuadNodes)] = df1;
1469    
1470     new_dFdv[INDEX4(i,0,q,1, numF,DIM,numQuadNodes)] = df0;
1471     new_dFdv[INDEX4(i,1,q,1, numF,DIM,numQuadNodes)] = df1;
1472    
1473     new_dFdv[INDEX4(i,0,q,2, numF,DIM,numQuadNodes)] = df0;
1474     new_dFdv[INDEX4(i,1,q,2, numF,DIM,numQuadNodes)] = df1;
1475    
1476     new_dFdv[INDEX4(i,0,q,3, numF,DIM,numQuadNodes)] = -df0;
1477     new_dFdv[INDEX4(i,1,q,3, numF,DIM,numQuadNodes)] = -df1;
1478     }
1479    
1480    
1481     }
1482     } else {
1483     Finley_setError(MEMORY_ERROR,"Finley_Quad_MacroTri: unable to create quadrature scheme for macro element.");
1484     return -1;
1485     }
1486     #undef DIM
1487     return numSubElements*numQuadNodes;
1488     }
1489    
1490     dim_t Finley_Quad_MacroRec(dim_t numSubElements, int numQuadNodes, double* quadNodes, double* quadWeights, dim_t numF, double* dFdv,
1491     dim_t new_len, double* new_quadNodes, double* new_quadWeights, double* new_dFdv )
1492     {
1493    
1494     #define DIM 2
1495     dim_t q,i;
1496     register double x0, x1, w, df0, df1;
1497    
1498     if (new_len < numSubElements*numQuadNodes) {
1499     Finley_setError(MEMORY_ERROR,"Finley_Quad_MacroRec: array for new qurature scheme is too small");
1500     return -1;
1501     }
1502     if (numSubElements==1) {
1503    
1504     for (q=0; q<numQuadNodes; ++q) {
1505    
1506     x0=quadNodes[INDEX2(0,q,DIM)];
1507     x1=quadNodes[INDEX2(1,q,DIM)];
1508     w=quadWeights[q];
1509    
1510     new_quadWeights[INDEX2(q,0,numQuadNodes)] =w;
1511     new_quadNodes[INDEX3(0,q,0,DIM,numQuadNodes)] =x0;
1512     new_quadNodes[INDEX3(1,q,0,DIM,numQuadNodes)] =x1;
1513     for (i=0;i<numF;i++) {
1514     new_dFdv[INDEX4(i,0,q,0, numF, DIM,numQuadNodes)] = dFdv[INDEX3(i,0, q,numF, DIM)];
1515     new_dFdv[INDEX4(i,1,q,0, numF, DIM,numQuadNodes)] = dFdv[INDEX3(i,1, q,numF, DIM)];
1516     }
1517    
1518     }
1519    
1520     } else if (numSubElements==4) {
1521     const double f = 0.25;
1522     for (q=0; q<numQuadNodes; ++q) {
1523    
1524     x0=quadNodes[INDEX2(0,q,DIM)];
1525     x1=quadNodes[INDEX2(1,q,DIM)];
1526     w=f*quadWeights[q];
1527    
1528     new_quadWeights[INDEX2(q,0,numQuadNodes)] =w;
1529     new_quadNodes[INDEX3(0,q,0,DIM,numQuadNodes)] =HALF*x0;
1530     new_quadNodes[INDEX3(1,q,0,DIM,numQuadNodes)] =HALF*x1;
1531    
1532     new_quadWeights[INDEX2(q,1,numQuadNodes)] =w;
1533     new_quadNodes[INDEX3(0,q,1,DIM,numQuadNodes)] =HALF*x0;
1534     new_quadNodes[INDEX3(1,q,1,DIM,numQuadNodes)] =HALF*(x1+1);
1535    
1536     new_quadWeights[INDEX2(q,2,numQuadNodes)] =w;
1537     new_quadNodes[INDEX3(0,q,2,DIM,numQuadNodes)] =HALF*(x0+1);
1538     new_quadNodes[INDEX3(1,q,2,DIM,numQuadNodes)] =HALF*x1;
1539    
1540     new_quadWeights[INDEX2(q,3,numQuadNodes)] =w;
1541     new_quadNodes[INDEX3(0,q,3,DIM,numQuadNodes)] =HALF*(x0+1);
1542     new_quadNodes[INDEX3(1,q,3,DIM,numQuadNodes)] =HALF*(x1+1);
1543    
1544     for (i=0;i<numF;i++) {
1545     df0=dFdv[INDEX3(i,0,q, numF, DIM)]*TWO;
1546     df1=dFdv[INDEX3(i,1,q, numF, DIM)]*TWO;
1547    
1548     new_dFdv[INDEX4(i,0,q,0, numF,DIM,numQuadNodes)] = df0;
1549     new_dFdv[INDEX4(i,1,q,0, numF,DIM,numQuadNodes)] = df1;
1550    
1551     new_dFdv[INDEX4(i,0,q,1, numF,DIM,numQuadNodes)] = df0;
1552     new_dFdv[INDEX4(i,1,q,1, numF,DIM,numQuadNodes)] = df1;
1553    
1554     new_dFdv[INDEX4(i,0,q,2, numF,DIM,numQuadNodes)] = df0;
1555     new_dFdv[INDEX4(i,1,q,2, numF,DIM,numQuadNodes)] = df1;
1556    
1557     new_dFdv[INDEX4(i,0,q,3, numF,DIM,numQuadNodes)] = df0;
1558     new_dFdv[INDEX4(i,1,q,3, numF,DIM,numQuadNodes)] = df1;
1559     }
1560    
1561     }
1562     } else {
1563     Finley_setError(MEMORY_ERROR,"Finley_Quad_MacroRec: unable to create quadrature scheme for macro element.");
1564     return -1;
1565     }
1566     #undef DIM
1567     return numSubElements*numQuadNodes;
1568     }
1569    
1570    
1571     dim_t Finley_Quad_MacroTet(dim_t numSubElements, int numQuadNodes, double* quadNodes, double* quadWeights, dim_t numF, double* dFdv,
1572     dim_t new_len, double* new_quadNodes, double* new_quadWeights, double* new_dFdv )
1573     {
1574     #define DIM 3
1575     dim_t q, i;
1576     register double x0, x1, x2, w, df0, df1, df2;
1577    
1578     if (new_len < numSubElements*numQuadNodes) {
1579     Finley_setError(MEMORY_ERROR,"Finley_Quad_MacroTet: array for new qurature scheme is too small");
1580     return -1;
1581     }
1582     if (numSubElements==1) {
1583    
1584     for (q=0; q<numQuadNodes; ++q) {
1585    
1586     x0=quadNodes[INDEX2(0,q,DIM)];
1587     x1=quadNodes[INDEX2(1,q,DIM)];
1588     x2=quadNodes[INDEX2(2,q,DIM)];
1589     w=quadWeights[q];
1590    
1591     new_quadWeights[INDEX2(q,0,numQuadNodes)] =w;
1592     new_quadNodes[INDEX3(0,q,0,DIM,numQuadNodes)] =x0;
1593     new_quadNodes[INDEX3(1,q,0,DIM,numQuadNodes)] =x1;
1594     new_quadNodes[INDEX3(2,q,0,DIM,numQuadNodes)] =x2;
1595    
1596     for (i=0;i<numF;i++) {
1597     new_dFdv[INDEX4(i,0,q,0, numF, DIM,numQuadNodes)] = dFdv[INDEX3(i,0,q, numF, DIM)];
1598     new_dFdv[INDEX4(i,1,q,0, numF, DIM,numQuadNodes)] = dFdv[INDEX3(i,1,q, numF, DIM)];
1599     new_dFdv[INDEX4(i,2,q,0, numF, DIM,numQuadNodes)] = dFdv[INDEX3(i,2,q, numF, DIM)];
1600     }
1601     }
1602    
1603     } else if (numSubElements==8) {
1604     const double f = 0.125;
1605     for (q=0; q<numQuadNodes; ++q) {
1606    
1607     x0=quadNodes[INDEX2(0,q,DIM)];
1608     x1=quadNodes[INDEX2(1,q,DIM)];
1609     x2=quadNodes[INDEX2(2,q,DIM)];
1610     w=f*quadWeights[q];
1611    
1612     new_quadWeights[INDEX2(q,0,numQuadNodes)] =w;
1613     new_quadNodes[INDEX3(0,q,0,DIM,numQuadNodes)] =HALF*x0;
1614     new_quadNodes[INDEX3(1,q,0,DIM,numQuadNodes)] =HALF*x1;
1615     new_quadNodes[INDEX3(2,q,0,DIM,numQuadNodes)] =HALF*x2;
1616    
1617     new_quadWeights[INDEX2(q,1,numQuadNodes)] =w;
1618     new_quadNodes[INDEX3(0,q,1,DIM,numQuadNodes)] =HALF*(x0+1);
1619     new_quadNodes[INDEX3(1,q,1,DIM,numQuadNodes)] =HALF*x1;
1620     new_quadNodes[INDEX3(2,q,1,DIM,numQuadNodes)] =HALF*x2;
1621    
1622     new_quadWeights[INDEX2(q,2,numQuadNodes)] =w;
1623     new_quadNodes[INDEX3(0,q,2,DIM,numQuadNodes)] =HALF*x0;
1624     new_quadNodes[INDEX3(1,q,2,DIM,numQuadNodes)] =HALF*(x1+1);
1625     new_quadNodes[INDEX3(2,q,2,DIM,numQuadNodes)] =HALF*x2;
1626    
1627     new_quadWeights[INDEX2(q,3,numQuadNodes)] =w;
1628     new_quadNodes[INDEX3(0,q,3,DIM,numQuadNodes)] =HALF*x0;
1629     new_quadNodes[INDEX3(1,q,3,DIM,numQuadNodes)] =HALF*x1;
1630     new_quadNodes[INDEX3(2,q,3,DIM,numQuadNodes)] =HALF*(x2+1);
1631    
1632     new_quadWeights[INDEX2(q,4,numQuadNodes)] =w;
1633     new_quadNodes[INDEX3(0,q,4,DIM,numQuadNodes)] =HALF*(1-x1);
1634     new_quadNodes[INDEX3(1,q,4,DIM,numQuadNodes)] =HALF*(x0+x1);
1635     new_quadNodes[INDEX3(2,q,4,DIM,numQuadNodes)] =HALF*x2;
1636    
1637     new_quadWeights[INDEX2(q,5,numQuadNodes)] =w;
1638     new_quadNodes[INDEX3(0,q,5,DIM,numQuadNodes)] =HALF*(1-x0-x2);
1639     new_quadNodes[INDEX3(1,q,5,DIM,numQuadNodes)] =HALF*(1-x1);
1640     new_quadNodes[INDEX3(2,q,5,DIM,numQuadNodes)] =HALF*(x0+x1);
1641    
1642     new_quadWeights[INDEX2(q,6,numQuadNodes)] =w;
1643     new_quadNodes[INDEX3(0,q,6,DIM,numQuadNodes)] =HALF*x2;
1644     new_quadNodes[INDEX3(1,q,6,DIM,numQuadNodes)] =HALF*(1-x0-x2);
1645     new_quadNodes[INDEX3(2,q,6,DIM,numQuadNodes)] =HALF*(1-x1);
1646    
1647     new_quadWeights[INDEX2(q,7,numQuadNodes)] =w;
1648     new_quadNodes[INDEX3(0,q,7,DIM,numQuadNodes)] =HALF*(x0+x2);
1649     new_quadNodes[INDEX3(1,q,7,DIM,numQuadNodes)] =HALF*x1;
1650     new_quadNodes[INDEX3(2,q,7,DIM,numQuadNodes)] =HALF*(1-x0-x1);
1651    
1652     for (i=0;i<numF;i++) {
1653     df0=dFdv[INDEX3(i,0,q, numF, DIM)]*TWO;
1654     df1=dFdv[INDEX3(i,1,q, numF, DIM)]*TWO;
1655     df2=dFdv[INDEX3(i,2,q, numF, DIM)]*TWO;
1656    
1657     new_dFdv[INDEX4(i,0,q,0, numF,DIM,numQuadNodes)] = df0;
1658     new_dFdv[INDEX4(i,1,q,0, numF,DIM,numQuadNodes)] = df1;
1659     new_dFdv[INDEX4(i,2,q,0, numF,DIM,numQuadNodes)] = df2;
1660    
1661     new_dFdv[INDEX4(i,0,q,1, numF,DIM,numQuadNodes)] = df0;
1662     new_dFdv[INDEX4(i,1,q,1, numF,DIM,numQuadNodes)] = df1;
1663     new_dFdv[INDEX4(i,2,q,1, numF,DIM,numQuadNodes)] = df2;
1664    
1665     new_dFdv[INDEX4(i,0,q,2, numF,DIM,numQuadNodes)] = df0;
1666     new_dFdv[INDEX4(i,1,q,2, numF,DIM,numQuadNodes)] = df1;
1667     new_dFdv[INDEX4(i,2,q,2, numF,DIM,numQuadNodes)] = df2;
1668    
1669     new_dFdv[INDEX4(i,0,q,3, numF,DIM,numQuadNodes)] = df0;
1670     new_dFdv[INDEX4(i,1,q,3, numF,DIM,numQuadNodes)] = df1;
1671     new_dFdv[INDEX4(i,2,q,3, numF,DIM,numQuadNodes)] = df2;
1672    
1673     new_dFdv[INDEX4(i,0,q,4, numF,DIM,numQuadNodes)] = df0-df1;
1674     new_dFdv[INDEX4(i,1,q,4, numF,DIM,numQuadNodes)] = df0;
1675     new_dFdv[INDEX4(i,2,q,4, numF,DIM,numQuadNodes)] = df2;
1676    
1677     new_dFdv[INDEX4(i,0,q,5, numF,DIM,numQuadNodes)] = -df2;
1678     new_dFdv[INDEX4(i,1,q,5, numF,DIM,numQuadNodes)] = df0-df2-df1;
1679     new_dFdv[INDEX4(i,2,q,5, numF,DIM,numQuadNodes)] = df0-df2;
1680    
1681     new_dFdv[INDEX4(i,0,q,6, numF,DIM,numQuadNodes)] = -df0+df2;
1682     new_dFdv[INDEX4(i,1,q,6, numF,DIM,numQuadNodes)] = -df0;
1683     new_dFdv[INDEX4(i,2,q,6, numF,DIM,numQuadNodes)] = -df1;
1684    
1685     new_dFdv[INDEX4(i,0,q,7, numF,DIM,numQuadNodes)] = df2;
1686     new_dFdv[INDEX4(i,1,q,7, numF,DIM,numQuadNodes)] = -df0+df1+df2;
1687     new_dFdv[INDEX4(i,2,q,7, numF,DIM,numQuadNodes)] = -df0+df2;
1688     }
1689    
1690     }
1691     } else {
1692     Finley_setError(MEMORY_ERROR,"Finley_Quad_MacroTet: unable to create quadrature scheme for macro element.");
1693     return -1;
1694     }
1695     #undef DIM
1696     return numSubElements*numQuadNodes;
1697     }
1698    
1699    
1700     dim_t Finley_Quad_MacroHex(dim_t numSubElements, int numQuadNodes, double* quadNodes, double* quadWeights, dim_t numF, double* dFdv,
1701     dim_t new_len, double* new_quadNodes, double* new_quadWeights , double* new_dFdv)
1702     {
1703    
1704     #define DIM 3
1705     dim_t q, i;
1706     register double x0, x1, x2, w, df0, df1, df2;
1707    
1708     if (new_len < numSubElements*numQuadNodes) {
1709     Finley_setError(MEMORY_ERROR,"Finley_Quad_MacroHex: array for new qurature scheme is too small");
1710     return -1;
1711     }
1712     if (numSubElements==1) {
1713    
1714     for (q=0; q<numQuadNodes; ++q) {
1715    
1716     x0=quadNodes[INDEX2(0,q,DIM)];
1717     x1=quadNodes[INDEX2(1,q,DIM)];
1718     x2=quadNodes[INDEX2(2,q,DIM)];
1719     w=quadWeights[q];
1720    
1721     new_quadWeights[INDEX2(q,0,numQuadNodes)] =w;
1722     new_quadNodes[INDEX3(0,q,0,DIM,numQuadNodes)] =x0;
1723     new_quadNodes[INDEX3(1,q,0,DIM,numQuadNodes)] =x1;
1724     new_quadNodes[INDEX3(2,q,0,DIM,numQuadNodes)] =x2;
1725    
1726     for (i=0;i<numF;i++) {
1727     new_dFdv[INDEX4(i,0,q,0, numF, DIM,numQuadNodes)] = dFdv[INDEX3(i,0,q,numF, DIM)];
1728     new_dFdv[INDEX4(i,1,q,0, numF, DIM,numQuadNodes)] = dFdv[INDEX3(i,1,q,numF, DIM)];
1729     new_dFdv[INDEX4(i,2,q,0, numF, DIM,numQuadNodes)] = dFdv[INDEX3(i,2,q,numF, DIM)];
1730     }
1731     }
1732    
1733     } else if (numSubElements==8) {
1734     const double f = 0.125;
1735     for (q=0; q<numQuadNodes; ++q) {
1736    
1737     x0=quadNodes[INDEX2(0,q,DIM)];
1738     x1=quadNodes[INDEX2(1,q,DIM)];
1739     x2=quadNodes[INDEX2(2,q,DIM)];
1740     w=f*quadWeights[q];
1741    
1742     new_quadWeights[INDEX2(q,0,numQuadNodes)] =w;
1743     new_quadNodes[INDEX3(0,q,0,DIM,numQuadNodes)] =HALF*x0;
1744     new_quadNodes[INDEX3(1,q,0,DIM,numQuadNodes)] =HALF*x1;
1745     new_quadNodes[INDEX3(2,q,0,DIM,numQuadNodes)] =HALF*x2;
1746    
1747     new_quadWeights[INDEX2(q,1,numQuadNodes)] =w;
1748     new_quadNodes[INDEX3(0,q,1,DIM,numQuadNodes)] =HALF*(x0+1);
1749     new_quadNodes[INDEX3(1,q,1,DIM,numQuadNodes)] =HALF*x1;
1750     new_quadNodes[INDEX3(2,q,1,DIM,numQuadNodes)] =HALF*x2;
1751    
1752     new_quadWeights[INDEX2(q,2,numQuadNodes)] =w;
1753     new_quadNodes[INDEX3(0,q,2,DIM,numQuadNodes)] =HALF*x0;
1754     new_quadNodes[INDEX3(1,q,2,DIM,numQuadNodes)] =HALF*(x1+1);
1755     new_quadNodes[INDEX3(2,q,2,DIM,numQuadNodes)] =HALF*x2;
1756    
1757     new_quadWeights[INDEX2(q,3,numQuadNodes)] =w;
1758     new_quadNodes[INDEX3(0,q,3,DIM,numQuadNodes)] =HALF*(x0+1);
1759     new_quadNodes[INDEX3(1,q,3,DIM,numQuadNodes)] =HALF*(x1+1);
1760     new_quadNodes[INDEX3(2,q,3,DIM,numQuadNodes)] =HALF*x2;
1761    
1762     new_quadWeights[INDEX2(q,4,numQuadNodes)] =w;
1763     new_quadNodes[INDEX3(0,q,4,DIM,numQuadNodes)] =HALF*x0;
1764     new_quadNodes[INDEX3(1,q,4,DIM,numQuadNodes)] =HALF*x1;
1765     new_quadNodes[INDEX3(2,q,4,DIM,numQuadNodes)] =HALF*(x2+1);
1766    
1767     new_quadWeights[INDEX2(q,5,numQuadNodes)] =w;
1768     new_quadNodes[INDEX3(0,q,5,DIM,numQuadNodes)] =HALF*(x0+1);
1769     new_quadNodes[INDEX3(1,q,5,DIM,numQuadNodes)] =HALF*x1;
1770     new_quadNodes[INDEX3(2,q,5,DIM,numQuadNodes)] =HALF*(x2+1);
1771    
1772     new_quadWeights[INDEX2(q,6,numQuadNodes)] =w;
1773     new_quadNodes[INDEX3(0,q,6,DIM,numQuadNodes)] =HALF*x0;
1774     new_quadNodes[INDEX3(1,q,6,DIM,numQuadNodes)] =HALF*(x1+1);
1775     new_quadNodes[INDEX3(2,q,6,DIM,numQuadNodes)] =HALF*(x2+1);
1776    
1777     new_quadWeights[INDEX2(q,7,numQuadNodes)] =w;
1778     new_quadNodes[INDEX3(0,q,7,DIM,numQuadNodes)] =HALF*(x0+1);
1779     new_quadNodes[INDEX3(1,q,7,DIM,numQuadNodes)] =HALF*(x1+1);
1780     new_quadNodes[INDEX3(2,q,7,DIM,numQuadNodes)] =HALF*(x2+1);
1781    
1782     for (i=0;i<numF;i++) {
1783     df0=dFdv[INDEX3(i,0,q, numF, DIM)]*TWO;
1784     df1=dFdv[INDEX3(i,1,q, numF, DIM)]*TWO;
1785     df2=dFdv[INDEX3(i,2,q, numF, DIM)]*TWO;
1786    
1787     new_dFdv[INDEX4(i,0,q,0, numF,DIM,numQuadNodes)] = df0;
1788     new_dFdv[INDEX4(i,1,q,0, numF,DIM,numQuadNodes)] = df1;
1789     new_dFdv[INDEX4(i,2,q,0, numF,DIM,numQuadNodes)] = df2;
1790    
1791     new_dFdv[INDEX4(i,0,q,1, numF,DIM,numQuadNodes)] = df0;
1792     new_dFdv[INDEX4(i,1,q,1, numF,DIM,numQuadNodes)] = df1;
1793     new_dFdv[INDEX4(i,2,q,1, numF,DIM,numQuadNodes)] = df2;
1794    
1795     new_dFdv[INDEX4(i,0,q,2, numF,DIM,numQuadNodes)] = df0;
1796     new_dFdv[INDEX4(i,1,q,2, numF,DIM,numQuadNodes)] = df1;
1797     new_dFdv[INDEX4(i,2,q,2, numF,DIM,numQuadNodes)] = df2;
1798    
1799     new_dFdv[INDEX4(i,0,q,3, numF,DIM,numQuadNodes)] = df0;
1800     new_dFdv[INDEX4(i,1,q,3, numF,DIM,numQuadNodes)] = df1;
1801     new_dFdv[INDEX4(i,2,q,3, numF,DIM,numQuadNodes)] = df2;
1802    
1803     new_dFdv[INDEX4(i,0,q,4, numF,DIM,numQuadNodes)] = df0;
1804     new_dFdv[INDEX4(i,1,q,4, numF,DIM,numQuadNodes)] = df1;
1805     new_dFdv[INDEX4(i,2,q,4, numF,DIM,numQuadNodes)] = df2;
1806    
1807     new_dFdv[INDEX4(i,0,q,5, numF,DIM,numQuadNodes)] = df0;
1808     new_dFdv[INDEX4(i,1,q,5, numF,DIM,numQuadNodes)] = df1;
1809     new_dFdv[INDEX4(i,2,q,5, numF,DIM,numQuadNodes)] = df2;
1810    
1811     new_dFdv[INDEX4(i,0,q,6, numF,DIM,numQuadNodes)] = df0;
1812     new_dFdv[INDEX4(i,1,q,6, numF,DIM,numQuadNodes)] = df1;
1813     new_dFdv[INDEX4(i,2,q,6, numF,DIM,numQuadNodes)] = df2;
1814    
1815     new_dFdv[INDEX4(i,0,q,7, numF,DIM,numQuadNodes)] = df0;
1816     new_dFdv[INDEX4(i,1,q,7, numF,DIM,numQuadNodes)] = df1;
1817     new_dFdv[INDEX4(i,2,q,7, numF,DIM,numQuadNodes)] = df2;
1818     }
1819    
1820     }
1821     } else {
1822     Finley_setError(MEMORY_ERROR,"Finley_Quad_MacroHex: unable to create quadrature scheme for macro element.");
1823     return -1;
1824     }
1825     #undef DIM
1826     return numSubElements*numQuadNodes;
1827     }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26