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