Changeset 318
- Timestamp:
- 03/26/08 10:47:28 (8 months ago)
- Location:
- trunk/matml/src/ternary
- Files:
-
- 4 modified
-
freenergy.c (modified) (1 diff)
-
geomview.c (modified) (2 diffs)
-
ternary.c (modified) (3 diffs)
-
ternary.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/matml/src/ternary/freenergy.c
r316 r318 13 13 This calculates the free energy. 14 14 15 coordTfree_energy It returns the free energy.15 double free_energy It returns the free energy. 16 16 17 coordTC2 Concentration of species 2.17 double C2 Concentration of species 2. 18 18 19 coordTC3 Concentration of species 3.19 double C3 Concentration of species 3. 20 20 21 coordTT Temperature (ignored for now).21 double T Temperature (ignored for now). 22 22 ++++++++++++++++++++++++++++++++++++++*/ 23 23 24 coordT free_energy (coordT C2, coordT C3, coordTT)24 double free_energy (double C2, double C3, double T) 25 25 { 26 coordTC1 = (1.-C2-C3 < 0.) ? 0. : 1.-C2-C3;27 coordTm1=1., m2=2., m3=5.; /* Flory-Huggins "Degree of polymerization" */28 coordTchi12 = -.5, chi13 = 2., chi23 = .2; /* Interaction parameters */26 double C1 = (1.-C2-C3 < 0.) ? 0. : 1.-C2-C3; 27 double m1=1., m2=2., m3=5.; /* Flory-Huggins "Degree of polymerization" */ 28 double chi12 = -.5, chi13 = 2., chi23 = .2; /* Interaction parameters */ 29 29 30 30 return ((C1==0.)?0.:C1/m1*log(C1)) + ((C2==0.)?0.:C2/m2*log(C2)) + 31 31 ((C3==0.)?0.:C3/m3*log(C3)) + 32 chi12*C2*C1 + chi 23*C2*C3 + chi13*C3*C1;32 chi12*C2*C1 + chi13*C3*C1 + chi23*C2*C3; 33 33 } -
trunk/matml/src/ternary/geomview.c
r316 r318 71 71 int npoints Number of points. 72 72 73 coordT*points Point coordinates and colors in a 7xN array: x,y,z,r,g,b,a.73 double *points Point coordinates and colors in a 7xN array: x,y,z,r,g,b,a. 74 74 75 75 int ntriangles Number of triangles. … … 79 79 80 80 int GeomviewDisplayTriangleCOFF 81 (FILE *geompipe, int npoints, coordT*points, int ntriangles, int *vertices)81 (FILE *geompipe, int npoints, double *points, int ntriangles, int *vertices) 82 82 { 83 83 int i; -
trunk/matml/src/ternary/ternary.c
r316 r318 31 31 char gv_version[100]; 32 32 FILE *pfd = NULL; 33 coordTGmin, Gmax, *points;33 double Gmin, Gmax, *points; 34 34 35 35 if (argc>1) … … 37 37 38 38 /* Allocate arrays for point coordinates and colors and triangle vertices */ 39 if (!(points = calloc ((loop_max+1)*(loop_max+2)/2 * 7, sizeof ( coordT))))39 if (!(points = calloc ((loop_max+1)*(loop_max+2)/2 * 7, sizeof (double)))) 40 40 { printf ("Cannot allocate point coordinate array\n"); exit (1); } 41 41 … … 57 57 index = 7 * (ROWSTART (i) + j); 58 58 59 points [index] = ( coordT)i/loop_max;60 points [index+1] = ( coordT)j/loop_max;59 points [index] = (double)i/loop_max; 60 points [index+1] = (double)j/loop_max; 61 61 points [index+2] = free_energy (points[index], points[index+1], 0.); 62 62 Gmin = (points [index+2]<Gmin) ? points [index+2] : Gmin; -
trunk/matml/src/ternary/ternary.h
r316 r318 12 12 #include <qhull/qhull.h> 13 13 14 coordT free_energy (coordT C2, coordTC3, realT T);14 double free_energy (double C2, double C3, realT T); 15 15 16 16 int GeomviewBegin (FILE **geompipe, char *version); 17 17 int GeomviewDisplayTriangleCOFF 18 (FILE *geompipe, int npoints, coordT*points, int ntriangles, int *vertices);18 (FILE *geompipe, int npoints, double *points, int ntriangles, int *vertices); 19 19 int GeomviewEnd (FILE **geompipe); 20 20