Changeset 416 for trunk/matml/src

Show
Ignore:
Timestamp:
02/22/2009 11:04:45 AM (3 years ago)
Author:
powell
Message:

New triangle corner coordinate parameters for init_triangle_array().

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

Legend:

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

    r387 r416  
    4747  int efunc Energy function index indicating which energy curve this point will 
    4848  be on. 
     49 
     50  double A2 First corner C2 value. 
     51 
     52  double A3 First corner C3 value. 
     53 
     54  double B2 Second corner C2 value. 
     55 
     56  double B3 Second corner C3 value. 
     57 
     58  double C2 Third corner C2 value. 
     59 
     60  double C3 Third corner C3 value. 
    4961  ++++++++++++++++++++++++++++++++++++++*/ 
    5062 
    51 int init_triangle_array (int resolution, ternary_point *points, int efunc) 
     63int init_triangle_array 
     64(int resolution, ternary_point *points, int efunc, 
     65 double A2, double A3, double B2, double B3, double C2, double C3) 
    5266{ 
    5367  int i,j, index; 
     
    5872        { 
    5973          index = ROWSTART (i) + j; 
    60           points[index].C2 = (double) i/resolution; 
    61           points[index].C3 = (double) j/resolution; 
     74          points[index].C2 = A2 + (B2-A2) * ((double) i/resolution) + 
     75            (C2-A2) * ((double) j/resolution); 
     76          points[index].C3 = A3 + (B3-A3) * ((double) i/resolution) + 
     77            (C3-A3) * ((double) j/resolution); 
    6278          points[index].efunc = efunc; 
    6379          points[index].T = points[index].P = -1; 
     
    6581      /* Make sure these are exactly on the C2+C3=1 boundary */ 
    6682      index = ROWSTART (i) + j; 
    67       points[index].C2 = (double) i/resolution; 
    68       points[index].C3 = 1. - points[index].C2; 
     83      points[index].C2 = A2 + (B2-A2) * ((double) i/resolution) + 
     84        (C2-A2) * (1.-((double) i/resolution)); 
     85      points[index].C3 = A3 + (B3-A3) * ((double) i/resolution) + 
     86        (C3-A3) * (1.-((double) i/resolution)); 
    6987    } 
    7088  index = (resolution+1)*(resolution+2)/2-1; 
    71   points[index].C2 = 1.; 
    72   points[index].C3 = 0.; 
     89  points[index].C2 = B2; 
     90  points[index].C3 = B3; 
    7391 
    7492  return 0; 
  • trunk/matml/src/ternary/ternary.h

    r415 r416  
    165165 
    166166/* From book.c */ 
    167 int init_triangle_array (int resolution, ternary_point *points, int efunc); 
     167int init_triangle_array 
     168(int resolution, ternary_point *points, int efunc, 
     169 double A2, double A3, double B2, double B3, double C2, double C3); 
    168170int init_triangle_vertices (int resolution, int *vertex_array, int offset); 
    169171int scale_energy_array (int num_points, ternary_point *points,