fixed compile errors, no testing yet!
[physik/posic.git] / mdrun.h
1 /*
2  * mdrun.h - mdrun header file
3  *
4  * author: Frank Zirkelbach <frank.zirkelbach@physik.uni-augsburg.de>
5  *
6  */
7
8 #ifndef MDRUN_H
9 #define MDRUN_H
10
11 #include <sys/types.h>
12 #include <sys/stat.h>
13 #include <fcntl.h>
14 #include <unistd.h>
15
16 #include <math.h>
17
18 /* main molecular dynamics api */
19 #include "moldyn.h"
20
21 /* elements */
22 #include "pse.h"
23
24 /* list api */
25 #include "list/list.h"
26
27 /* potentials */
28 #include "potentials/harmonic_oscillator.h"
29 #include "potentials/lennard_jones.h"
30 #include "potentials/albe.h"
31 #ifdef TERSOFF_ORIG
32 #include "potentials/tersoff_orig.h"
33 #else
34 #include "potentials/tersoff.h"
35 #endif
36
37 /*
38  * datatypes & definitions
39  */
40
41 typedef struct s_stage {
42         u8 type;
43         void *params;
44         u8 executed;
45 } t_stage;
46
47 #define STAGE_INSERT_ATOMS                      0x01
48 #define STAGE_CONTINUE                          0x02
49 #define STAGE_ANNEAL                            0x03
50 #define STAGE_CHAATTR                           0x04
51 #define STAGE_CHSATTR                           0x05
52
53 typedef struct s_mdrun {
54         char cfile[128];                        // config file
55
56         u8 intalgo;                             // integration algorithm
57         double timestep;                        // timestep
58
59         u8 potential;                           // potential
60
61         double cutoff;                          // cutoff radius
62         t_3dvec dim;                            // simulation volume
63         u8 pbcx;                                // periodic boundary conditions
64         u8 pbcy;
65         u8 pbcz;
66
67         int element1;                           // element 1
68         double m1;
69         int element2;                           // element 2
70         double m2;
71         double lc;                              // lattice constant
72         int lx;                                 // amount of lc units
73         int ly;
74         int lz;
75         u8 lattice;                             // type of lattice
76
77         u8 sattr;                               // system attributes
78         double temperature;                     // temperature
79         double pressure;                        // pressure
80         double dp;
81         double dt;
82         int relax_steps;                        // amount of relaxation steps
83
84         int prerun;                             // amount of loops in first run
85
86         int elog;                               // logging
87         int tlog;
88         int plog;
89         int vlog;
90         int save;
91         int visualize;
92         u8 vis;
93         int avgskip;                            // average skip
94         char sdir[128];                         // save root
95
96         t_list stage;                           // stages
97         int s_cnt;                              // stage counter
98 } t_mdrun;
99
100 #define SATTR_PRELAX                            0x01
101 #define SATTR_TRELAX                            0x02
102 #define SATTR_AVGRST                            0x04
103
104 typedef struct s_insert_atoms_params {
105         u8 type;
106         double x0,y0,z0,x1,y1,z1;
107         double cr;
108         int ins_steps;
109         int cnt_steps;
110         int ins_atoms;
111         int element;
112         u8 brand;
113         u8 attr;
114 } t_insert_atoms_params;
115
116 #define INS_TOTAL                               0x01
117 #define INS_REGION                              0x02
118
119 typedef struct s_continue_params {
120         int runs;
121 } t_continue_params;
122
123 typedef struct s_anneal_params {
124         int runs;
125         int count;
126         double dt;
127 } t_anneal_params;
128
129 typedef struct s_chaattr_params {
130         u8 type;
131         double x0,y0,z0;
132         double x1,y1,z1;
133         int element;
134         u8 attr;
135 } t_chaattr_params;
136
137 #define CHAATTR_TOTALV                          0x01
138 #define CHAATTR_REGION                          0x02
139 #define CHAATTR_ELEMENT                         0x04
140
141 typedef struct s_chsattr_params {
142         u8 type;
143         double ttau;
144         double ptau;
145         double dt;
146         double dp;
147         int rsteps;
148         u8 avgrst;
149 } t_chsattr_params;
150
151 #define CHSATTR_PCTRL                           0x01
152 #define CHSATTR_TCTRL                           0x02
153 #define CHSATTR_PRELAX                          0x04
154 #define CHSATTR_TRELAX                          0x08
155 #define CHSATTR_AVGRST                          0x10
156 #define CHSATTR_RSTEPS                          0x20
157
158 /*
159  * function prototypes
160  */
161
162
163 #endif