introduced critical max (didn't help though!)
[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 /* list api */
22 #include "list/list.h"
23
24 /* potentials */
25 #include "potentials/harmonic_oscillator.h"
26 #include "potentials/lennard_jones.h"
27 #include "potentials/albe.h"
28 #ifdef TERSOFF_ORIG
29 #include "potentials/tersoff_orig.h"
30 #else
31 #include "potentials/tersoff.h"
32 #endif
33
34 /*
35  * datatypes & definitions
36  */
37
38 typedef struct s_stage {
39         u8 type;
40         void *params;
41         u8 executed;
42 } t_stage;
43
44 #define STAGE_DISPLACE_ATOM                     0x00
45 #define STAGE_INSERT_ATOMS                      0x01
46 #define STAGE_INSERT_MIXED_ATOMS                0x02
47 #define STAGE_CONTINUE                          0x03
48 #define STAGE_ANNEAL                            0x04
49 #define STAGE_CHAATTR                           0x05
50 #define STAGE_CHSATTR                           0x06
51
52 typedef struct s_mdrun {
53         char cfile[128];                        // config file
54
55         char continue_file[128];                // moldyn save file to continue
56
57         u8 intalgo;                             // integration algorithm
58         double timestep;                        // timestep
59
60         u8 potential;                           // potential
61         double cutoff;                          // cutoff radius
62         double nnd;                             // next neighbour distance
63
64         t_3dvec dim;                            // simulation volume
65         u8 pbcx;                                // periodic boundary conditions
66         u8 pbcy;
67         u8 pbcz;
68
69         int element1;                           // element 1
70         double m1;
71         int element2;                           // element 2
72         double m2;
73         double lc;                              // lattice constant
74         int lx;                                 // amount of lc units
75         int ly;
76         int lz;
77         u8 lattice;                             // type of lattice
78
79         u8 sattr;                               // system attributes
80         double temperature;                     // temperature
81         double pressure;                        // pressure
82         double dp;
83         double dt;
84         int relax_steps;                        // amount of relaxation steps
85
86         int prerun;                             // amount of loops in first run
87
88         int elog;                               // logging
89         int tlog;
90         int plog;
91         int vlog;
92         int save;
93         int visualize;
94         u8 vis;
95         int avgskip;                            // average skip
96         char sdir[128];                         // save root
97
98         t_list stage;                           // stages
99         int s_cnt;                              // stage counter
100 } t_mdrun;
101
102 #define SATTR_PRELAX                            0x01
103 #define SATTR_TRELAX                            0x02
104 #define SATTR_AVGRST                            0x04
105
106 typedef struct s_displace_atom_params {
107         int nr;
108         double dx,dy,dz;
109 } t_displace_atom_params;
110
111 typedef struct s_insert_atoms_params {
112         u8 type;
113         double x0,y0,z0,x1,y1,z1;
114         double cr;
115         int ins_steps;
116         int cnt_steps;
117         int ins_atoms;
118         int element;
119         u8 brand;
120         u8 attr;
121 } t_insert_atoms_params;
122
123 typedef struct s_insert_mixed_atoms_params {
124         int element1;
125         int element2;
126         int amount1;
127         int amount2;
128         u8 brand1;
129         u8 brand2;
130         u8 attr1;
131         u8 attr2;
132         double crmin;
133         double crmax;
134 } t_insert_mixed_atoms_params;
135
136 #define INS_TOTAL                               0x01
137 #define INS_REGION                              0x02
138 #define INS_POS                                 0x03
139
140 typedef struct s_continue_params {
141         int runs;
142 } t_continue_params;
143
144 typedef struct s_anneal_params {
145         int runs;
146         int count;
147         double dt;
148 } t_anneal_params;
149
150 typedef struct s_chaattr_params {
151         u8 type;
152         double x0,y0,z0;
153         double x1,y1,z1;
154         int element;
155         u8 attr;
156 } t_chaattr_params;
157
158 #define CHAATTR_TOTALV                          0x01
159 #define CHAATTR_REGION                          0x02
160 #define CHAATTR_ELEMENT                         0x04
161
162 typedef struct s_chsattr_params {
163         u8 type;
164         double ttau;
165         double ptau;
166         double dt;
167         double dp;
168         int rsteps;
169         u8 avgrst;
170 } t_chsattr_params;
171
172 #define CHSATTR_PCTRL                           0x01
173 #define CHSATTR_TCTRL                           0x02
174 #define CHSATTR_PRELAX                          0x04
175 #define CHSATTR_TRELAX                          0x08
176 #define CHSATTR_AVGRST                          0x10
177 #define CHSATTR_RSTEPS                          0x20
178
179 /*
180  * function prototypes
181  */
182
183
184 #endif