| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | #ifndef GIBBS_H |
|---|
| 10 | #define GIBBS_H |
|---|
| 11 | |
|---|
| 12 | #include <stdio.h> |
|---|
| 13 | #include "freenergy.h" |
|---|
| 14 | |
|---|
| 15 | typedef struct { |
|---|
| 16 | double x; |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | double y; |
|---|
| 21 | |
|---|
| 22 | |
|---|
| 23 | |
|---|
| 24 | double z; |
|---|
| 25 | |
|---|
| 26 | |
|---|
| 27 | double red; |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | |
|---|
| 31 | double green; |
|---|
| 32 | |
|---|
| 33 | |
|---|
| 34 | |
|---|
| 35 | double blue; |
|---|
| 36 | |
|---|
| 37 | |
|---|
| 38 | |
|---|
| 39 | double alpha; |
|---|
| 40 | |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | } visual_point; |
|---|
| 44 | |
|---|
| 45 | typedef enum { |
|---|
| 46 | ONE_PHASE_EDGE=0, |
|---|
| 47 | TIE_SIMPLICES, |
|---|
| 48 | |
|---|
| 49 | SPINODAL |
|---|
| 50 | } phase_boundary_type; |
|---|
| 51 | |
|---|
| 52 | typedef struct { |
|---|
| 53 | int compos; |
|---|
| 54 | int *edges; |
|---|
| 55 | |
|---|
| 56 | int n_edges; |
|---|
| 57 | int *phases; |
|---|
| 58 | |
|---|
| 59 | int n_phases; |
|---|
| 60 | phase_boundary_type type; |
|---|
| 61 | } phase_boundary; |
|---|
| 62 | |
|---|
| 63 | |
|---|
| 64 | |
|---|
| 65 | typedef enum { |
|---|
| 66 | ONE_PHASE=0, |
|---|
| 67 | CRITICAL_POINT, |
|---|
| 68 | TWO_PHASE, |
|---|
| 69 | THREE_PHASE, |
|---|
| 70 | ALL_TYPES=127 |
|---|
| 71 | } facet_type; |
|---|
| 72 | |
|---|
| 73 | typedef struct { |
|---|
| 74 | int vertex [3]; |
|---|
| 75 | facet_type type; |
|---|
| 76 | } hull_facet; |
|---|
| 77 | |
|---|
| 78 | |
|---|
| 79 | int 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 | |
|---|
| 85 | int GeomviewBegin (FILE **geompipe, char *version); |
|---|
| 86 | int GeomviewDisplayTriangleCOFF |
|---|
| 87 | (FILE *geompipe, char *name, char *label, char *appearance, |
|---|
| 88 | int npoints, visual_point *points, int ntriangles, int *vertices); |
|---|
| 89 | int 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); |
|---|
| 93 | int GeomviewDisplayPhaseBoundary |
|---|
| 94 | (FILE *geompipe, char *name, char *label, char *appearance, |
|---|
| 95 | int npoints, visual_point *points, phase_boundary *theboundary); |
|---|
| 96 | int GeomviewEnd (FILE **geompipe); |
|---|
| 97 | |
|---|
| 98 | |
|---|
| 99 | int hullCalculate |
|---|
| 100 | (int dim, energy_point *points, int numpoints, energy_params *eparams, |
|---|
| 101 | int nparams, double T, double P, hull_facet **facets, int *numfacets); |
|---|
| 102 | int 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); |
|---|
| 106 | int 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); |
|---|
| 110 | char *hullQHullVersion (); |
|---|
| 111 | |
|---|
| 112 | |
|---|
| 113 | int init_triangle_array |
|---|
| 114 | (int resolution, energy_point *points, int efunc, |
|---|
| 115 | double A2, double A3, double B2, double B3, double C2, double C3); |
|---|
| 116 | int init_rectangle_array |
|---|
| 117 | (int res2, int res3, energy_point *points, int efunc, |
|---|
| 118 | double A2, double A3, double B2, double B3); |
|---|
| 119 | int init_triangle_vertices (int resolution, int *vertex_array, int offset); |
|---|
| 120 | int init_rectangle_vertices (int res2, int res3, int *vertex_array, int offset); |
|---|
| 121 | int 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 |
|---|