xref: /phasta/phSolver/common/symline.c (revision 595995161822a203c8467e0e4a253d7bd7d6df32)
1 typedef double DARR2[2];
2 
3 int lineIntPnt(int, DARR2**,double**);
4 
5 #ifdef sun4_5
6 symline_(int *n1, double pt[][4], double wt[], int *err)
7 #endif
8 #ifdef LINUX
9 symline_(int *n1, double pt[][4], double wt[], int *err)
10 #endif
11 #ifdef ibm
12 symline(int *n1, double pt[][4], double wt[], int *err)
13 #endif
14 #ifdef sgi
15 void symline_(int *n1, double pt[][4], double wt[], int *err)
16 #endif
17 #ifdef decalp
18 void symline_(int *n1, double pt[][4], double wt[], int *err)
19 #endif
20 #ifdef intel
21 void  SYMLINE(int *n1, double pt[][4], double wt[], int *err)
22 #endif
23 {
24   double *lwt;
25   DARR2 *lpt;
26   int i,j;
27   *err = lineIntPnt(*n1, &lpt, &lwt);
28   for(i=0; i < *n1; i++){
29     wt[i] = lwt[i];
30     for(j=0; j < 2; j++)
31       pt[i][j] = lpt[i][j];
32   }
33 }
34 
35 #include <stdio.h>
36 
37 #define QpNon -1.000000000000000
38 #define Qp11   0.000000000000000
39 #define Qw1    2.000000000000000
40 
41 #define Qp21  -0.577350269189626
42 #define Qp22   0.577350269189626
43 #define Qw2    1.000000000000000
44 
45 #define Qp31  -0.774596669241483
46 #define Qp32   0.000000000000000
47 #define Qp33   0.774596669241483
48 #define Qw31   0.555555555555556
49 #define Qw32   0.888888888888889
50 
51 /* typedef double DARR2[2] ; */
52 
53 static double rst1[][2] = {{Qp11,QpNon}};
54 static double wt1[] = {Qw1};
55 
56 static double rst2[][2] = {{Qp21,QpNon},{Qp22,QpNon}};
57 static double wt2[] = {Qw2,Qw2};
58 
59 static double rst3[][2] = {{Qp31,QpNon},{Qp32,QpNon},{Qp33,QpNon}};
60 static double wt3[] = {Qw31,Qw32,Qw31};
61 
62 
63 int lineIntPnt(int nint, DARR2 **bcord, double **wt)
64 {
65   int retval = 1 ;
66   if( nint == 1 ) {*bcord = rst1 ; *wt = wt1; }
67   else if( nint == 2 ){*bcord = rst2 ; *wt = wt2; }
68   else if( nint == 3 ){*bcord = rst3 ; *wt = wt3; }
69 /*  else if( nint == 4 ){*bcord = rst4 ; *wt = wt4; }
70   else if( nint == 5 ){*bcord = rst5 ; *wt = wt5; }*/
71   else
72   {
73     fprintf(stderr,"\n%d integration points unsupported in symline.c; give {1,2,3}\n",nint);
74     retval = 0;
75   }
76   return retval ;
77 }
78 
79 
80 
81