Changeset 318

Show
Ignore:
Timestamp:
03/26/08 10:47:28 (8 months ago)
Author:
powell
Message:

Turned coordT back into double, will cast for qhull when needed.

Location:
trunk/matml/src/ternary
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/matml/src/ternary/freenergy.c

    r316 r318  
    1313  This calculates the free energy. 
    1414 
    15   coordT free_energy It returns the free energy. 
     15  double free_energy It returns the free energy. 
    1616 
    17   coordT C2 Concentration of species 2. 
     17  double C2 Concentration of species 2. 
    1818 
    19   coordT C3 Concentration of species 3. 
     19  double C3 Concentration of species 3. 
    2020 
    21   coordT T Temperature (ignored for now). 
     21  double T Temperature (ignored for now). 
    2222  ++++++++++++++++++++++++++++++++++++++*/ 
    2323 
    24 coordT free_energy (coordT C2, coordT C3, coordT T) 
     24double free_energy (double C2, double C3, double T) 
    2525{ 
    26   coordT C1 = (1.-C2-C3 < 0.) ? 0. : 1.-C2-C3; 
    27   coordT m1=1., m2=2., m3=5.;  /* Flory-Huggins "Degree of polymerization" */ 
    28   coordT chi12 = -.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 */ 
    2929 
    3030  return  ((C1==0.)?0.:C1/m1*log(C1)) + ((C2==0.)?0.:C2/m2*log(C2)) + 
    3131    ((C3==0.)?0.:C3/m3*log(C3)) + 
    32     chi12*C2*C1 + chi23*C2*C3 + chi13*C3*C1; 
     32    chi12*C2*C1 + chi13*C3*C1 + chi23*C2*C3; 
    3333} 
  • trunk/matml/src/ternary/geomview.c

    r316 r318  
    7171  int npoints Number of points. 
    7272 
    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. 
    7474 
    7575  int ntriangles Number of triangles. 
     
    7979 
    8080int GeomviewDisplayTriangleCOFF 
    81 (FILE *geompipe, int npoints, coordT *points, int ntriangles, int *vertices) 
     81(FILE *geompipe, int npoints, double *points, int ntriangles, int *vertices) 
    8282{ 
    8383  int i; 
  • trunk/matml/src/ternary/ternary.c

    r316 r318  
    3131  char gv_version[100]; 
    3232  FILE *pfd = NULL; 
    33   coordT Gmin, Gmax, *points; 
     33  double Gmin, Gmax, *points; 
    3434 
    3535  if (argc>1) 
     
    3737 
    3838  /* 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)))) 
    4040    { printf ("Cannot allocate point coordinate array\n"); exit (1); } 
    4141 
     
    5757        index = 7 * (ROWSTART (i) + j); 
    5858 
    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; 
    6161        points [index+2] = free_energy (points[index], points[index+1], 0.); 
    6262        Gmin = (points [index+2]<Gmin) ? points [index+2] : Gmin; 
  • trunk/matml/src/ternary/ternary.h

    r316 r318  
    1212#include <qhull/qhull.h> 
    1313 
    14 coordT free_energy (coordT C2, coordT C3, realT T); 
     14double free_energy (double C2, double C3, realT T); 
    1515 
    1616int GeomviewBegin (FILE **geompipe, char *version); 
    1717int GeomviewDisplayTriangleCOFF 
    18 (FILE *geompipe, int npoints, coordT *points, int ntriangles, int *vertices); 
     18(FILE *geompipe, int npoints, double *points, int ntriangles, int *vertices); 
    1919int GeomviewEnd (FILE **geompipe); 
    2020