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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1312 - (hide annotations)
Mon Sep 24 06:18:44 2007 UTC (12 years, 1 month ago) by ksteube
File MIME type: text/plain
File size: 19125 byte(s)
The MPI branch is hereby closed. All future work should be in trunk.

Previously in revision 1295 I merged the latest changes to trunk into trunk-mpi-branch.
In this revision I copied all files from trunk-mpi-branch over the corresponding
trunk files. I did not use 'svn merge', it was a copy.

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     double Q1,Q2;
35     #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 jgs 82 } else {
67    
68     /* get scheme on [0.1]^2 */
69     Finley_Quad_getNodesRec(numQuadNodes,quadNodes,quadWeights);
70 jgs 150 if (! Finley_noError()) return;
71 jgs 82
72     /* squeeze it: */
73    
74     for (i=0;i<numQuadNodes;i++) {
75     Q1=QUADNODES(0,i);
76     Q2=QUADNODES(1,i);
77     QUADWEIGHTS(i)=QUADWEIGHTS(i)*(1.-(1./2.)*(Q1+Q2));
78     QUADNODES(0,i)=Q1*(1.-(1./2.)*Q2);
79     QUADNODES(1,i)=Q2*(1.-(1./2.)*Q1);
80     }
81     }
82     #undef DIM
83     }
84    
85     /**************************************************************/
86    
87     /* get a quadrature scheme with numQuadNodes quadrature nodes for the tet */
88     /* as a queezed scheme on a hex [0,1]^3 */
89    
90     void Finley_Quad_getNodesTet(int numQuadNodes,double* quadNodes,double* quadWeights) {
91     int i;
92     double Q1,Q2,Q3,JA11,JA12,JA13,JA21,JA22,JA23,JA31,JA32,JA33,DET;
93 ksteube 1312 double alpha=0.58541020;
94     double beta =0.13819660;
95 jgs 82 #define DIM 3
96    
97 btully 1170 /* the easy cases: */
98 jgs 82 if (numQuadNodes==1) {
99 btully 1170 QUADNODES(0,0)=0.25;
100     QUADNODES(1,0)=0.25;
101     QUADNODES(2,0)=0.25;
102 jgs 82 QUADWEIGHTS(0)=1./6.;
103 btully 1170 } else if (numQuadNodes==4){
104     QUADNODES(0,0)=beta;
105     QUADNODES(1,0)=beta;
106     QUADNODES(2,0)=beta;
107     QUADWEIGHTS(0)=1./24.;
108     QUADNODES(0,1)=alpha;
109     QUADNODES(1,1)=beta;
110     QUADNODES(2,1)=beta;
111     QUADWEIGHTS(1)=1./24.;
112     QUADNODES(0,2)=beta;
113     QUADNODES(1,2)=alpha;
114     QUADNODES(2,2)=beta;
115     QUADWEIGHTS(2)=1./24.;
116     QUADNODES(0,3)=beta;
117     QUADNODES(1,3)=beta;
118     QUADNODES(2,3)=alpha;
119     QUADWEIGHTS(3)=1./24.;
120     } else if (numQuadNodes==5){
121     QUADNODES(0,0)=1./4.;
122     QUADNODES(1,0)=1./4.;
123     QUADNODES(2,0)=1./4.;
124     QUADWEIGHTS(0)=-2./15.;
125     QUADNODES(0,1)=1./6.;
126     QUADNODES(1,1)=1./6.;
127     QUADNODES(2,1)=1./6.;
128     QUADWEIGHTS(1)=3./40.;
129     QUADNODES(0,2)=1./2.;
130     QUADNODES(1,2)=1./6.;
131     QUADNODES(2,2)=1./6.;
132     QUADWEIGHTS(2)=3./40.;
133     QUADNODES(0,3)=1./6.;
134     QUADNODES(1,3)=1./2.;
135     QUADNODES(2,3)=1./6.;
136     QUADWEIGHTS(3)=3./40.;
137     QUADNODES(0,4)=1./6.;
138     QUADNODES(1,4)=1./6.;
139     QUADNODES(2,4)=1./2.;
140     QUADWEIGHTS(4)=3./40.;
141 jgs 82 } else {
142    
143     /* get scheme on [0.1]^3 */
144    
145     Finley_Quad_getNodesHex(numQuadNodes,quadNodes,quadWeights);
146 jgs 150 if (! Finley_noError()) return;
147 jgs 82
148     /* squeeze it: */
149     for (i=0;i<numQuadNodes;i++) {
150     Q1=QUADNODES(0,i);
151     Q2=QUADNODES(1,i);
152     Q3=QUADNODES(2,i);
153    
154     JA11= (1./3.)*Q2*Q3-(1./2.)*(Q2+Q3) +1.;
155     JA12= (1./3.)*Q1*Q3-(1./2.)*Q1;
156     JA13= (1./3.)*Q1*Q2-(1./2.)*Q1;
157     JA21= (1./3.)*Q2*Q3-(1./2.)*Q2;
158     JA22= (1./3.)*Q1*Q3-(1./2.)*(Q1+Q3) +1.;
159     JA23= (1./3.)*Q1*Q2-(1./2.)*Q2;
160     JA31= (1./3.)*Q2*Q3-(1./2.)*Q3;
161     JA32= (1./3.)*Q1*Q3-(1./2.)*Q3;
162     JA33= (1./3.)*Q1*Q2-(1./2.)*(Q1+Q2) +1.;
163     DET=JA11*JA22*JA33+JA12*JA23*JA31+JA13*JA21*JA32-JA13*JA22*JA31-JA11*JA23*JA32-JA12*JA21*JA33;
164     quadWeights[i]=quadWeights[i]*ABS(DET);
165     QUADNODES(0,i)=Q1*((1./3.)*Q2*Q3-(1./2.)*(Q2+Q3)+1.);
166     QUADNODES(1,i)=Q2*((1./3.)*Q1*Q3-(1./2.)*(Q1+Q3)+1.);
167     QUADNODES(2,i)=Q3*((1./3.)*Q1*Q2-(1./2.)*(Q1+Q2)+1.);
168     }
169     }
170     #undef DIM
171     }
172    
173     /**************************************************************/
174    
175     /* get a quadrature scheme with numQuadNodes quadrature nodes for the quad [0.1]^2 */
176     /* as a X-product of a 1D scheme. */
177    
178     void Finley_Quad_getNodesRec(int numQuadNodes,double* quadNodes,double* quadWeights) {
179 jgs 150 char error_msg[LenErrorMsg_MAX];
180 jgs 82 int numQuadNodes1d,i,j,l;
181 gross 1028 double *quadNodes1d=NULL,*quadWeights1d=NULL;
182     bool_t set=FALSE;
183 jgs 82 #define DIM 2
184    
185 gross 1028 quadNodes1d=TMPMEMALLOC(numQuadNodes,double);
186     quadWeights1d=TMPMEMALLOC(numQuadNodes,double);
187     if (! ( Finley_checkPtr(quadNodes1d) || Finley_checkPtr(quadWeights1d) ) ) {
188     /* find numQuadNodes1d with numQuadNodes1d**2==numQuadNodes: */
189    
190     for (numQuadNodes1d=1;numQuadNodes1d<=MAX_numQuadNodesLine;numQuadNodes1d++) {
191     if (numQuadNodes1d*numQuadNodes1d==numQuadNodes) {
192 jgs 82
193 gross 1028 /* get 1D scheme: */
194    
195     Finley_Quad_getNodesLine(numQuadNodes1d,quadNodes1d,quadWeights1d);
196 jgs 82
197 gross 1028 /* make 2D scheme: */
198 jgs 82
199 gross 1028 if (Finley_noError()) {
200     l=0;
201     for (i=0;i<numQuadNodes1d;i++) {
202     for (j=0;j<numQuadNodes1d;j++) {
203     QUADNODES(0,l)=quadNodes1d[i];
204     QUADNODES(1,l)=quadNodes1d[j];
205     QUADWEIGHTS(l)=quadWeights1d[i]*quadWeights1d[j];
206     l++;
207     }
208     }
209     set=TRUE;
210     break;
211     }
212     }
213     }
214     if (!set) {
215     sprintf(error_msg,"Finley_Quad_getNodesRec: Illegal number of quadrature nodes %d on hexahedron.",numQuadNodes);
216     Finley_setError(VALUE_ERROR,error_msg);
217     }
218     TMPMEMFREE(quadNodes1d);
219     TMPMEMFREE(quadWeights1d);
220     }
221     #undef DIM
222 jgs 82 }
223    
224     /**************************************************************/
225    
226     /* get a quadrature scheme with numQuadNodes quadrature nodes for the hex [0.1]^3 */
227     /* as a X-product of a 1D scheme. */
228    
229     void Finley_Quad_getNodesHex(int numQuadNodes,double* quadNodes,double* quadWeights) {
230 jgs 150 char error_msg[LenErrorMsg_MAX];
231 jgs 82 int numQuadNodes1d,i,j,k,l;
232 gross 1028 double *quadNodes1d=NULL,*quadWeights1d=NULL;
233     bool_t set;
234 jgs 82 #define DIM 3
235    
236     /* find numQuadNodes1d with numQuadNodes1d**3==numQuadNodes: */
237    
238 gross 1028 quadNodes1d=TMPMEMALLOC(numQuadNodes,double);
239     quadWeights1d=TMPMEMALLOC(numQuadNodes,double);
240     if (! ( Finley_checkPtr(quadNodes1d) || Finley_checkPtr(quadWeights1d) ) ) {
241     for (numQuadNodes1d=1;numQuadNodes1d<=MAX_numQuadNodesLine;numQuadNodes1d++) {
242     if (numQuadNodes1d*numQuadNodes1d*numQuadNodes1d==numQuadNodes) {
243 jgs 82
244 gross 1028 /* get 1D scheme: */
245 jgs 82
246 gross 1028 Finley_Quad_getNodesLine(numQuadNodes1d,quadNodes1d,quadWeights1d);
247 jgs 82
248 gross 1028 /* make 3D scheme: */
249 jgs 82
250 gross 1028 if (Finley_noError()) {
251     l=0;
252     for (i=0;i<numQuadNodes1d;i++) {
253     for (j=0;j<numQuadNodes1d;j++) {
254     for (k=0;k<numQuadNodes1d;k++) {
255     QUADNODES(0,l)=quadNodes1d[i];
256     QUADNODES(1,l)=quadNodes1d[j];
257     QUADNODES(2,l)=quadNodes1d[k];
258     QUADWEIGHTS(l)=quadWeights1d[i]*quadWeights1d[j]*quadWeights1d[k];
259     l++;
260     }
261     }
262     }
263     set=TRUE;
264     break;
265     }
266     }
267     }
268     if (!set) {
269     sprintf(error_msg,"Finley_Quad_getNodesHex: Illegal number of quadrature nodes %d on hexahedron.",numQuadNodes);
270     Finley_setError(VALUE_ERROR,error_msg);
271     }
272     TMPMEMFREE(quadNodes1d);
273     TMPMEMFREE(quadWeights1d);
274 jgs 82 }
275     #undef DIM
276     }
277    
278     /**************************************************************/
279    
280     /* get a quadrature scheme with numQuadNodes quadrature nodes for a point. As there */
281     /* in no quadrature scheme for a point any value for numQuadNodes other than 0 throws */
282     /* an error. */
283    
284     void Finley_Quad_getNodesPoint(int numQuadNodes,double* quadNodes,double* quadWeights) {
285     if (numQuadNodes!=0) {
286 gross 964 Finley_setError(VALUE_ERROR,"Finley_Quad_getNodesPoint: There is no quadrature scheme on points.");
287 jgs 82 }
288     }
289    
290     /**************************************************************/
291    
292     /* get a quadrature scheme with numQuadNodes quadrature nodes on the line [0,1]: */
293     /* The nodes and weights are set from a table. */
294    
295     void Finley_Quad_getNodesLine(int numQuadNodes,double* quadNodes,double* quadWeights) {
296     switch(numQuadNodes) {
297     case 1:
298     quadNodes[0]=0.5;
299     quadWeights[0]=1.;
300     break;
301    
302     case 2:
303     quadNodes[0]=(1.-.577350269189626)/2.;
304     quadNodes[1]=(1.+.577350269189626)/2.;
305     quadWeights[0]=.5;
306     quadWeights[1]=.5;
307     break;
308    
309     case 3:
310     quadNodes[0]=(1.-.774596669241483)/2.;
311     quadNodes[1]=.5;
312     quadNodes[2]=(1.+.774596669241483)/2.;
313     quadWeights[0]=5./18.;
314     quadWeights[1]=4./ 9.;
315     quadWeights[2]=5./18.;
316     break;
317    
318     case 4:
319     quadNodes[0]=(1.-.861136311594053)/2.;
320     quadNodes[1]=(1.-.339981043584856)/2.;
321     quadNodes[2]=(1.+.339981043584856)/2.;
322     quadNodes[3]=(1.+.861136311594053)/2.;
323     quadWeights[0]=.347854845137454/2.;
324     quadWeights[1]=.652145154862546/2.;
325     quadWeights[2]=.652145154862546/2.;
326     quadWeights[3]=.347854845137454/2.;
327     break;
328    
329     case 5:
330     quadNodes[0]=(1.-.906179845938664)/2.;
331     quadNodes[1]=(1.-.538469310105683)/2.;
332     quadNodes[2]= .5;
333     quadNodes[3]=(1.+.538469310105683)/2.;
334     quadNodes[4]=(1.+.906179845938664)/2.;
335     quadWeights[0]=.236926885056189/2.;
336     quadWeights[1]=.478628670499366/2.;
337     quadWeights[2]=.568888888888889/2.;
338     quadWeights[3]=.478628670499366/2.;
339     quadWeights[4]=.236926885056189/2.;
340     break;
341    
342     case 6:
343     quadNodes[0]=(1.-.932469514203152)/2.;
344     quadNodes[1]=(1.-.661209386466265)/2.;
345     quadNodes[2]=(1.-.238619186083197)/2.;
346     quadNodes[3]=(1.+.238619186083197)/2.;
347     quadNodes[4]=(1.+.661209386466265)/2.;
348     quadNodes[5]=(1.+.932469514203152)/2.;
349     quadWeights[0]=.171324492379170/2.;
350     quadWeights[1]=.360761573048139/2.;
351     quadWeights[2]=.467913934572691/2.;
352     quadWeights[3]=.467913934572691/2.;
353     quadWeights[4]=.360761573048139/2.;
354     quadWeights[5]=.171324492379170/2.;
355     break;
356    
357     case 7:
358     quadNodes[0]=(1.-.949107912342759)/2.;
359     quadNodes[1]=(1.-.741531185599394)/2.;
360     quadNodes[2]=(1.-.405845151377397)/2.;
361     quadNodes[3]=0.5;
362     quadNodes[4]=(1.+.405845151377397)/2.;
363     quadNodes[5]=(1.+.741531185599394)/2.;
364     quadNodes[6]=(1.+.949107912342759)/2.;
365     quadWeights[0]= .129484966168870/2.;
366     quadWeights[1]= .279705391489277/2.;
367     quadWeights[2]= .381830050505119/2.;
368     quadWeights[3]= .417959183673469/2.;
369     quadWeights[4]= .381830050505119/2.;
370     quadWeights[5]= .279705391489277/2.;
371     quadWeights[6]= .129484966168870/2.;
372     break;
373    
374     case 8:
375     quadNodes[0]=(1.-.960289856497536)/2.;
376     quadNodes[1]=(1.-.796666477413627)/2.;
377     quadNodes[2]=(1.-.525532409916329)/2.;
378     quadNodes[3]=(1.-.183434642495650)/2.;
379     quadNodes[4]=(1.+.183434642495650)/2.;
380     quadNodes[5]=(1.+.525532409916329)/2.;
381     quadNodes[6]=(1.+.796666477413627)/2.;
382     quadNodes[7]=(1.+.960289856497536)/2.;
383     quadWeights[0]= .101228536290376/2.;
384     quadWeights[1]= .222381034453374/2.;
385     quadWeights[2]= .313706645877887/2.;
386     quadWeights[3]= .362683783378362/2.;
387     quadWeights[4]= .362683783378362/2.;
388     quadWeights[5]= .313706645877887/2.;
389     quadWeights[6]= .222381034453374/2.;
390     quadWeights[7]= .101228536290376/2.;
391     break;
392    
393     case 9:
394     quadNodes[0]=(1.-.968160239507626)/2.;
395     quadNodes[1]=(1.-.836031107326636)/2.;
396     quadNodes[2]=(1.-.613371432700590)/2.;
397     quadNodes[3]=(1.-.324253423403809)/2.;
398     quadNodes[4]= .5;
399     quadNodes[5]=(1.+.324253423403809)/2.;
400     quadNodes[6]=(1.+.613371432700590)/2.;
401     quadNodes[7]=(1.+.836031107326636)/2.;
402     quadNodes[8]=(1.+.968160239507626)/2.;
403     quadWeights[0]= .081274388361574/2.;
404     quadWeights[1]= .180648160694857/2.;
405     quadWeights[2]= .260610696402935/2.;
406     quadWeights[3]= .312347077040003/2.;
407     quadWeights[4]= .330239355001260/2.;
408     quadWeights[5]= .312347077040003/2.;
409     quadWeights[6]= .260610696402935/2.;
410     quadWeights[7]= .180648160694857/2.;
411     quadWeights[8]= .081274388361574/2.;
412     break;
413    
414     case 10:
415     quadNodes[0]=(1.-.973906528517172)/2.;
416     quadNodes[1]=(1.-.865063366688985)/2.;
417     quadNodes[2]=(1.-.679409568299024)/2.;
418     quadNodes[3]=(1.-.433395394129247)/2.;
419     quadNodes[4]=(1.-.148874338981631)/2.;
420     quadNodes[5]=(1.+.148874338981631)/2.;
421     quadNodes[6]=(1.+.433395394129247)/2.;
422     quadNodes[7]=(1.+.679409568299024)/2.;
423     quadNodes[8]=(1.+.865063366688985)/2.;
424     quadNodes[9]=(1.+.973906528517172)/2.;
425     quadWeights[0]= .066671344308688/2.;
426     quadWeights[1]= .149451349150581/2.;
427     quadWeights[2]= .219086362515982/2.;
428     quadWeights[3]= .269266719309996/2.;
429     quadWeights[4]= .295524224714753/2.;
430     quadWeights[5]= .295524224714753/2.;
431     quadWeights[6]= .269266719309996/2.;
432     quadWeights[7]= .219086362515982/2.;
433     quadWeights[8]= .149451349150581/2.;
434     quadWeights[9]= .066671344308688/2.;
435     break;
436    
437     default:
438 jgs 150 Finley_setError(VALUE_ERROR,"__FILE__: Negative intergration order.");
439 jgs 82 break;
440     }
441     }
442     /**************************************************************/
443     /* */
444     /* the following function are used define the meshes on the surface in the xy-plane */
445    
446     /* triangle surface on a tetrahedron */
447     void Finley_Quad_getNodesTriOnFace(int numQuadNodes,double* quadNodes,double* quadWeights) {
448     Finley_Quad_makeNodesOnFace(3,numQuadNodes,quadNodes,quadWeights,Finley_Quad_getNodesTri);
449     }
450     /* rectangular surface on a hexahedron */
451     void Finley_Quad_getNodesRecOnFace(int numQuadNodes,double* quadNodes,double* quadWeights) {
452     Finley_Quad_makeNodesOnFace(3,numQuadNodes,quadNodes,quadWeights,Finley_Quad_getNodesRec);
453     }
454     /* line surface on a triangle or rectangle */
455     void Finley_Quad_getNodesLineOnFace(int numQuadNodes,double* quadNodes,double* quadWeights) {
456     Finley_Quad_makeNodesOnFace(2,numQuadNodes,quadNodes,quadWeights,Finley_Quad_getNodesLine);
457     }
458     /* point surface on a line */
459     void Finley_Quad_getNodesPointOnFace(int numQuadNodes,double* quadNodes,double* quadWeights) {
460     Finley_Quad_makeNodesOnFace(1,numQuadNodes,quadNodes,quadWeights,Finley_Quad_getNodesPoint);
461     }
462    
463     void Finley_Quad_makeNodesOnFace(int dim, int numQuadNodes,double* quadNodes,double* quadWeights, Finley_Quad_getNodes getFaceNodes) {
464     int q,i;
465 gross 1028 double *quadNodesOnFace=NULL;
466     #define DIM dim
467     quadNodesOnFace=TMPMEMALLOC(numQuadNodes*(dim-1),double);
468 jgs 82
469 gross 1028 if (! Finley_checkPtr(quadNodesOnFace) ) {
470     getFaceNodes(numQuadNodes,quadNodesOnFace,quadWeights);
471     if (Finley_noError()) {
472     for (q=0;q<numQuadNodes;q++) {
473     for (i=0;i<dim-1;i++) QUADNODES(i,q)=quadNodesOnFace[INDEX2(i,q,dim-1)];
474     QUADNODES(dim-1,q)=0;
475     }
476     }
477     TMPMEMFREE(quadNodesOnFace);
478 jgs 82 }
479     #undef DIM
480     }
481    
482     /**************************************************************/
483    
484     /* The following functions Finley_Quad_getNumNodes* return the nmber of quadrature points needed to */
485     /* achieve a certain accuracy. Notice that for Tet and Tri the the order is increased */
486     /* to consider the accuracy reduction through the construction process. */
487    
488    
489     int Finley_Quad_getNumNodesPoint(int order) {
490     if (order <0 ) {
491 gross 964 Finley_setError(VALUE_ERROR,"Finley_Quad_getNumNodesPoint: Negative intergration order.");
492 jgs 82 return -1;
493     } else {
494     return 0;
495     }
496     }
497    
498     int Finley_Quad_getNumNodesLine(int order) {
499 jgs 150 char error_msg[LenErrorMsg_MAX];
500 jgs 82 if (order <0 ) {
501 gross 964 Finley_setError(VALUE_ERROR,"Finley_Quad_getNumNodesPoint: Negative intergration order.");
502 jgs 82 return -1;
503     } else {
504     if (order > 2*MAX_numQuadNodesLine-1) {
505 gross 964 sprintf(error_msg,"Finley_Quad_getNumNodesPoint: requested integration order %d on line is too large (>%d).",
506 jgs 82 order,2*MAX_numQuadNodesLine-1);
507 jgs 150 Finley_setError(VALUE_ERROR,error_msg);
508 jgs 82 return -1;
509     } else {
510 jgs 150 Finley_resetError();
511 jgs 82 return order/2+1;
512     }
513     }
514     }
515    
516     int Finley_Quad_getNumNodesTri(int order) {
517     int numQuadNodesLine;
518 gross 1072 if (order<=1) {
519 jgs 82 return 1;
520 btully 1170 } else if (order==2){
521     return 3;
522     } else if (order==3){
523     return 4;
524 jgs 82 } else {
525     numQuadNodesLine=Finley_Quad_getNumNodesLine(order+1);
526 jgs 150 if (Finley_noError()) {
527 jgs 82 return numQuadNodesLine*numQuadNodesLine;
528     } else {
529     return -1;
530     }
531     }
532     }
533    
534     int Finley_Quad_getNumNodesRec(int order) {
535     int numQuadNodesLine;
536     numQuadNodesLine=Finley_Quad_getNumNodesLine(order);
537 jgs 150 if (Finley_noError()) {
538 jgs 82 return numQuadNodesLine*numQuadNodesLine;
539     } else {
540     return -1;
541     }
542     }
543    
544     int Finley_Quad_getNumNodesTet(int order) {
545     int numQuadNodesLine;
546 gross 1072 if (order<=1) {
547     return 1;
548 btully 1170 } else if (order==2){
549     return 4;
550     } else if (order==3){
551     return 5;
552 jgs 82 } else {
553 gross 1072 numQuadNodesLine=Finley_Quad_getNumNodesLine(order+2);
554     if (Finley_noError()) {
555     return numQuadNodesLine*numQuadNodesLine*numQuadNodesLine;
556     } else {
557     return -1;
558     }
559 jgs 82 }
560     }
561    
562     int Finley_Quad_getNumNodesHex(int order) {
563     int numQuadNodesLine;
564     numQuadNodesLine=Finley_Quad_getNumNodesLine(order);
565 jgs 150 if (Finley_noError()) {
566 jgs 82 return numQuadNodesLine*numQuadNodesLine*numQuadNodesLine;
567     } else {
568     return -1;
569     }
570     }
571     /*
572     * $Log$
573 jgs 150 * Revision 1.2 2005/09/15 03:44:23 jgs
574     * Merge of development branch dev-02 back to main trunk on 2005-09-15
575 jgs 82 *
576 jgs 150 * Revision 1.1.1.1.6.1 2005/09/07 06:26:20 gross
577     * the solver from finley are put into the standalone package paso now
578     *
579     * Revision 1.1.1.1 2004/10/26 06:53:57 jgs
580     * initial import of project esys2
581     *
582 jgs 82 * Revision 1.2 2004/08/03 04:49:06 gross
583     * bug in Quadrature.c fixed
584     *
585     * Revision 1.1.1.1 2004/06/24 04:00:40 johng
586     * Initial version of eys using boost-python.
587     *
588     *
589     */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26