root/trunk/matml/src/ternary/gibbs.h

Revision 463, 4.3 kB (checked in by powell, 3 years ago)

Changed phase boundary "flags" to "type" which is more fitting.

Line 
1/***************************************
2  $Header$
3
4  This is the gibbs.h header file with structures and prototypes for
5  calculating phase diagrams, currently only ternaries.
6  ***************************************/
7
8
9#ifndef GIBBS_H
10#define GIBBS_H    /*+ To stop multiple inclusions. +*/
11
12#include <stdio.h>
13#include "freenergy.h"
14
15typedef struct {
16  double x;      /*+ Visualization
17                   +latex+$x$-coordinate ($0\rightarrow1$)
18                   -latex-x-coordinate (0 -> 1)
19                   +*/
20  double y;      /*+ Visualization
21                   +latex+$y$-coordinate
22                   -latex-y-coordinate
23                   (scaled free energy) +*/
24  double z;      /*+ Visualization
25                   +latex+$z$-coordinate ($0\rightarrow\sqrt{3}/2$)
26                   -latex-z-coordinate (0 -> sqrt(3)/2) +*/
27  double red;    /*+ Visualization color red value
28                   +latex+($0\rightarrow1$)
29                   -latex-(0 -> 1)
30                   +*/
31  double green;  /*+ Visualization color green value
32                   +latex+($0\rightarrow1$)
33                   -latex-(0 -> 1)
34                   +*/
35  double blue;   /*+ Visualization color blue value
36                   +latex+($0\rightarrow1$)
37                   -latex-(0 -> 1)
38                   +*/
39  double alpha;  /*+ Visualization color alpha value
40                   +latex+($0\rightarrow1$)
41                   -latex-(0 -> 1)
42                   +*/
43} visual_point; /*+ Visualization "point" structure. +*/
44
45typedef enum {
46  ONE_PHASE_EDGE=0, /*+ One phase's boundary edges +*/
47  TIE_SIMPLICES,    /*+ Tie lines between two phases, triangles between three,
48                      etc. +*/
49  SPINODAL          /*+ Spinodal boundary +*/
50} phase_boundary_type;
51
52typedef struct {
53  int compos;   /*+ Number of points in a boundary edge +*/
54  int *edges;   /*+ Edges with indices of energy_points comprising a phase
55                  boundary; each edge has compos points +*/
56  int n_edges;  /*+ Number of edges comprising this boundary +*/
57  int *phases;  /*+ Phases involved (energy_params indices) starting with the
58                  "current" phase +*/
59  int n_phases; /*+ Number of phases involved +*/
60  phase_boundary_type type; /*+ See phase_boundary_flags typedef enum +*/
61} phase_boundary; /*+ Phase boundary structure which can store either the
62                    boundary between a single phase and a multi-phase region,
63                    or the tie lines/simplices across a multi-phase region +*/
64
65typedef enum {
66  ONE_PHASE=0,
67  CRITICAL_POINT,
68  TWO_PHASE,
69  THREE_PHASE,
70  ALL_TYPES=127
71} facet_type;
72
73typedef struct {
74  int vertex [3];
75  facet_type type;
76} hull_facet;
77
78/* From spinodal.c */
79int calc_spinodal
80(energy_point **points, int *n_points, int *triangle_indices, int n_triangles,
81 double T, double P, energy_params *eparams, int efunc,
82 phase_boundary *spinreturn);
83
84/* From geomview.c */
85int GeomviewBegin (FILE **geompipe, char *version);
86int GeomviewDisplayTriangleCOFF
87(FILE *geompipe, char *name, char *label, char *appearance,
88 int npoints, visual_point *points, int ntriangles, int *vertices);
89int GeomviewDisplayFacets
90(FILE *geompipe, char *name, char *label, char *appearance,
91 int npoints, visual_point *points, int numfacets, hull_facet *facets,
92 facet_type type);
93int GeomviewDisplayPhaseBoundary
94(FILE *geompipe, char *name, char *label, char *appearance,
95 int npoints, visual_point *points, phase_boundary *theboundary);
96int GeomviewEnd (FILE **geompipe);
97
98/* From qhull.c */
99int hullCalculate
100(int dim, energy_point *points, int numpoints, energy_params *eparams,
101 int nparams, double T, double P, hull_facet **facets, int *numfacets);
102int hullRefine
103(energy_point **points, int *numpoints, hull_facet **facets, int *numfacets,
104 energy_params *eparams, int nparams, double T,double P,
105 double newton_tolerance, double vertex_tolerance, int one_phase_refine);
106int hullReturnPhaseBoundaries
107(energy_point *points, int n_points, hull_facet *facets, int n_facets,
108 energy_params *eparams, double T, double P,
109 phase_boundary **boundaries, int *n_bounds);
110char *hullQHullVersion ();
111
112/* From book.c */
113int init_triangle_array
114(int resolution, energy_point *points, int efunc,
115 double A2, double A3, double B2, double B3, double C2, double C3);
116int init_rectangle_array
117(int res2, int res3, energy_point *points, int efunc,
118 double A2, double A3, double B2, double B3);
119int init_triangle_vertices (int resolution, int *vertex_array, int offset);
120int init_rectangle_vertices (int res2, int res3, int *vertex_array, int offset);
121int energy_to_visual_array
122(int num_points, energy_point *epoints, visual_point **tpoints, double y0,
123 double G0, double y1, double G1, double *Gmin, double *Gmax, int square);
124
125#endif /* GIBBS_H */
Note: See TracBrowser for help on using the browser.