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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1388 - (hide annotations)
Fri Jan 11 07:45:58 2008 UTC (11 years, 7 months ago) by trankine
File MIME type: text/plain
File size: 48957 byte(s)
And get the *(&(*&(* name right
1 jgs 82
2 ksteube 1312 /* $Id$ */
3 jgs 82
4 ksteube 1312 /*******************************************************
5     *
6     * Copyright 2003-2007 by ACceSS MNRF
7     * Copyright 2007 by University of Queensland
8     *
9     * http://esscc.uq.edu.au
10     * Primary Business: Queensland, Australia
11     * Licensed under the Open Software License version 3.0
12     * http://www.opensource.org/licenses/osl-3.0.php
13     *
14     *******************************************************/
15 jgs 82
16     /**************************************************************/
17    
18 ksteube 1312 /* Finley: */
19 jgs 82
20     /**************************************************************/
21    
22     #include "Quadrature.h"
23    
24     #define QUADNODES(_K_,_I_) quadNodes[INDEX2(_K_,_I_,DIM)]
25     #define QUADWEIGHTS(_I_) quadWeights[_I_]
26    
27     /**************************************************************/
28    
29     /* get a quadrature scheme with numQuadNodes quadrature nodes for the tri */
30     /* as a queezed scheme on a quad [0,1]^2 */
31    
32     void Finley_Quad_getNodesTri(int numQuadNodes,double* quadNodes,double* quadWeights) {
33     int i;
34 gross 1342 double Q1,Q2,a,b,c,d,e,f,g,u,v,w;
35 jgs 82 #define DIM 2
36    
37 btully 1170 /* the easy cases: */
38 jgs 82
39     if (numQuadNodes==1) {
40     QUADNODES(0,0)=1./3.;
41     QUADNODES(1,0)=1./3.;
42 btully 1170 QUADWEIGHTS(0)=1./2.;
43     } else if (numQuadNodes==3){
44     QUADNODES(0,0)=1./2.;
45     QUADNODES(1,0)=0.;
46     QUADWEIGHTS(0)=1./6.;
47     QUADNODES(0,1)=0.;
48     QUADNODES(1,1)=1./2.;
49     QUADWEIGHTS(1)=1./6.;
50     QUADNODES(0,2)=1./2.;
51     QUADNODES(1,2)=1./2.;
52     QUADWEIGHTS(2)=1./6.;
53     } else if (numQuadNodes==4){
54     QUADNODES(0,0)=1./3.;
55     QUADNODES(1,0)=1./3.;
56     QUADWEIGHTS(0)=-27./96.;
57     QUADNODES(0,1)=0.2;
58     QUADNODES(1,1)=0.2;
59     QUADWEIGHTS(1)=25./96.;
60     QUADNODES(0,2)=0.6;
61     QUADNODES(1,2)=0.2;
62     QUADWEIGHTS(2)=25./96.;
63     QUADNODES(0,3)=0.2;
64     QUADNODES(1,3)=0.6;
65     QUADWEIGHTS(3)=25./96.;
66 gross 1342 } else if (numQuadNodes==6){
67     QUADWEIGHTS(0) = 0.109951743655322/2.;
68     QUADWEIGHTS(1) = 0.109951743655322/2.;
69     QUADWEIGHTS(2) = 0.109951743655322/2.;
70     QUADWEIGHTS(3) = 0.223381589678011/2.;
71     QUADWEIGHTS(4) = 0.223381589678011/2.;
72     QUADWEIGHTS(5) = 0.223381589678011/2.;
73    
74     QUADNODES(0,0) = 0.816847572980459;
75     QUADNODES(0,1) = 0.091576213509771;
76     QUADNODES(0,2) = 0.091576213509771;
77     QUADNODES(0,3) = 0.108103018168070;
78     QUADNODES(0,4) = 0.445948490915965;
79     QUADNODES(0,5) = 0.445948490915965;
80    
81     QUADNODES(1,0) = 0.091576213509771;
82     QUADNODES(1,1) = 0.816847572980459;
83     QUADNODES(1,2) = 0.091576213509771;
84     QUADNODES(1,3) = 0.445948490915965;
85     QUADNODES(1,4) = 0.108103018168070;
86     QUADNODES(1,5) = 0.445948490915965;
87    
88     } else if (numQuadNodes==7){
89     QUADNODES(0,0) = 0.33333333333333333;
90     QUADNODES(0,1) = 0.7974269853530872;
91     QUADNODES(0,2) = 0.10128650732345633;
92     QUADNODES(0,3) = 0.10128650732345633;
93     QUADNODES(0,4) = 0.059715871789769809;
94     QUADNODES(0,5) = 0.47014206410511505;
95     QUADNODES(0,6) = 0.47014206410511505;
96    
97     QUADNODES(1,0) = 0.33333333333333333;
98     QUADNODES(1,1) = 0.10128650732345633;
99     QUADNODES(1,2) = 0.7974269853530872;
100     QUADNODES(1,3) = 0.10128650732345633;
101     QUADNODES(1,4) = 0.47014206410511505;
102     QUADNODES(1,5) = 0.059715871789769809;
103     QUADNODES(1,6) = 0.47014206410511505;
104    
105     QUADWEIGHTS(0) = 0.225/2.;
106     QUADWEIGHTS(1) = 0.12593918054482717/2.;
107     QUADWEIGHTS(2) = 0.12593918054482717/2.;
108     QUADWEIGHTS(3) = 0.12593918054482717/2.;
109     QUADWEIGHTS(4) = 0.13239415278850616/2.;
110     QUADWEIGHTS(5) = 0.13239415278850616/2.;
111     QUADWEIGHTS(6) = 0.13239415278850616/2.;
112    
113     } else if (numQuadNodes==12){
114     a = 0.873821971016996;
115     b = 0.063089014491502;
116     c = 0.501426509658179;
117     d = 0.249286745170910;
118     e = 0.636502499121399;
119     f = 0.310352451033785;
120     g = 0.053145049844816;
121    
122     u = 0.050844906370207/2.;
123     v = 0.116786275726379/2.;
124     w = 0.082851075618374/2.;
125    
126     QUADNODES(0,0) = a;
127     QUADNODES(0,1) = b;
128     QUADNODES(0,2) = b;
129     QUADNODES(0,3) = c;
130     QUADNODES(0,4) = d;
131     QUADNODES(0,5) = d;
132     QUADNODES(0,6) = e;
133     QUADNODES(0,7) = e;
134     QUADNODES(0,8) = f;
135     QUADNODES(0,9) = f;
136     QUADNODES(0,10) = g;
137     QUADNODES(0,11) = g;
138    
139     QUADNODES(1,0) = b;
140     QUADNODES(1,1) = a;
141     QUADNODES(1,2) = b;
142     QUADNODES(1,3) = d;
143     QUADNODES(1,4) = c;
144     QUADNODES(1,5) = d;
145     QUADNODES(1,6) = f;
146     QUADNODES(1,7) = g;
147     QUADNODES(1,8) = e;
148     QUADNODES(1,9) = g;
149     QUADNODES(1,10) = e;
150     QUADNODES(1,11) = f;
151    
152     QUADWEIGHTS(0)= u;
153     QUADWEIGHTS(1)= u;
154     QUADWEIGHTS(2)= u;
155     QUADWEIGHTS(3)= v;
156     QUADWEIGHTS(4)= v;
157     QUADWEIGHTS(5)= v;
158     QUADWEIGHTS(6)= w;
159     QUADWEIGHTS(7)= w;
160     QUADWEIGHTS(8)= w;
161     QUADWEIGHTS(9)= w;
162     QUADWEIGHTS(10)= w;
163     QUADWEIGHTS(11)= w;
164    
165     } else if (numQuadNodes==13){
166     QUADWEIGHTS(0) =-0.149570044467670/2.;
167     QUADWEIGHTS(1) = 0.175615257433204/2.;
168     QUADWEIGHTS(2) = 0.175615257433204/2.;
169     QUADWEIGHTS(3) = 0.175615257433204/2.;
170     QUADWEIGHTS(4) = 0.053347235608839/2.;
171     QUADWEIGHTS(5) = 0.053347235608839/2.;
172     QUADWEIGHTS(6) = 0.053347235608839/2.;
173     QUADWEIGHTS(7) = 0.077113760890257/2.;
174     QUADWEIGHTS(8) = 0.077113760890257/2.;
175     QUADWEIGHTS(9) = 0.077113760890257/2.;
176     QUADWEIGHTS(10) = 0.077113760890257/2.;
177     QUADWEIGHTS(11) = 0.077113760890257/2.;
178     QUADWEIGHTS(12) = 0.077113760890257/2.;
179    
180     QUADNODES(0,0) = 0.3333333333333333;
181     QUADNODES(0,1) = 0.479308067841923;
182     QUADNODES(0,2) = 0.260345966079038;
183     QUADNODES(0,3) = 0.260345966079038;
184     QUADNODES(0,4) = 0.869739794195568;
185     QUADNODES(0,5) = 0.065130102902216;
186     QUADNODES(0,6) = 0.065130102902216;
187     QUADNODES(0,7) = 0.638444188569809;
188     QUADNODES(0,8) = 0.638444188569809;
189     QUADNODES(0,9) = 0.048690315425316;
190     QUADNODES(0,10) = 0.048690315425316;
191     QUADNODES(0,11) = 0.312865496004875;
192     QUADNODES(0,12) = 0.312865496004875;
193    
194     QUADNODES(1,0) = 0.3333333333333333;
195     QUADNODES(1,1) = 0.260345966079038;
196     QUADNODES(1,2) = 0.479308067841923;
197     QUADNODES(1,3) = 0.260345966079038;
198     QUADNODES(1,4) = 0.065130102902216;
199     QUADNODES(1,5) = 0.869739794195568;
200     QUADNODES(1,6) = 0.065130102902216;
201     QUADNODES(1,7) = 0.048690315425316;
202     QUADNODES(1,8) = 0.312865496004875;
203     QUADNODES(1,9) = 0.638444188569809;
204     QUADNODES(1,10) = 0.312865496004875;
205     QUADNODES(1,11) = 0.638444188569809;
206     QUADNODES(1,12) = 0.048690315425316;
207    
208     } else if (numQuadNodes==16){
209     QUADWEIGHTS(0) = 0.07215780;
210     QUADWEIGHTS(1) = 0.04754582;
211     QUADWEIGHTS(2) = 0.04754582;
212     QUADWEIGHTS(3) = 0.04754582;
213     QUADWEIGHTS(4) = 0.01622925;
214     QUADWEIGHTS(5) = 0.01622925;
215     QUADWEIGHTS(6) = 0.01622925;
216     QUADWEIGHTS(7) = 0.05160869;
217     QUADWEIGHTS(8) = 0.05160869;
218     QUADWEIGHTS(9) = 0.05160869;
219     QUADWEIGHTS(10) = 0.01361516;
220     QUADWEIGHTS(11) = 0.01361516;
221     QUADWEIGHTS(12) = 0.01361516;
222     QUADWEIGHTS(13) = 0.01361516;
223     QUADWEIGHTS(14) = 0.01361516;
224     QUADWEIGHTS(15) = 0.01361516;
225    
226     QUADNODES(0,0) = 0.3333333;
227     QUADNODES(0,1) = 0.08141482;
228     QUADNODES(0,2) = 0.4592926;
229     QUADNODES(0,3) = 0.4592926;
230     QUADNODES(0,4) = 0.8989055;
231     QUADNODES(0,5) = 0.05054723;
232     QUADNODES(0,6) = 0.05054723;
233     QUADNODES(0,7) = 0.6588614;
234     QUADNODES(0,8) = 0.1705693;
235     QUADNODES(0,9) = 0.1705693;
236     QUADNODES(0,10) = 0.008394777;
237     QUADNODES(0,11) = 0.008394777;
238     QUADNODES(0,12) = 0.7284924;
239     QUADNODES(0,13) = 0.7284924;
240     QUADNODES(0,14) = 0.2631128;
241     QUADNODES(0,15) = 0.2631128;
242    
243     QUADNODES(1,0) = 0.3333333;
244     QUADNODES(1,1) = 0.4592926;
245     QUADNODES(1,2) = 0.08141482;
246     QUADNODES(1,3) = 0.4592926;
247     QUADNODES(1,4) = 0.05054723;
248     QUADNODES(1,5) = 0.8989055;
249     QUADNODES(1,6) = 0.05054723;
250     QUADNODES(1,7) = 0.1705693;
251     QUADNODES(1,8) = 0.6588614;
252     QUADNODES(1,9) = 0.1705693;
253     QUADNODES(1,10) = 0.7284924;
254     QUADNODES(1,11) = 0.2631128;
255     QUADNODES(1,12) = 0.008394777;
256     QUADNODES(1,13) = 0.2631128;
257     QUADNODES(1,14) = 0.008394777;
258     QUADNODES(1,15) = 0.7284924;
259    
260     } else if (numQuadNodes==19){
261     QUADWEIGHTS(0) = 0.04856790;
262     QUADWEIGHTS(1) = 0.01566735;
263     QUADWEIGHTS(2) = 0.01566735;
264     QUADWEIGHTS(3) = 0.01566735;
265     QUADWEIGHTS(4) = 0.03891377;
266     QUADWEIGHTS(5) = 0.03891377;
267     QUADWEIGHTS(6) = 0.03891377;
268     QUADWEIGHTS(7) = 0.03982387;
269     QUADWEIGHTS(8) = 0.03982387;
270     QUADWEIGHTS(9) = 0.03982387;
271     QUADWEIGHTS(10) = 0.01278884;
272     QUADWEIGHTS(11) = 0.01278884;
273     QUADWEIGHTS(12) = 0.01278884;
274     QUADWEIGHTS(13) = 0.02164177;
275     QUADWEIGHTS(14) = 0.02164177;
276     QUADWEIGHTS(15) = 0.02164177;
277     QUADWEIGHTS(16) = 0.02164177;
278     QUADWEIGHTS(17) = 0.02164177;
279     QUADWEIGHTS(18) = 0.02164177;
280    
281     QUADNODES(0,0) = 0.3333333;
282     QUADNODES(0,1) = 0.02063496;
283     QUADNODES(0,2) = 0.4896825;
284     QUADNODES(0,3) = 0.4896825;
285     QUADNODES(0,4) = 0.1258208;
286     QUADNODES(0,5) = 0.4370896;
287     QUADNODES(0,6) = 0.4370896;
288     QUADNODES(0,7) = 0.6235929;
289     QUADNODES(0,8) = 0.1882035;
290     QUADNODES(0,9) = 0.1882035;
291     QUADNODES(0,10) = 0.9105410;
292     QUADNODES(0,11) = 0.04472951;
293     QUADNODES(0,12) = 0.04472951;
294     QUADNODES(0,13) = 0.03683841;
295     QUADNODES(0,14) = 0.03683841;
296     QUADNODES(0,15) = 0.7411986;
297     QUADNODES(0,16) = 0.7411986;
298     QUADNODES(0,17) = 0.2219630;
299     QUADNODES(0,18) = 0.2219630;
300    
301     QUADNODES(1,0) = 0.3333333;
302     QUADNODES(1,1) = 0.4896825;
303     QUADNODES(1,2) = 0.02063496;
304     QUADNODES(1,3) = 0.4896825;
305     QUADNODES(1,4) = 0.4370896;
306     QUADNODES(1,5) = 0.1258208;
307     QUADNODES(1,6) = 0.4370896;
308     QUADNODES(1,7) = 0.1882035;
309     QUADNODES(1,8) = 0.6235929;
310     QUADNODES(1,9) = 0.1882035;
311     QUADNODES(1,10) = 0.04472951;
312     QUADNODES(1,11) = 0.9105410;
313     QUADNODES(1,12) = 0.04472951;
314     QUADNODES(1,13) = 0.7411986;
315     QUADNODES(1,14) = 0.2219630;
316     QUADNODES(1,15) = 0.03683841;
317     QUADNODES(1,16) = 0.2219630;
318     QUADNODES(1,17) = 0.03683841;
319     QUADNODES(1,18) = 0.7411986;
320 jgs 82 } else {
321    
322     /* get scheme on [0.1]^2 */
323     Finley_Quad_getNodesRec(numQuadNodes,quadNodes,quadWeights);
324 jgs 150 if (! Finley_noError()) return;
325 jgs 82
326     /* squeeze it: */
327    
328     for (i=0;i<numQuadNodes;i++) {
329     Q1=QUADNODES(0,i);
330     Q2=QUADNODES(1,i);
331     QUADWEIGHTS(i)=QUADWEIGHTS(i)*(1.-(1./2.)*(Q1+Q2));
332     QUADNODES(0,i)=Q1*(1.-(1./2.)*Q2);
333     QUADNODES(1,i)=Q2*(1.-(1./2.)*Q1);
334     }
335     }
336     #undef DIM
337 gross 1342
338    
339 jgs 82 }
340    
341     /**************************************************************/
342    
343     /* get a quadrature scheme with numQuadNodes quadrature nodes for the tet */
344     /* as a queezed scheme on a hex [0,1]^3 */
345    
346     void Finley_Quad_getNodesTet(int numQuadNodes,double* quadNodes,double* quadWeights) {
347     int i;
348     double Q1,Q2,Q3,JA11,JA12,JA13,JA21,JA22,JA23,JA31,JA32,JA33,DET;
349 gross 1342 double a,b,c,d,e,f,g,h;
350     double alpha=0.58541019662496852;
351     double beta =0.1381966011250105;
352 jgs 82 #define DIM 3
353    
354 btully 1170 /* the easy cases: */
355 jgs 82 if (numQuadNodes==1) {
356 btully 1170 QUADNODES(0,0)=0.25;
357     QUADNODES(1,0)=0.25;
358     QUADNODES(2,0)=0.25;
359 jgs 82 QUADWEIGHTS(0)=1./6.;
360 btully 1170 } else if (numQuadNodes==4){
361     QUADNODES(0,0)=beta;
362     QUADNODES(1,0)=beta;
363     QUADNODES(2,0)=beta;
364     QUADWEIGHTS(0)=1./24.;
365     QUADNODES(0,1)=alpha;
366     QUADNODES(1,1)=beta;
367     QUADNODES(2,1)=beta;
368     QUADWEIGHTS(1)=1./24.;
369     QUADNODES(0,2)=beta;
370     QUADNODES(1,2)=alpha;
371     QUADNODES(2,2)=beta;
372     QUADWEIGHTS(2)=1./24.;
373     QUADNODES(0,3)=beta;
374     QUADNODES(1,3)=beta;
375     QUADNODES(2,3)=alpha;
376     QUADWEIGHTS(3)=1./24.;
377     } else if (numQuadNodes==5){
378     QUADNODES(0,0)=1./4.;
379     QUADNODES(1,0)=1./4.;
380     QUADNODES(2,0)=1./4.;
381     QUADWEIGHTS(0)=-2./15.;
382     QUADNODES(0,1)=1./6.;
383     QUADNODES(1,1)=1./6.;
384     QUADNODES(2,1)=1./6.;
385     QUADWEIGHTS(1)=3./40.;
386     QUADNODES(0,2)=1./2.;
387     QUADNODES(1,2)=1./6.;
388     QUADNODES(2,2)=1./6.;
389     QUADWEIGHTS(2)=3./40.;
390     QUADNODES(0,3)=1./6.;
391     QUADNODES(1,3)=1./2.;
392     QUADNODES(2,3)=1./6.;
393     QUADWEIGHTS(3)=3./40.;
394     QUADNODES(0,4)=1./6.;
395     QUADNODES(1,4)=1./6.;
396     QUADNODES(2,4)=1./2.;
397     QUADWEIGHTS(4)=3./40.;
398 gross 1342
399     } else if (numQuadNodes==11){
400    
401     a = 0.25;
402     b = 11.0/14.0;
403     c = 1.0/14.0;
404     d = 0.25 * (1.0 + sqrt ( 5.0 / 14.0 ) );
405     e = 0.25 * (1.0 - sqrt ( 5.0 / 14.0 ) );
406     f = -74.0 / 5625.0;
407     g = 343.0 / 45000.0;
408     h = 56.0 / 2250.0;
409    
410     QUADWEIGHTS(401-401) = f;
411     QUADWEIGHTS(402-401) = g;
412     QUADWEIGHTS(403-401) = g;
413     QUADWEIGHTS(404-401) = g;
414     QUADWEIGHTS(405-401) = g;
415     QUADWEIGHTS(406-401) = h;
416     QUADWEIGHTS(407-401) = h;
417     QUADWEIGHTS(408-401) = h;
418     QUADWEIGHTS(409-401) = h;
419     QUADWEIGHTS(410-401) = h;
420     QUADWEIGHTS(411-401) = h;
421    
422     QUADNODES(0,401-401) = a;
423     QUADNODES(0,402-401) = b;
424     QUADNODES(0,403-401) = c;
425     QUADNODES(0,404-401) = c;
426     QUADNODES(0,405-401) = c;
427     QUADNODES(0,406-401) = d;
428     QUADNODES(0,407-401) = d;
429     QUADNODES(0,408-401) = d;
430     QUADNODES(0,409-401) = e;
431     QUADNODES(0,410-401) = e;
432     QUADNODES(0,411-401) = e;
433    
434     QUADNODES(1,401-401) = a;
435     QUADNODES(1,402-401) = c;
436     QUADNODES(1,403-401) = b;
437     QUADNODES(1,404-401) = c;
438     QUADNODES(1,405-401) = c;
439     QUADNODES(1,406-401) = d;
440     QUADNODES(1,407-401) = e;
441     QUADNODES(1,408-401) = e;
442     QUADNODES(1,409-401) = d;
443     QUADNODES(1,410-401) = d;
444     QUADNODES(1,411-401) = e;
445    
446     QUADNODES(2,401-401) = a;
447     QUADNODES(2,402-401) = c;
448     QUADNODES(2,403-401) = c;
449     QUADNODES(2,404-401) = b;
450     QUADNODES(2,405-401) = c;
451     QUADNODES(2,406-401) = e;
452     QUADNODES(2,407-401) = d;
453     QUADNODES(2,408-401) = e;
454     QUADNODES(2,409-401) = d;
455     QUADNODES(2,410-401) = e;
456     QUADNODES(2,411-401) = d;
457    
458     } else if (numQuadNodes==15){
459     QUADWEIGHTS(412-412) = 0.019753086419753086;
460     QUADWEIGHTS(413-412) = 0.01198951396316977;
461     QUADWEIGHTS(414-412) = 0.01198951396316977;
462     QUADWEIGHTS(415-412) = 0.01198951396316977;
463     QUADWEIGHTS(416-412) = 0.01198951396316977;
464     QUADWEIGHTS(417-412) = 0.011511367871045397;
465     QUADWEIGHTS(418-412) = 0.011511367871045397;
466     QUADWEIGHTS(419-412) = 0.011511367871045397;
467     QUADWEIGHTS(420-412) = 0.011511367871045397;
468     QUADWEIGHTS(421-412) = 0.0088183421516754845;
469     QUADWEIGHTS(422-412) = 0.0088183421516754845;
470     QUADWEIGHTS(423-412) = 0.0088183421516754845;
471     QUADWEIGHTS(424-412) = 0.0088183421516754845;
472     QUADWEIGHTS(425-412) = 0.0088183421516754845;
473     QUADWEIGHTS(426-412) = 0.0088183421516754845;
474    
475     QUADNODES(0,412-412) = 0.2500000;
476     QUADNODES(0,413-412) = 0.091971078052723032;
477     QUADNODES(0,414-412) = 0.72408676584183096;
478     QUADNODES(0,415-412) = 0.091971078052723032;
479     QUADNODES(0,416-412) = 0.091971078052723032;
480     QUADNODES(0,417-412) = 0.31979362782962989;
481     QUADNODES(0,418-412) = 0.040619116511110234;
482     QUADNODES(0,419-412) = 0.31979362782962989;
483     QUADNODES(0,420-412) = 0.31979362782962989;
484     QUADNODES(0,421-412) = 0.056350832689629149;
485     QUADNODES(0,422-412) = 0.056350832689629149;
486     QUADNODES(0,423-412) = 0.056350832689629149;
487     QUADNODES(0,424-412) = 0.4436491673103708;
488     QUADNODES(0,425-412) = 0.4436491673103708;
489     QUADNODES(0,426-412) = 0.4436491673103708;
490    
491     QUADNODES(1,412-412) = 0.2500000;
492     QUADNODES(1,413-412) = 0.091971078052723032;
493     QUADNODES(1,414-412) = 0.091971078052723032;
494     QUADNODES(1,415-412) = 0.72408676584183096;
495     QUADNODES(1,416-412) = 0.091971078052723032;
496     QUADNODES(1,417-412) = 0.31979362782962989;
497     QUADNODES(1,418-412) = 0.31979362782962989;
498     QUADNODES(1,419-412) = 0.040619116511110234;
499     QUADNODES(1,420-412) = 0.31979362782962989;
500     QUADNODES(1,421-412) = 0.056350832689629149;
501     QUADNODES(1,422-412) = 0.4436491673103708;
502     QUADNODES(1,423-412) = 0.4436491673103708;
503     QUADNODES(1,424-412) = 0.056350832689629149;
504     QUADNODES(1,425-412) = 0.056350832689629149;
505     QUADNODES(1,426-412) = 0.4436491673103708;
506    
507     QUADNODES(2,412-412) = 0.2500000;
508     QUADNODES(2,413-412) = 0.091971078052723032;
509     QUADNODES(2,414-412) = 0.091971078052723032;
510     QUADNODES(2,415-412) = 0.091971078052723032;
511     QUADNODES(2,416-412) = 0.72408676584183096;
512     QUADNODES(2,417-412) = 0.31979362782962989;
513     QUADNODES(2,418-412) = 0.31979362782962989;
514     QUADNODES(2,419-412) = 0.31979362782962989;
515     QUADNODES(2,420-412) = 0.040619116511110234;
516     QUADNODES(2,421-412) = 0.4436491673103708;
517     QUADNODES(2,422-412) = 0.056350832689629149;
518     QUADNODES(2,423-412) = 0.4436491673103708;
519     QUADNODES(2,424-412) = 0.056350832689629149;
520     QUADNODES(2,425-412) = 0.4436491673103708;
521     QUADNODES(2,426-412) = 0.056350832689629149;
522    
523     } else if (numQuadNodes==24){
524     QUADWEIGHTS(427-427) = 0.006653792;
525     QUADWEIGHTS(428-427) = 0.006653792;
526     QUADWEIGHTS(429-427) = 0.006653792;
527     QUADWEIGHTS(430-427) = 0.006653792;
528     QUADWEIGHTS(431-427) = 0.001679535;
529     QUADWEIGHTS(432-427) = 0.001679535;
530     QUADWEIGHTS(433-427) = 0.001679535;
531     QUADWEIGHTS(434-427) = 0.001679535;
532     QUADWEIGHTS(435-427) = 0.009226197;
533     QUADWEIGHTS(436-427) = 0.009226197;
534     QUADWEIGHTS(437-427) = 0.009226197;
535     QUADWEIGHTS(438-427) = 0.009226197;
536     QUADWEIGHTS(439-427) = 0.008035714;
537     QUADWEIGHTS(440-427) = 0.008035714;
538     QUADWEIGHTS(441-427) = 0.008035714;
539     QUADWEIGHTS(442-427) = 0.008035714;
540     QUADWEIGHTS(443-427) = 0.008035714;
541     QUADWEIGHTS(444-427) = 0.008035714;
542     QUADWEIGHTS(445-427) = 0.008035714;
543     QUADWEIGHTS(446-427) = 0.008035714;
544     QUADWEIGHTS(447-427) = 0.008035714;
545     QUADWEIGHTS(448-427) = 0.008035714;
546     QUADWEIGHTS(449-427) = 0.008035714;
547     QUADWEIGHTS(450-427) = 0.008035714;
548    
549     QUADNODES(0,427-427) = 0.3561914;
550     QUADNODES(0,428-427) = 0.2146029;
551     QUADNODES(0,429-427) = 0.2146029;
552     QUADNODES(0,430-427) = 0.2146029;
553     QUADNODES(0,431-427) = 0.8779781;
554     QUADNODES(0,432-427) = 0.04067396;
555     QUADNODES(0,433-427) = 0.04067396;
556     QUADNODES(0,434-427) = 0.04067396;
557     QUADNODES(0,435-427) = 0.03298633;
558     QUADNODES(0,436-427) = 0.3223379;
559     QUADNODES(0,437-427) = 0.3223379;
560     QUADNODES(0,438-427) = 0.3223379;
561     QUADNODES(0,439-427) = 0.6030057;
562     QUADNODES(0,440-427) = 0.6030057;
563     QUADNODES(0,441-427) = 0.6030057;
564     QUADNODES(0,442-427) = 0.2696723;
565     QUADNODES(0,443-427) = 0.2696723;
566     QUADNODES(0,444-427) = 0.2696723;
567     QUADNODES(0,445-427) = 0.06366100;
568     QUADNODES(0,446-427) = 0.06366100;
569     QUADNODES(0,447-427) = 0.06366100;
570     QUADNODES(0,448-427) = 0.06366100;
571     QUADNODES(0,449-427) = 0.06366100;
572     QUADNODES(0,450-427) = 0.06366100;
573    
574     QUADNODES(1,427-427) = 0.2146029;
575     QUADNODES(1,428-427) = 0.3561914;
576     QUADNODES(1,429-427) = 0.2146029;
577     QUADNODES(1,430-427) = 0.2146029;
578     QUADNODES(1,431-427) = 0.04067396;
579     QUADNODES(1,432-427) = 0.8779781;
580     QUADNODES(1,433-427) = 0.04067396;
581     QUADNODES(1,434-427) = 0.04067396;
582     QUADNODES(1,435-427) = 0.3223379;
583     QUADNODES(1,436-427) = 0.03298633;
584     QUADNODES(1,437-427) = 0.3223379;
585     QUADNODES(1,438-427) = 0.3223379;
586     QUADNODES(1,439-427) = 0.2696723;
587     QUADNODES(1,440-427) = 0.06366100;
588     QUADNODES(1,441-427) = 0.06366100;
589     QUADNODES(1,442-427) = 0.6030057;
590     QUADNODES(1,443-427) = 0.06366100;
591     QUADNODES(1,444-427) = 0.06366100;
592     QUADNODES(1,445-427) = 0.6030057;
593     QUADNODES(1,446-427) = 0.6030057;
594     QUADNODES(1,447-427) = 0.2696723;
595     QUADNODES(1,448-427) = 0.2696723;
596     QUADNODES(1,449-427) = 0.06366100;
597     QUADNODES(1,450-427) = 0.06366100;
598    
599     QUADNODES(2,427-427) = 0.2146029;
600     QUADNODES(2,428-427) = 0.2146029;
601     QUADNODES(2,429-427) = 0.3561914;
602     QUADNODES(2,430-427) = 0.2146029;
603     QUADNODES(2,431-427) = 0.04067396;
604     QUADNODES(2,432-427) = 0.04067396;
605     QUADNODES(2,433-427) = 0.8779781;
606     QUADNODES(2,434-427) = 0.04067396;
607     QUADNODES(2,435-427) = 0.3223379;
608     QUADNODES(2,436-427) = 0.3223379;
609     QUADNODES(2,437-427) = 0.03298633;
610     QUADNODES(2,438-427) = 0.3223379;
611     QUADNODES(2,439-427) = 0.06366100;
612     QUADNODES(2,440-427) = 0.2696723;
613     QUADNODES(2,441-427) = 0.06366100;
614     QUADNODES(2,442-427) = 0.06366100;
615     QUADNODES(2,443-427) = 0.6030057;
616     QUADNODES(2,444-427) = 0.06366100;
617     QUADNODES(2,445-427) = 0.2696723;
618     QUADNODES(2,446-427) = 0.06366100;
619     QUADNODES(2,447-427) = 0.6030057;
620     QUADNODES(2,448-427) = 0.06366100;
621     QUADNODES(2,449-427) = 0.6030057;
622     QUADNODES(2,450-427) = 0.2696723;
623    
624     } else if (numQuadNodes==31){
625     QUADWEIGHTS(451-451) = 0.01826422;
626     QUADWEIGHTS(452-451) = 0.01059994;
627     QUADWEIGHTS(453-451) = 0.01059994;
628     QUADWEIGHTS(454-451) = 0.01059994;
629     QUADWEIGHTS(455-451) = 0.01059994;
630     QUADWEIGHTS(456-451) =-0.06251774;
631     QUADWEIGHTS(457-451) =-0.06251774;
632     QUADWEIGHTS(458-451) =-0.06251774;
633     QUADWEIGHTS(459-451) =-0.06251774;
634     QUADWEIGHTS(460-451) = 0.004891425;
635     QUADWEIGHTS(461-451) = 0.004891425;
636     QUADWEIGHTS(462-451) = 0.004891425;
637     QUADWEIGHTS(463-451) = 0.004891425;
638     QUADWEIGHTS(464-451) = 0.0009700176;
639     QUADWEIGHTS(465-451) = 0.0009700176;
640     QUADWEIGHTS(466-451) = 0.0009700176;
641     QUADWEIGHTS(467-451) = 0.0009700176;
642     QUADWEIGHTS(468-451) = 0.0009700176;
643     QUADWEIGHTS(469-451) = 0.0009700176;
644     QUADWEIGHTS(470-451) = 0.02755732;
645     QUADWEIGHTS(471-451) = 0.02755732;
646     QUADWEIGHTS(472-451) = 0.02755732;
647     QUADWEIGHTS(473-451) = 0.02755732;
648     QUADWEIGHTS(474-451) = 0.02755732;
649     QUADWEIGHTS(475-451) = 0.02755732;
650     QUADWEIGHTS(476-451) = 0.02755732;
651     QUADWEIGHTS(477-451) = 0.02755732;
652     QUADWEIGHTS(478-451) = 0.02755732;
653     QUADWEIGHTS(479-451) = 0.02755732;
654     QUADWEIGHTS(480-451) = 0.02755732;
655     QUADWEIGHTS(481-451) = 0.02755732;
656    
657     QUADNODES(0,451-451) = 0.2500000;
658     QUADNODES(0,452-451) = 0.7653604;
659     QUADNODES(0,453-451) = 0.07821319;
660     QUADNODES(0,454-451) = 0.07821319;
661     QUADNODES(0,455-451) = 0.07821319;
662     QUADNODES(0,456-451) = 0.6344704;
663     QUADNODES(0,457-451) = 0.1218432;
664     QUADNODES(0,458-451) = 0.1218432;
665     QUADNODES(0,459-451) = 0.1218432;
666     QUADNODES(0,460-451) = 0.002382507;
667     QUADNODES(0,461-451) = 0.3325392;
668     QUADNODES(0,462-451) = 0.3325392;
669     QUADNODES(0,463-451) = 0.3325392;
670     QUADNODES(0,464-451) = 0.0000000;
671     QUADNODES(0,465-451) = 0.0000000;
672     QUADNODES(0,466-451) = 0.0000000;
673     QUADNODES(0,467-451) = 0.5000000;
674     QUADNODES(0,468-451) = 0.5000000;
675     QUADNODES(0,469-451) = 0.5000000;
676     QUADNODES(0,470-451) = 0.6000000;
677     QUADNODES(0,471-451) = 0.6000000;
678     QUADNODES(0,472-451) = 0.6000000;
679     QUADNODES(0,473-451) = 0.2000000;
680     QUADNODES(0,474-451) = 0.2000000;
681     QUADNODES(0,475-451) = 0.2000000;
682     QUADNODES(0,476-451) = 0.1000000;
683     QUADNODES(0,477-451) = 0.1000000;
684     QUADNODES(0,478-451) = 0.1000000;
685     QUADNODES(0,479-451) = 0.1000000;
686     QUADNODES(0,480-451) = 0.1000000;
687     QUADNODES(0,481-451) = 0.1000000;
688    
689     QUADNODES(1,451-451) = 0.2500000;
690     QUADNODES(1,452-451) = 0.07821319;
691     QUADNODES(1,453-451) = 0.7653604;
692     QUADNODES(1,454-451) = 0.07821319;
693     QUADNODES(1,455-451) = 0.07821319;
694     QUADNODES(1,456-451) = 0.1218432;
695     QUADNODES(1,457-451) = 0.6344704;
696     QUADNODES(1,458-451) = 0.1218432;
697     QUADNODES(1,459-451) = 0.1218432;
698     QUADNODES(1,460-451) = 0.3325392;
699     QUADNODES(1,461-451) = 0.002382507;
700     QUADNODES(1,462-451) = 0.3325392;
701     QUADNODES(1,463-451) = 0.3325392;
702     QUADNODES(1,464-451) = 0.0000000;
703     QUADNODES(1,465-451) = 0.5000000;
704     QUADNODES(1,466-451) = 0.5000000;
705     QUADNODES(1,467-451) = 0.0000000;
706     QUADNODES(1,468-451) = 0.0000000;
707     QUADNODES(1,469-451) = 0.5000000;
708     QUADNODES(1,470-451) = 0.2000000;
709     QUADNODES(1,471-451) = 0.1000000;
710     QUADNODES(1,472-451) = 0.1000000;
711     QUADNODES(1,473-451) = 0.6000000;
712     QUADNODES(1,474-451) = 0.1000000;
713     QUADNODES(1,475-451) = 0.1000000;
714     QUADNODES(1,476-451) = 0.6000000;
715     QUADNODES(1,477-451) = 0.6000000;
716     QUADNODES(1,478-451) = 0.2000000;
717     QUADNODES(1,479-451) = 0.2000000;
718     QUADNODES(1,480-451) = 0.1000000;
719     QUADNODES(1,481-451) = 0.1000000;
720    
721     QUADNODES(2,451-451) = 0.2500000;
722     QUADNODES(2,452-451) = 0.07821319;
723     QUADNODES(2,453-451) = 0.07821319;
724     QUADNODES(2,454-451) = 0.7653604;
725     QUADNODES(2,455-451) = 0.07821319;
726     QUADNODES(2,456-451) = 0.1218432;
727     QUADNODES(2,457-451) = 0.1218432;
728     QUADNODES(2,458-451) = 0.6344704;
729     QUADNODES(2,459-451) = 0.1218432;
730     QUADNODES(2,460-451) = 0.3325392;
731     QUADNODES(2,461-451) = 0.3325392;
732     QUADNODES(2,462-451) = 0.002382507;
733     QUADNODES(2,463-451) = 0.3325392;
734     QUADNODES(2,464-451) = 0.5000000;
735     QUADNODES(2,465-451) = 0.0000000;
736     QUADNODES(2,466-451) = 0.5000000;
737     QUADNODES(2,467-451) = 0.0000000;
738     QUADNODES(2,468-451) = 0.5000000;
739     QUADNODES(2,469-451) = 0.0000000;
740     QUADNODES(2,470-451) = 0.1000000;
741     QUADNODES(2,471-451) = 0.2000000;
742     QUADNODES(2,472-451) = 0.1000000;
743     QUADNODES(2,473-451) = 0.1000000;
744     QUADNODES(2,474-451) = 0.6000000;
745     QUADNODES(2,475-451) = 0.1000000;
746     QUADNODES(2,476-451) = 0.2000000;
747     QUADNODES(2,477-451) = 0.1000000;
748     QUADNODES(2,478-451) = 0.6000000;
749     QUADNODES(2,479-451) = 0.1000000;
750     QUADNODES(2,480-451) = 0.6000000;
751     QUADNODES(2,481-451) = 0.2000000;
752    
753     } else if (numQuadNodes==45){
754     QUADWEIGHTS(482-482) =-0.03932701;
755     QUADWEIGHTS(483-482) = 0.004081316;
756     QUADWEIGHTS(484-482) = 0.004081316;
757     QUADWEIGHTS(485-482) = 0.004081316;
758     QUADWEIGHTS(486-482) = 0.004081316;
759     QUADWEIGHTS(487-482) = 0.0006580868;
760     QUADWEIGHTS(488-482) = 0.0006580868;
761     QUADWEIGHTS(489-482) = 0.0006580868;
762     QUADWEIGHTS(490-482) = 0.0006580868;
763     QUADWEIGHTS(491-482) = 0.004384259;
764     QUADWEIGHTS(492-482) = 0.004384259;
765     QUADWEIGHTS(493-482) = 0.004384259;
766     QUADWEIGHTS(494-482) = 0.004384259;
767     QUADWEIGHTS(495-482) = 0.004384259;
768     QUADWEIGHTS(496-482) = 0.004384259;
769     QUADWEIGHTS(497-482) = 0.01383006;
770     QUADWEIGHTS(498-482) = 0.01383006;
771     QUADWEIGHTS(499-482) = 0.01383006;
772     QUADWEIGHTS(500-482) = 0.01383006;
773     QUADWEIGHTS(501-482) = 0.01383006;
774     QUADWEIGHTS(502-482) = 0.01383006;
775     QUADWEIGHTS(503-482) = 0.004240437;
776     QUADWEIGHTS(504-482) = 0.004240437;
777     QUADWEIGHTS(505-482) = 0.004240437;
778     QUADWEIGHTS(506-482) = 0.004240437;
779     QUADWEIGHTS(507-482) = 0.004240437;
780     QUADWEIGHTS(508-482) = 0.004240437;
781     QUADWEIGHTS(509-482) = 0.004240437;
782     QUADWEIGHTS(510-482) = 0.004240437;
783     QUADWEIGHTS(511-482) = 0.004240437;
784     QUADWEIGHTS(512-482) = 0.004240437;
785     QUADWEIGHTS(513-482) = 0.004240437;
786     QUADWEIGHTS(514-482) = 0.004240437;
787     QUADWEIGHTS(515-482) = 0.002238740;
788     QUADWEIGHTS(516-482) = 0.002238740;
789     QUADWEIGHTS(517-482) = 0.002238740;
790     QUADWEIGHTS(518-482) = 0.002238740;
791     QUADWEIGHTS(519-482) = 0.002238740;
792     QUADWEIGHTS(520-482) = 0.002238740;
793     QUADWEIGHTS(521-482) = 0.002238740;
794     QUADWEIGHTS(522-482) = 0.002238740;
795     QUADWEIGHTS(523-482) = 0.002238740;
796     QUADWEIGHTS(524-482) = 0.002238740;
797     QUADWEIGHTS(525-482) = 0.002238740;
798     QUADWEIGHTS(526-482) = 0.002238740;
799    
800     QUADNODES(0,482-482) = 0.2500000;
801     QUADNODES(0,483-482) = 0.6175872;
802     QUADNODES(0,484-482) = 0.1274709;
803     QUADNODES(0,485-482) = 0.1274709;
804     QUADNODES(0,486-482) = 0.1274709;
805     QUADNODES(0,487-482) = 0.9037635;
806     QUADNODES(0,488-482) = 0.03207883;
807     QUADNODES(0,489-482) = 0.03207883;
808     QUADNODES(0,490-482) = 0.03207883;
809     QUADNODES(0,491-482) = 0.4502229;
810     QUADNODES(0,492-482) = 0.4502229;
811     QUADNODES(0,493-482) = 0.4502229;
812     QUADNODES(0,494-482) = 0.04977710;
813     QUADNODES(0,495-482) = 0.04977710;
814     QUADNODES(0,496-482) = 0.04977710;
815     QUADNODES(0,497-482) = 0.3162696;
816     QUADNODES(0,498-482) = 0.3162696;
817     QUADNODES(0,499-482) = 0.3162696;
818     QUADNODES(0,500-482) = 0.1837304;
819     QUADNODES(0,501-482) = 0.1837304;
820     QUADNODES(0,502-482) = 0.1837304;
821     QUADNODES(0,503-482) = 0.5132800;
822     QUADNODES(0,504-482) = 0.5132800;
823     QUADNODES(0,505-482) = 0.5132800;
824     QUADNODES(0,506-482) = 0.02291779;
825     QUADNODES(0,507-482) = 0.02291779;
826     QUADNODES(0,508-482) = 0.02291779;
827     QUADNODES(0,509-482) = 0.2319011;
828     QUADNODES(0,510-482) = 0.2319011;
829     QUADNODES(0,511-482) = 0.2319011;
830     QUADNODES(0,512-482) = 0.2319011;
831     QUADNODES(0,513-482) = 0.2319011;
832     QUADNODES(0,514-482) = 0.2319011;
833     QUADNODES(0,515-482) = 0.1937465;
834     QUADNODES(0,516-482) = 0.1937465;
835     QUADNODES(0,517-482) = 0.1937465;
836     QUADNODES(0,518-482) = 0.7303134;
837     QUADNODES(0,519-482) = 0.7303134;
838     QUADNODES(0,520-482) = 0.7303134;
839     QUADNODES(0,521-482) = 0.03797005;
840     QUADNODES(0,522-482) = 0.03797005;
841     QUADNODES(0,523-482) = 0.03797005;
842     QUADNODES(0,524-482) = 0.03797005;
843     QUADNODES(0,525-482) = 0.03797005;
844     QUADNODES(0,526-482) = 0.03797005;
845    
846     QUADNODES(1,482-482) = 0.2500000;
847     QUADNODES(1,483-482) = 0.1274709;
848     QUADNODES(1,484-482) = 0.6175872;
849     QUADNODES(1,485-482) = 0.1274709;
850     QUADNODES(1,486-482) = 0.1274709;
851     QUADNODES(1,487-482) = 0.03207883;
852     QUADNODES(1,488-482) = 0.9037635;
853     QUADNODES(1,489-482) = 0.03207883;
854     QUADNODES(1,490-482) = 0.03207883;
855     QUADNODES(1,491-482) = 0.4502229;
856     QUADNODES(1,492-482) = 0.04977710;
857     QUADNODES(1,493-482) = 0.04977710;
858     QUADNODES(1,494-482) = 0.4502229;
859     QUADNODES(1,495-482) = 0.4502229;
860     QUADNODES(1,496-482) = 0.04977710;
861     QUADNODES(1,497-482) = 0.3162696;
862     QUADNODES(1,498-482) = 0.1837304;
863     QUADNODES(1,499-482) = 0.1837304;
864     QUADNODES(1,500-482) = 0.3162696;
865     QUADNODES(1,501-482) = 0.3162696;
866     QUADNODES(1,502-482) = 0.1837304;
867     QUADNODES(1,503-482) = 0.02291779;
868     QUADNODES(1,504-482) = 0.2319011;
869     QUADNODES(1,505-482) = 0.2319011;
870     QUADNODES(1,506-482) = 0.5132800;
871     QUADNODES(1,507-482) = 0.2319011;
872     QUADNODES(1,508-482) = 0.2319011;
873     QUADNODES(1,509-482) = 0.5132800;
874     QUADNODES(1,510-482) = 0.5132800;
875     QUADNODES(1,511-482) = 0.02291779;
876     QUADNODES(1,512-482) = 0.02291779;
877     QUADNODES(1,513-482) = 0.2319011;
878     QUADNODES(1,514-482) = 0.2319011;
879     QUADNODES(1,515-482) = 0.7303134;
880     QUADNODES(1,516-482) = 0.03797005;
881     QUADNODES(1,517-482) = 0.03797005;
882     QUADNODES(1,518-482) = 0.1937465;
883     QUADNODES(1,519-482) = 0.03797005;
884     QUADNODES(1,520-482) = 0.03797005;
885     QUADNODES(1,521-482) = 0.1937465;
886     QUADNODES(1,522-482) = 0.1937465;
887     QUADNODES(1,523-482) = 0.7303134;
888     QUADNODES(1,524-482) = 0.7303134;
889     QUADNODES(1,525-482) = 0.03797005;
890     QUADNODES(1,526-482) = 0.03797005;
891    
892     QUADNODES(2,482-482) = 0.2500000;
893     QUADNODES(2,483-482) = 0.1274709;
894     QUADNODES(2,484-482) = 0.1274709;
895     QUADNODES(2,485-482) = 0.6175872;
896     QUADNODES(2,486-482) = 0.1274709;
897     QUADNODES(2,487-482) = 0.03207883;
898     QUADNODES(2,488-482) = 0.03207883;
899     QUADNODES(2,489-482) = 0.9037635;
900     QUADNODES(2,490-482) = 0.03207883;
901     QUADNODES(2,491-482) = 0.04977710;
902     QUADNODES(2,492-482) = 0.4502229;
903     QUADNODES(2,493-482) = 0.04977710;
904     QUADNODES(2,494-482) = 0.4502229;
905     QUADNODES(2,495-482) = 0.04977710;
906     QUADNODES(2,496-482) = 0.4502229;
907     QUADNODES(2,497-482) = 0.1837304;
908     QUADNODES(2,498-482) = 0.3162696;
909     QUADNODES(2,499-482) = 0.1837304;
910     QUADNODES(2,500-482) = 0.3162696;
911     QUADNODES(2,501-482) = 0.1837304;
912     QUADNODES(2,502-482) = 0.3162696;
913     QUADNODES(2,503-482) = 0.2319011;
914     QUADNODES(2,504-482) = 0.02291779;
915     QUADNODES(2,505-482) = 0.2319011;
916     QUADNODES(2,506-482) = 0.2319011;
917     QUADNODES(2,507-482) = 0.5132800;
918     QUADNODES(2,508-482) = 0.2319011;
919     QUADNODES(2,509-482) = 0.02291779;
920     QUADNODES(2,510-482) = 0.2319011;
921     QUADNODES(2,511-482) = 0.5132800;
922     QUADNODES(2,512-482) = 0.2319011;
923     QUADNODES(2,513-482) = 0.5132800;
924     QUADNODES(2,514-482) = 0.02291779;
925     QUADNODES(2,515-482) = 0.03797005;
926     QUADNODES(2,516-482) = 0.7303134;
927     QUADNODES(2,517-482) = 0.03797005;
928     QUADNODES(2,518-482) = 0.03797005;
929     QUADNODES(2,519-482) = 0.1937465;
930     QUADNODES(2,520-482) = 0.03797005;
931     QUADNODES(2,521-482) = 0.7303134;
932     QUADNODES(2,522-482) = 0.03797005;
933     QUADNODES(2,523-482) = 0.1937465;
934     QUADNODES(2,524-482) = 0.03797005;
935     QUADNODES(2,525-482) = 0.1937465;
936     QUADNODES(2,526-482) = 0.7303134;
937    
938 jgs 82 } else {
939    
940     /* get scheme on [0.1]^3 */
941    
942     Finley_Quad_getNodesHex(numQuadNodes,quadNodes,quadWeights);
943 jgs 150 if (! Finley_noError()) return;
944 jgs 82
945     /* squeeze it: */
946     for (i=0;i<numQuadNodes;i++) {
947     Q1=QUADNODES(0,i);
948     Q2=QUADNODES(1,i);
949     Q3=QUADNODES(2,i);
950    
951     JA11= (1./3.)*Q2*Q3-(1./2.)*(Q2+Q3) +1.;
952     JA12= (1./3.)*Q1*Q3-(1./2.)*Q1;
953     JA13= (1./3.)*Q1*Q2-(1./2.)*Q1;
954     JA21= (1./3.)*Q2*Q3-(1./2.)*Q2;
955     JA22= (1./3.)*Q1*Q3-(1./2.)*(Q1+Q3) +1.;
956     JA23= (1./3.)*Q1*Q2-(1./2.)*Q2;
957     JA31= (1./3.)*Q2*Q3-(1./2.)*Q3;
958     JA32= (1./3.)*Q1*Q3-(1./2.)*Q3;
959     JA33= (1./3.)*Q1*Q2-(1./2.)*(Q1+Q2) +1.;
960     DET=JA11*JA22*JA33+JA12*JA23*JA31+JA13*JA21*JA32-JA13*JA22*JA31-JA11*JA23*JA32-JA12*JA21*JA33;
961     quadWeights[i]=quadWeights[i]*ABS(DET);
962     QUADNODES(0,i)=Q1*((1./3.)*Q2*Q3-(1./2.)*(Q2+Q3)+1.);
963     QUADNODES(1,i)=Q2*((1./3.)*Q1*Q3-(1./2.)*(Q1+Q3)+1.);
964     QUADNODES(2,i)=Q3*((1./3.)*Q1*Q2-(1./2.)*(Q1+Q2)+1.);
965     }
966     }
967     #undef DIM
968     }
969    
970     /**************************************************************/
971    
972     /* get a quadrature scheme with numQuadNodes quadrature nodes for the quad [0.1]^2 */
973     /* as a X-product of a 1D scheme. */
974    
975     void Finley_Quad_getNodesRec(int numQuadNodes,double* quadNodes,double* quadWeights) {
976 jgs 150 char error_msg[LenErrorMsg_MAX];
977 jgs 82 int numQuadNodes1d,i,j,l;
978 gross 1028 double *quadNodes1d=NULL,*quadWeights1d=NULL;
979     bool_t set=FALSE;
980 jgs 82 #define DIM 2
981    
982 gross 1028 quadNodes1d=TMPMEMALLOC(numQuadNodes,double);
983     quadWeights1d=TMPMEMALLOC(numQuadNodes,double);
984     if (! ( Finley_checkPtr(quadNodes1d) || Finley_checkPtr(quadWeights1d) ) ) {
985     /* find numQuadNodes1d with numQuadNodes1d**2==numQuadNodes: */
986    
987     for (numQuadNodes1d=1;numQuadNodes1d<=MAX_numQuadNodesLine;numQuadNodes1d++) {
988     if (numQuadNodes1d*numQuadNodes1d==numQuadNodes) {
989 jgs 82
990 gross 1028 /* get 1D scheme: */
991    
992     Finley_Quad_getNodesLine(numQuadNodes1d,quadNodes1d,quadWeights1d);
993 jgs 82
994 gross 1028 /* make 2D scheme: */
995 jgs 82
996 gross 1028 if (Finley_noError()) {
997     l=0;
998     for (i=0;i<numQuadNodes1d;i++) {
999     for (j=0;j<numQuadNodes1d;j++) {
1000     QUADNODES(0,l)=quadNodes1d[i];
1001     QUADNODES(1,l)=quadNodes1d[j];
1002     QUADWEIGHTS(l)=quadWeights1d[i]*quadWeights1d[j];
1003     l++;
1004     }
1005     }
1006     set=TRUE;
1007     break;
1008     }
1009     }
1010     }
1011     if (!set) {
1012     sprintf(error_msg,"Finley_Quad_getNodesRec: Illegal number of quadrature nodes %d on hexahedron.",numQuadNodes);
1013     Finley_setError(VALUE_ERROR,error_msg);
1014     }
1015     TMPMEMFREE(quadNodes1d);
1016     TMPMEMFREE(quadWeights1d);
1017     }
1018     #undef DIM
1019 jgs 82 }
1020    
1021     /**************************************************************/
1022    
1023     /* get a quadrature scheme with numQuadNodes quadrature nodes for the hex [0.1]^3 */
1024     /* as a X-product of a 1D scheme. */
1025    
1026     void Finley_Quad_getNodesHex(int numQuadNodes,double* quadNodes,double* quadWeights) {
1027 jgs 150 char error_msg[LenErrorMsg_MAX];
1028 jgs 82 int numQuadNodes1d,i,j,k,l;
1029 gross 1028 double *quadNodes1d=NULL,*quadWeights1d=NULL;
1030     bool_t set;
1031 jgs 82 #define DIM 3
1032    
1033     /* find numQuadNodes1d with numQuadNodes1d**3==numQuadNodes: */
1034    
1035 gross 1028 quadNodes1d=TMPMEMALLOC(numQuadNodes,double);
1036     quadWeights1d=TMPMEMALLOC(numQuadNodes,double);
1037     if (! ( Finley_checkPtr(quadNodes1d) || Finley_checkPtr(quadWeights1d) ) ) {
1038     for (numQuadNodes1d=1;numQuadNodes1d<=MAX_numQuadNodesLine;numQuadNodes1d++) {
1039     if (numQuadNodes1d*numQuadNodes1d*numQuadNodes1d==numQuadNodes) {
1040 jgs 82
1041 gross 1028 /* get 1D scheme: */
1042 jgs 82
1043 gross 1028 Finley_Quad_getNodesLine(numQuadNodes1d,quadNodes1d,quadWeights1d);
1044 jgs 82
1045 gross 1028 /* make 3D scheme: */
1046 jgs 82
1047 gross 1028 if (Finley_noError()) {
1048     l=0;
1049     for (i=0;i<numQuadNodes1d;i++) {
1050     for (j=0;j<numQuadNodes1d;j++) {
1051     for (k=0;k<numQuadNodes1d;k++) {
1052     QUADNODES(0,l)=quadNodes1d[i];
1053     QUADNODES(1,l)=quadNodes1d[j];
1054     QUADNODES(2,l)=quadNodes1d[k];
1055     QUADWEIGHTS(l)=quadWeights1d[i]*quadWeights1d[j]*quadWeights1d[k];
1056     l++;
1057     }
1058     }
1059     }
1060     set=TRUE;
1061     break;
1062     }
1063     }
1064     }
1065     if (!set) {
1066     sprintf(error_msg,"Finley_Quad_getNodesHex: Illegal number of quadrature nodes %d on hexahedron.",numQuadNodes);
1067     Finley_setError(VALUE_ERROR,error_msg);
1068     }
1069     TMPMEMFREE(quadNodes1d);
1070     TMPMEMFREE(quadWeights1d);
1071 jgs 82 }
1072     #undef DIM
1073     }
1074    
1075     /**************************************************************/
1076    
1077     /* get a quadrature scheme with numQuadNodes quadrature nodes for a point. As there */
1078     /* in no quadrature scheme for a point any value for numQuadNodes other than 0 throws */
1079     /* an error. */
1080    
1081     void Finley_Quad_getNodesPoint(int numQuadNodes,double* quadNodes,double* quadWeights) {
1082     if (numQuadNodes!=0) {
1083 gross 964 Finley_setError(VALUE_ERROR,"Finley_Quad_getNodesPoint: There is no quadrature scheme on points.");
1084 jgs 82 }
1085     }
1086    
1087     /**************************************************************/
1088    
1089     /* get a quadrature scheme with numQuadNodes quadrature nodes on the line [0,1]: */
1090     /* The nodes and weights are set from a table. */
1091    
1092     void Finley_Quad_getNodesLine(int numQuadNodes,double* quadNodes,double* quadWeights) {
1093     switch(numQuadNodes) {
1094     case 1:
1095     quadNodes[0]=0.5;
1096     quadWeights[0]=1.;
1097     break;
1098    
1099     case 2:
1100     quadNodes[0]=(1.-.577350269189626)/2.;
1101     quadNodes[1]=(1.+.577350269189626)/2.;
1102     quadWeights[0]=.5;
1103     quadWeights[1]=.5;
1104     break;
1105    
1106     case 3:
1107     quadNodes[0]=(1.-.774596669241483)/2.;
1108     quadNodes[1]=.5;
1109     quadNodes[2]=(1.+.774596669241483)/2.;
1110     quadWeights[0]=5./18.;
1111     quadWeights[1]=4./ 9.;
1112     quadWeights[2]=5./18.;
1113     break;
1114    
1115     case 4:
1116     quadNodes[0]=(1.-.861136311594053)/2.;
1117     quadNodes[1]=(1.-.339981043584856)/2.;
1118     quadNodes[2]=(1.+.339981043584856)/2.;
1119     quadNodes[3]=(1.+.861136311594053)/2.;
1120     quadWeights[0]=.347854845137454/2.;
1121     quadWeights[1]=.652145154862546/2.;
1122     quadWeights[2]=.652145154862546/2.;
1123     quadWeights[3]=.347854845137454/2.;
1124     break;
1125    
1126     case 5:
1127     quadNodes[0]=(1.-.906179845938664)/2.;
1128     quadNodes[1]=(1.-.538469310105683)/2.;
1129     quadNodes[2]= .5;
1130     quadNodes[3]=(1.+.538469310105683)/2.;
1131     quadNodes[4]=(1.+.906179845938664)/2.;
1132     quadWeights[0]=.236926885056189/2.;
1133     quadWeights[1]=.478628670499366/2.;
1134     quadWeights[2]=.568888888888889/2.;
1135     quadWeights[3]=.478628670499366/2.;
1136     quadWeights[4]=.236926885056189/2.;
1137     break;
1138    
1139     case 6:
1140     quadNodes[0]=(1.-.932469514203152)/2.;
1141     quadNodes[1]=(1.-.661209386466265)/2.;
1142     quadNodes[2]=(1.-.238619186083197)/2.;
1143     quadNodes[3]=(1.+.238619186083197)/2.;
1144     quadNodes[4]=(1.+.661209386466265)/2.;
1145     quadNodes[5]=(1.+.932469514203152)/2.;
1146     quadWeights[0]=.171324492379170/2.;
1147     quadWeights[1]=.360761573048139/2.;
1148     quadWeights[2]=.467913934572691/2.;
1149     quadWeights[3]=.467913934572691/2.;
1150     quadWeights[4]=.360761573048139/2.;
1151     quadWeights[5]=.171324492379170/2.;
1152     break;
1153    
1154     case 7:
1155     quadNodes[0]=(1.-.949107912342759)/2.;
1156     quadNodes[1]=(1.-.741531185599394)/2.;
1157     quadNodes[2]=(1.-.405845151377397)/2.;
1158     quadNodes[3]=0.5;
1159     quadNodes[4]=(1.+.405845151377397)/2.;
1160     quadNodes[5]=(1.+.741531185599394)/2.;
1161     quadNodes[6]=(1.+.949107912342759)/2.;
1162     quadWeights[0]= .129484966168870/2.;
1163     quadWeights[1]= .279705391489277/2.;
1164     quadWeights[2]= .381830050505119/2.;
1165     quadWeights[3]= .417959183673469/2.;
1166     quadWeights[4]= .381830050505119/2.;
1167     quadWeights[5]= .279705391489277/2.;
1168     quadWeights[6]= .129484966168870/2.;
1169     break;
1170    
1171     case 8:
1172     quadNodes[0]=(1.-.960289856497536)/2.;
1173     quadNodes[1]=(1.-.796666477413627)/2.;
1174     quadNodes[2]=(1.-.525532409916329)/2.;
1175     quadNodes[3]=(1.-.183434642495650)/2.;
1176     quadNodes[4]=(1.+.183434642495650)/2.;
1177     quadNodes[5]=(1.+.525532409916329)/2.;
1178     quadNodes[6]=(1.+.796666477413627)/2.;
1179     quadNodes[7]=(1.+.960289856497536)/2.;
1180     quadWeights[0]= .101228536290376/2.;
1181     quadWeights[1]= .222381034453374/2.;
1182     quadWeights[2]= .313706645877887/2.;
1183     quadWeights[3]= .362683783378362/2.;
1184     quadWeights[4]= .362683783378362/2.;
1185     quadWeights[5]= .313706645877887/2.;
1186     quadWeights[6]= .222381034453374/2.;
1187     quadWeights[7]= .101228536290376/2.;
1188     break;
1189    
1190     case 9:
1191     quadNodes[0]=(1.-.968160239507626)/2.;
1192     quadNodes[1]=(1.-.836031107326636)/2.;
1193     quadNodes[2]=(1.-.613371432700590)/2.;
1194     quadNodes[3]=(1.-.324253423403809)/2.;
1195     quadNodes[4]= .5;
1196     quadNodes[5]=(1.+.324253423403809)/2.;
1197     quadNodes[6]=(1.+.613371432700590)/2.;
1198     quadNodes[7]=(1.+.836031107326636)/2.;
1199     quadNodes[8]=(1.+.968160239507626)/2.;
1200     quadWeights[0]= .081274388361574/2.;
1201     quadWeights[1]= .180648160694857/2.;
1202     quadWeights[2]= .260610696402935/2.;
1203     quadWeights[3]= .312347077040003/2.;
1204     quadWeights[4]= .330239355001260/2.;
1205     quadWeights[5]= .312347077040003/2.;
1206     quadWeights[6]= .260610696402935/2.;
1207     quadWeights[7]= .180648160694857/2.;
1208     quadWeights[8]= .081274388361574/2.;
1209     break;
1210    
1211     case 10:
1212     quadNodes[0]=(1.-.973906528517172)/2.;
1213     quadNodes[1]=(1.-.865063366688985)/2.;
1214     quadNodes[2]=(1.-.679409568299024)/2.;
1215     quadNodes[3]=(1.-.433395394129247)/2.;
1216     quadNodes[4]=(1.-.148874338981631)/2.;
1217     quadNodes[5]=(1.+.148874338981631)/2.;
1218     quadNodes[6]=(1.+.433395394129247)/2.;
1219     quadNodes[7]=(1.+.679409568299024)/2.;
1220     quadNodes[8]=(1.+.865063366688985)/2.;
1221     quadNodes[9]=(1.+.973906528517172)/2.;
1222     quadWeights[0]= .066671344308688/2.;
1223     quadWeights[1]= .149451349150581/2.;
1224     quadWeights[2]= .219086362515982/2.;
1225     quadWeights[3]= .269266719309996/2.;
1226     quadWeights[4]= .295524224714753/2.;
1227     quadWeights[5]= .295524224714753/2.;
1228     quadWeights[6]= .269266719309996/2.;
1229     quadWeights[7]= .219086362515982/2.;
1230     quadWeights[8]= .149451349150581/2.;
1231     quadWeights[9]= .066671344308688/2.;
1232     break;
1233    
1234     default:
1235 jgs 150 Finley_setError(VALUE_ERROR,"__FILE__: Negative intergration order.");
1236 jgs 82 break;
1237     }
1238     }
1239     /**************************************************************/
1240     /* */
1241     /* the following function are used define the meshes on the surface in the xy-plane */
1242    
1243     /* triangle surface on a tetrahedron */
1244     void Finley_Quad_getNodesTriOnFace(int numQuadNodes,double* quadNodes,double* quadWeights) {
1245     Finley_Quad_makeNodesOnFace(3,numQuadNodes,quadNodes,quadWeights,Finley_Quad_getNodesTri);
1246     }
1247     /* rectangular surface on a hexahedron */
1248     void Finley_Quad_getNodesRecOnFace(int numQuadNodes,double* quadNodes,double* quadWeights) {
1249     Finley_Quad_makeNodesOnFace(3,numQuadNodes,quadNodes,quadWeights,Finley_Quad_getNodesRec);
1250     }
1251     /* line surface on a triangle or rectangle */
1252     void Finley_Quad_getNodesLineOnFace(int numQuadNodes,double* quadNodes,double* quadWeights) {
1253     Finley_Quad_makeNodesOnFace(2,numQuadNodes,quadNodes,quadWeights,Finley_Quad_getNodesLine);
1254     }
1255     /* point surface on a line */
1256     void Finley_Quad_getNodesPointOnFace(int numQuadNodes,double* quadNodes,double* quadWeights) {
1257     Finley_Quad_makeNodesOnFace(1,numQuadNodes,quadNodes,quadWeights,Finley_Quad_getNodesPoint);
1258     }
1259    
1260     void Finley_Quad_makeNodesOnFace(int dim, int numQuadNodes,double* quadNodes,double* quadWeights, Finley_Quad_getNodes getFaceNodes) {
1261     int q,i;
1262 gross 1028 double *quadNodesOnFace=NULL;
1263     #define DIM dim
1264     quadNodesOnFace=TMPMEMALLOC(numQuadNodes*(dim-1),double);
1265 jgs 82
1266 gross 1028 if (! Finley_checkPtr(quadNodesOnFace) ) {
1267     getFaceNodes(numQuadNodes,quadNodesOnFace,quadWeights);
1268     if (Finley_noError()) {
1269     for (q=0;q<numQuadNodes;q++) {
1270     for (i=0;i<dim-1;i++) QUADNODES(i,q)=quadNodesOnFace[INDEX2(i,q,dim-1)];
1271     QUADNODES(dim-1,q)=0;
1272     }
1273     }
1274     TMPMEMFREE(quadNodesOnFace);
1275 jgs 82 }
1276     #undef DIM
1277     }
1278    
1279     /**************************************************************/
1280    
1281     /* The following functions Finley_Quad_getNumNodes* return the nmber of quadrature points needed to */
1282     /* achieve a certain accuracy. Notice that for Tet and Tri the the order is increased */
1283     /* to consider the accuracy reduction through the construction process. */
1284    
1285    
1286     int Finley_Quad_getNumNodesPoint(int order) {
1287     if (order <0 ) {
1288 gross 964 Finley_setError(VALUE_ERROR,"Finley_Quad_getNumNodesPoint: Negative intergration order.");
1289 jgs 82 return -1;
1290     } else {
1291     return 0;
1292     }
1293     }
1294    
1295     int Finley_Quad_getNumNodesLine(int order) {
1296 jgs 150 char error_msg[LenErrorMsg_MAX];
1297 jgs 82 if (order <0 ) {
1298 gross 964 Finley_setError(VALUE_ERROR,"Finley_Quad_getNumNodesPoint: Negative intergration order.");
1299 jgs 82 return -1;
1300     } else {
1301     if (order > 2*MAX_numQuadNodesLine-1) {
1302 gross 964 sprintf(error_msg,"Finley_Quad_getNumNodesPoint: requested integration order %d on line is too large (>%d).",
1303 jgs 82 order,2*MAX_numQuadNodesLine-1);
1304 jgs 150 Finley_setError(VALUE_ERROR,error_msg);
1305 jgs 82 return -1;
1306     } else {
1307 jgs 150 Finley_resetError();
1308 jgs 82 return order/2+1;
1309     }
1310     }
1311     }
1312    
1313     int Finley_Quad_getNumNodesTri(int order) {
1314     int numQuadNodesLine;
1315 gross 1072 if (order<=1) {
1316 jgs 82 return 1;
1317 gross 1342 } else if (order<=2){
1318 btully 1170 return 3;
1319 gross 1342 } else if (order<=3){
1320 btully 1170 return 4;
1321 gross 1342 } else if (order<=4){
1322     return 6;
1323     } else if (order<=5){
1324     return 7;
1325     } else if (order<=6){
1326     return 12;
1327     } else if (order<=7){
1328     return 13;
1329     } else if (order<=8){
1330     return 16;
1331     } else if (order<=9){
1332     return 19;
1333 jgs 82 } else {
1334     numQuadNodesLine=Finley_Quad_getNumNodesLine(order+1);
1335 jgs 150 if (Finley_noError()) {
1336 jgs 82 return numQuadNodesLine*numQuadNodesLine;
1337     } else {
1338     return -1;
1339     }
1340     }
1341     }
1342    
1343     int Finley_Quad_getNumNodesRec(int order) {
1344     int numQuadNodesLine;
1345     numQuadNodesLine=Finley_Quad_getNumNodesLine(order);
1346 jgs 150 if (Finley_noError()) {
1347 jgs 82 return numQuadNodesLine*numQuadNodesLine;
1348     } else {
1349     return -1;
1350     }
1351     }
1352    
1353     int Finley_Quad_getNumNodesTet(int order) {
1354     int numQuadNodesLine;
1355 gross 1072 if (order<=1) {
1356     return 1;
1357 gross 1342 } else if (order<=2){
1358 btully 1170 return 4;
1359 gross 1342 } else if (order<=3){
1360 btully 1170 return 5;
1361 gross 1342 } else if (order<=4){
1362     return 11;
1363     } else if (order<=5){
1364     return 15;
1365     } else if (order<=6){
1366     return 24;
1367     } else if (order<=7){
1368     return 31;
1369     } else if (order<=8){
1370     return 45;
1371 jgs 82 } else {
1372 gross 1072 numQuadNodesLine=Finley_Quad_getNumNodesLine(order+2);
1373     if (Finley_noError()) {
1374     return numQuadNodesLine*numQuadNodesLine*numQuadNodesLine;
1375     } else {
1376     return -1;
1377     }
1378 jgs 82 }
1379     }
1380    
1381     int Finley_Quad_getNumNodesHex(int order) {
1382     int numQuadNodesLine;
1383     numQuadNodesLine=Finley_Quad_getNumNodesLine(order);
1384 jgs 150 if (Finley_noError()) {
1385 jgs 82 return numQuadNodesLine*numQuadNodesLine*numQuadNodesLine;
1386     } else {
1387     return -1;
1388     }
1389     }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26