| 48 | | contains {\tt main()}, which calls functions in {\tt book.c} (appendix |
| 49 | | \ref{file_book.c}) to create a triangular array of points and set of triangles |
| 50 | | connecting them. It calls {\tt free\_energies()} in {\tt freenergy.c} |
| 51 | | (appendix \ref{file_freenergy.c}) to calculate the free energy function on |
| 52 | | those triangles. It then displays the free energy using the functions in {\tt |
| 53 | | geomview.c} (appendix \ref{file_geomview.c}), which forks and controls a |
| 54 | | Geomview process. |
| | 49 | contains {\tt main()}, which is a simple demonstration of the ternary |
| | 50 | calculation and visualization functions. It does the following: |
| | 51 | \begin{itemize} |
| | 52 | \item Calls functions in {\tt book.c} (appendix \ref{file_book.c}) to create a |
| | 53 | triangular array of points and set of triangles connecting them. |
| | 54 | \item Calculates the free energy function on the triangle verticies using |
| | 55 | {\tt free\_energies()} in {\tt freenergy.c} (appendix |
| | 56 | \ref{file_freenergy.c}). |
| | 57 | \item Displays the free energy using the functions in {\tt geomview.c} |
| | 58 | (appendix \ref{file_geomview.c}), which forks and controls a Geomview |
| | 59 | process. |
| | 60 | \item Calculates the spinodal of this free energy function using {\tt |
| | 61 | calc\_spinodal} in {\tt spinodal.c} (appendix \ref{file_spinodal.c}), and |
| | 62 | displays it on the free energy function. |
| | 63 | \item Uses Qhull calls in {\tt qhull.c} (appendix \ref{file_qhull.c}) to |
| | 64 | calculate the convex hull of the free energy function. |
| | 65 | \item Refines the multi-phase triangles using Newton iteration ({\tt |
| | 66 | hullRefine} in {\tt qhull.c}) to find the lowest-energy point starting at |
| | 67 | each corner, smoothing the phase boundaries considerably. |
| | 68 | \item Adds the two-phase region facet outlines to the Geomview display. |
| | 69 | \end{itemize} |
| 56 | | It then calculates the spinodal of this free energy function using {\tt |
| 57 | | calc\_spinodal} (appendix \ref{file_spinodal.c}), and displays it on the free |
| 58 | | energy function. |
| 59 | | |
| 60 | | Next it uses Qhull calls in {\tt qhull.c} (appendix \ref{file_qhull.c}) to |
| 61 | | calculate the convex hull of the free energy function. It refines the |
| 62 | | multi-phase triangles using Newton iteration to find the lowest-energy point |
| 63 | | starting at each corner. And it optionally refines the one-phase triangles at |
| 64 | | their centroids. |
| 65 | | |
| 66 | | Finally, it strips out the triangles which are in the single-phase region, |
| 67 | | leaving two- and three-phase regions with tie lines. It displays the remaining |
| 68 | | facets using transparent triangles with black edges, which clearly show the tie |
| 69 | | lines in the two-phase regions. |
| 70 | | |
| 71 | | For more than one free energy function, it creates a double-size array with two |
| 72 | | sets of points, and two sets of triangle indices connecting them. The rest of |
| 73 | | this procedure is pretty much the same. |
| | 71 | For more than one free energy function (as implemented in {\tt ternary.c}), it |
| | 72 | creates a double-size array with two sets of points, and two sets of triangle |
| | 73 | indices connecting them. The rest of this procedure is pretty much the same. |