Changeset 452 for trunk/matml

Show
Ignore:
Timestamp:
03/20/2009 08:08:52 AM (3 years ago)
Author:
powell
Message:

New loop better displays the phase boundaries and describes them.

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

Legend:

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

    r451 r452  
    134134    { printf ("main: error %d in hullReturnPhaseBoundaries\n", i); exit (i); } 
    135135 
    136   if (i=GeomviewDisplayPhaseBoundary 
    137       (pfd, "Boundary 0", "bd0", "-face +edge", 
    138        numpoints, points, allbounds)) 
    139     { printf ("main: Error %d in Geomview Display\n", i); exit (i); }   
     136  for (i=0; i<numbounds; i++) 
     137    { 
     138      char name [20], *label [10]; 
     139      int ret; 
    140140 
    141   if (i=GeomviewDisplayPhaseBoundary 
    142       (pfd, "Boundary 1", "bd1", "-face +edge", 
    143        numpoints, points, allbounds+1)) 
    144     { printf ("main: Error %d in Geomview Display\n", i); exit (i); }   
     141      snprintf (name, 18, "Boundary %d", i); 
     142      snprintf (label, 8, "bd%d", i); 
    145143 
    146   if (i=GeomviewDisplayPhaseBoundary 
    147       (pfd, "Boundary 2", "bd2", "-face +edge", 
    148        numpoints, points, allbounds+2)) 
    149     { printf ("main: Error %d in Geomview Display\n", i); exit (i); }   
     144      printf ("Boundary %d: %d-phase %s, phases:", i, (allbounds+i)->n_phases, 
     145              ((allbounds+i)->flags==TIE_SIMPLICES) ? "tie-simplices":"edge"); 
     146      for (ret=0; ret<(allbounds+i)->n_phases; ret++) 
     147        printf (" %d", (allbounds+i)->phases[ret]); 
     148      printf ("\n"); 
    150149 
    151   if (i=GeomviewDisplayPhaseBoundary 
    152       (pfd, "Boundary 3", "bd3", "-face +edge", 
    153        numpoints, points, allbounds+3)) 
    154     { printf ("main: Error %d in Geomview Display\n", i); exit (i); }   
    155  
    156   if (i=GeomviewDisplayPhaseBoundary 
    157       (pfd, "Boundary 4", "bd4", "-face +edge", 
    158        numpoints, points, allbounds+4)) 
    159     { printf ("main: Error %d in Geomview Display\n", i); exit (i); }   
    160  
    161   if (i=GeomviewDisplayPhaseBoundary 
    162       (pfd, "Boundary 5", "bd5", "-face +edge", 
    163        numpoints, points, allbounds+5)) 
    164     { printf ("main: Error %d in Geomview Display\n", i); exit (i); }   
     150      if (ret=GeomviewDisplayPhaseBoundary 
     151          (pfd, name, label, "-face +edge", numpoints, points, allbounds+i)) 
     152        { printf ("main: Error %d in Geomview Display\n", ret); exit (ret); } 
     153    } 
    165154 
    166155  printf ("Press <return> to close up... "); 
  • trunk/matml/src/ternary/ternary.c

    r449 r452  
    126126    { printf ("main: error %d in hullReturnPhaseBoundaries\n", i); exit (i); } 
    127127 
    128   if (i=GeomviewDisplayPhaseBoundary 
    129       (pfd, "Boundary 0", "bd0", "-face +edge", 
    130        numpoints, points, allbounds)) 
    131     { printf ("main: Error %d in Geomview Display\n", i); exit (i); }   
     128  for (i=0; i<numbounds; i++) 
     129    { 
     130      char name [20], *label [10]; 
     131      int ret; 
    132132 
    133   if (i=GeomviewDisplayPhaseBoundary 
    134       (pfd, "Boundary 1", "bd1", "-face +edge", 
    135        numpoints, points, allbounds+1)) 
    136     { printf ("main: Error %d in Geomview Display\n", i); exit (i); }   
     133      snprintf (name, 18, "Boundary %d", i); 
     134      snprintf (label, 8, "bd%d", i); 
    137135 
    138   if (i=GeomviewDisplayPhaseBoundary 
    139       (pfd, "Boundary 2", "bd2", "-face +edge", 
    140        numpoints, points, allbounds+2)) 
    141     { printf ("main: Error %d in Geomview Display\n", i); exit (i); }   
     136      printf ("Boundary %d: %d-phase %s, phases:", i, (allbounds+i)->n_phases, 
     137              ((allbounds+i)->flags==TIE_SIMPLICES) ? "tie-simplices":"edge"); 
     138      for (ret=0; ret<(allbounds+i)->n_phases; ret++) 
     139        printf (" %d", (allbounds+i)->phases[ret]); 
     140      printf ("\n"); 
    142141 
    143   if (i=GeomviewDisplayPhaseBoundary 
    144       (pfd, "Boundary 3", "bd3", "-face +edge", 
    145        numpoints, points, allbounds+3)) 
    146     { printf ("main: Error %d in Geomview Display\n", i); exit (i); }   
    147  
    148   if (i=GeomviewDisplayPhaseBoundary 
    149       (pfd, "Boundary 4", "bd4", "-face +edge", 
    150        numpoints, points, allbounds+4)) 
    151     { printf ("main: Error %d in Geomview Display\n", i); exit (i); }   
    152  
    153   if (i=GeomviewDisplayPhaseBoundary 
    154       (pfd, "Boundary 5", "bd5", "-face +edge", 
    155        numpoints, points, allbounds+5)) 
    156     { printf ("main: Error %d in Geomview Display\n", i); exit (i); }   
     142      if (ret=GeomviewDisplayPhaseBoundary 
     143          (pfd, name, label, "-face +edge", numpoints, points, allbounds+i)) 
     144        { printf ("main: Error %d in Geomview Display\n", ret); exit (ret); } 
     145    } 
    157146 
    158147  printf ("Press <return> to close up... ");