Changeset 328
- Timestamp:
- 03/26/08 15:00:25 (8 months ago)
- Location:
- trunk/matml/src/ternary
- Files:
-
- 1 added
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/matml/src/ternary/Makefile.am
r325 r328 11 11 bin_PROGRAMS = ternary 12 12 noinst_HEADERS = ternary.h 13 ternary_SOURCES = ternary.c geomview.c freenergy.c14 ternary_CFLAGS = -DGEOMVIEW=\"@GEOMVIEW@\" 15 ternary_LDADD = -lm 13 ternary_SOURCES = ternary.c geomview.c qhull.c freenergy.c 14 ternary_CFLAGS = -DGEOMVIEW=\"@GEOMVIEW@\" -DDEBUG 15 ternary_LDADD = -lm -lqhull 16 16 17 17 EXTRA_DIST = macros/autogen.sh macros/cxref-latex.m4 … … 22 22 $(top_srcdir)/ternary.h.tex \ 23 23 $(top_srcdir)/geomview.c.tex \ 24 $(top_srcdir)/qhull.c.tex \ 24 25 $(top_srcdir)/freenergy.c.tex 25 26 -
trunk/matml/src/ternary/ternary.c
r321 r328 28 28 int main (int argc, char *argv[]) 29 29 { 30 int i, j, index, loop_max=50, *verts ;31 char gv_version[100] ;30 int i, j, index, loop_max=50, *verts, hullnumverts, *hullverts=NULL; 31 char gv_version[100], *qh_version; 32 32 FILE *pfd = NULL; 33 33 double Gmin, Gmax; … … 65 65 } 66 66 67 printf ("Calculated free energies\n");68 69 67 #define Grel(G) (((G)-Gmin)/(Gmax-Gmin)) 70 68 #define RED(G) (((G)<.25) ? 1. : (((G)<.5) ? 2.-4.*(G) : 0.)) … … 88 86 points[index].alpha = 1.; 89 87 } 90 91 printf ("Rescaled points\n");92 88 93 89 /* Calculate triangle vertex indices */ … … 115 111 verts [3*index+2] = ROWSTART(i+1); 116 112 117 printf ("Calculated triangle vertex indices\n");118 119 113 /* Send points and triangle vertex data to Geomview */ 120 114 if (i=GeomviewDisplayTriangleCOFF (pfd, (loop_max+1)*(loop_max+2)/2, points, … … 122 116 { printf ("main: Error %d in Geomview Display\n", i); exit (i); } 123 117 124 printf ("Sent points to geomview\n"); 118 printf ("Calling qhull\n"); 119 if (i=qhullCalcHull (3, (loop_max+1)*(loop_max+2)/2, points, &hullnumverts, 120 &hullverts, &qh_version)) 121 { printf ("main: qhullCalcHull returned %d\n", i); exit (i); } 122 printf ("qhull version: %s\n", qh_version); 125 123 126 { 127 char instring[100]; 128 129 printf ("Press <return> to close up... "); 130 fgets (instring, 99, stdin); 131 } 124 printf ("Press <return> to close up... "); 125 fgets (gv_version, 99, stdin); 132 126 133 127 GeomviewEnd (&pfd); 134 128 free (points); 135 129 free (verts); 130 free (hullverts); 136 131 137 132 return 0; -
trunk/matml/src/ternary/ternary.h
r321 r328 32 32 int GeomviewEnd (FILE **geompipe); 33 33 34 int qhullCalcHull (int dim, int numpoints, ternary_point *points, int *facets, 35 int **verts, char **version); 36 34 37 #endif /* TERNARY_H */