Changeset 431 for trunk/matml/src
- Timestamp:
- 03/06/2009 04:46:13 PM (3 years ago)
- Location:
- trunk/matml/src/ternary
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/matml/src/ternary/book.c
r416 r431 174 174 double *Gmax Optional address to store the maximum free energy in the array 175 175 on return (NULL if unwanted), used as G1 if both G0 and G1 are zero. 176 177 int square Flag: zero for triangle composition representation, non-zero for 178 square. 176 179 ++++++++++++++++++++++++++++++++++++++*/ 177 180 178 181 int scale_energy_array (int num_points, ternary_point *points, 179 double y0, double G0, double y1, double G1,180 double *Gmin, double *Gmax)182 double y0, double G0, double y1, double G1, 183 double *Gmin, double *Gmax, int square) 181 184 { 182 185 int i; … … 218 221 for (i=0; i<num_points; i++) 219 222 { 220 points[i].x = points[i].C2 + 0.5*points[i].C3; 223 if (square) 224 { 225 points[i].x = points[i].C2; 226 points[i].z = 1.-points[i].C3; 227 } 228 else 229 { 230 points[i].x = points[i].C2 + 0.5*points[i].C3; 231 points[i].z = (1. - points[i].C3) * sqrt(3)/2.; 232 } 221 233 points[i].y = Grel(points[i].G); 222 points[i].z = (1. - points[i].C3) * sqrt(3)/2.;223 234 points[i].red = RED (Grel (points[i].G)); 224 235 points[i].green = GREEN (Grel (points[i].G)); -
trunk/matml/src/ternary/ternary.c
r430 r431 82 82 83 83 /* Scale all free energy values */ 84 if (i=scale_energy_array (numpoints, points, 0., -.2, 1., .9, NULL, NULL ))84 if (i=scale_energy_array (numpoints, points, 0., -.2, 1., .9, NULL, NULL, 0)) 85 85 { printf ("main: Error %d in scale_triangle_array\n", i); exit (i); } 86 86 … … 112 112 113 113 /* Scale and display everything */ 114 if (i=scale_energy_array (numpoints, points, 0., -.2, 1., .9, NULL, NULL ))114 if (i=scale_energy_array (numpoints, points, 0., -.2, 1., .9, NULL, NULL, 0)) 115 115 { printf ("main: Error %d in scale_triangle_array\n", i); exit (i); } 116 116 -
trunk/matml/src/ternary/ternary.h
r430 r431 186 186 int scale_energy_array (int num_points, ternary_point *points, 187 187 double y0, double G0, double y1, double G1, 188 double *Gmin, double *Gmax );188 double *Gmin, double *Gmax, int square); 189 189 190 190 #endif /* TERNARY_H */