Changeset 387

Show
Ignore:
Timestamp:
09/11/08 06:28:59 (2 months ago)
Author:
powell
Message:

New fields in ternary_point, additional interface to init.

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

Legend:

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

    r382 r387  
    3131  +latex+$y$ as up and $z$ 
    3232  -latex-y as up and z 
    33   as the direction out of the screen. 
     33  as the direction out of the screen.  It also sets the 
     34  +latex+{\tt efunc}, $T$ and $P$ 
     35  +html+ <tt>efunc</tt>, <i>T</i> and <i>P</i> 
     36  fields of each point to -1 to indicate that free energies and derivatives are 
     37  not yet calculated. 
    3438 
    3539  int init_triangle_array It returns zero or an error code. 
     
    4044  +latex+$(N+1)(N+2)/2$, where $N$ is the resolution. 
    4145  -latex-(N+1)(N+2)/2, where N is the resolution. 
     46 
     47  int efunc Energy function index indicating which energy curve this point will 
     48  be on. 
    4249  ++++++++++++++++++++++++++++++++++++++*/ 
    4350 
    44 int init_triangle_array (int resolution, ternary_point *points) 
     51int init_triangle_array (int resolution, ternary_point *points, int efunc) 
    4552{ 
    4653  int i,j, index; 
     
    5360          points[index].C2 = (double) i/resolution; 
    5461          points[index].C3 = (double) j/resolution; 
     62          points[index].efunc = efunc; 
     63          points[index].T = points[index].P = -1; 
    5564        } 
    5665      /* Make sure these are exactly on the C2+C3=1 boundary */ 
  • trunk/matml/src/ternary/ternary.c

    r386 r387  
    5555 
    5656  /* Initialize coordinates of both triangle array halves */ 
    57   if (i=init_triangle_array (loop_max, points)) 
     57  if (i=init_triangle_array (loop_max, points, 0)) 
    5858    { printf ("main: Error %d in init_triangle_array\n", i); exit (i); } 
    59   if (i=init_triangle_array (loop_max, points+numpoints/2)) 
     59  if (i=init_triangle_array (loop_max, points+numpoints/2, 1)) 
    6060    { printf ("main: Error %d in init_triangle_array\n", i); exit (i); } 
    6161 
  • trunk/matml/src/ternary/ternary.h

    r383 r387  
    2121                   +*/ 
    2222  int efunc;     /*+ Index indicating which energy surface (phase) this point 
    23                    is on +*/ 
     23                   is on; a negative value indicates that energy derivatives 
     24                   are not yet calculated. +*/ 
     25  double T;      /*+ Temperature at which the free energies and derivatives 
     26                   are valid +*/ 
     27  double P;      /*+ Pressure at which the free energies and derivatives are 
     28                   valid, -1 if not valid +*/ 
    2429  double G;      /*+ Free energy +*/ 
    2530  double G2;     /*+ Free energy derivative 
     
    128133 
    129134/* From book.c */ 
    130 int init_triangle_array (int resolution, ternary_point *points); 
     135int init_triangle_array (int resolution, ternary_point *points, int efunc); 
    131136int init_triangle_vertices (int resolution, int *vertex_array, int offset); 
    132137int scale_energy_array (int num_points, ternary_point *points,