optional elment and brand type in fill cmd now
[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 #define STAGE_SET_TEMP                          0x07
52 #define STAGE_SET_TIMESTEP                      0x08
53
54 typedef struct s_mdrun {
55         char cfile[128];                        // config file
56
57         char continue_file[128];                // moldyn save file to continue
58
59         u8 intalgo;                             // integration algorithm
60         double timestep;                        // timestep
61
62         u8 potential;                           // potential
63         double cutoff;                          // cutoff radius
64         double nnd;                             // next neighbour distance
65
66         t_3dvec dim;                            // simulation volume
67         u8 pbcx;                                // periodic boundary conditions
68         u8 pbcy;
69         u8 pbcz;
70
71         int element1;                           // element 1
72         double m1;
73         int element2;                           // element 2
74         double m2;
75         double lc;                              // lattice constant
76         int lx;                                 // amount of lc units
77         int ly;
78         int lz;
79         u8 lattice;                             // type of lattice
80
81         int fill_element;
82         u8 fill_brand;
83
84         u8 sattr;                               // system attributes
85         double temperature;                     // temperature
86         double pressure;                        // pressure
87         double dp;
88         double dt;
89         int relax_steps;                        // amount of relaxation steps
90
91         int prerun;                             // amount of loops in first run
92
93         int elog;                               // logging
94         int tlog;
95         int plog;
96         int vlog;
97         int save;
98         int visualize;
99         u8 vis;
100         int avgskip;                            // average skip
101         char sdir[128];                         // save root
102
103         t_list stage;                           // stages
104         int s_cnt;                              // stage counter
105 } t_mdrun;
106
107 #define SATTR_PRELAX                            0x01
108 #define SATTR_TRELAX                            0x02
109 #define SATTR_AVGRST                            0x04
110
111 typedef struct s_displace_atom_params {
112         int nr;
113         double dx,dy,dz;
114 } t_displace_atom_params;
115
116 typedef struct s_insert_atoms_params {
117         u8 type;
118         double x0,y0,z0,x1,y1,z1;
119         double cr;
120         int ins_steps;
121         int cnt_steps;
122         int ins_atoms;
123         int element;
124         u8 brand;
125         u8 attr;
126 } t_insert_atoms_params;
127
128 typedef struct s_insert_mixed_atoms_params {
129         int element1;
130         int element2;
131         int amount1;
132         int amount2;
133         u8 brand1;
134         u8 brand2;
135         u8 attr1;
136         u8 attr2;
137         double crmin;
138         double crmax;
139 } t_insert_mixed_atoms_params;
140
141 #define INS_TOTAL                               0x01
142 #define INS_REGION                              0x02
143 #define INS_POS                                 0x03
144
145 typedef struct s_continue_params {
146         int runs;
147 } t_continue_params;
148
149 typedef struct s_anneal_params {
150         int runs;
151         int count;
152         double dt;
153         int interval;
154 } t_anneal_params;
155
156 typedef struct s_chaattr_params {
157         u8 type;
158         double x0,y0,z0;
159         double x1,y1,z1;
160         int element;
161         u8 attr;
162 } t_chaattr_params;
163
164 #define CHAATTR_TOTALV                          0x01
165 #define CHAATTR_REGION                          0x02
166 #define CHAATTR_ELEMENT                         0x04
167
168 typedef struct s_chsattr_params {
169         u8 type;
170         double ttau;
171         double ptau;
172         double dt;
173         double dp;
174         int rsteps;
175         u8 avgrst;
176 } t_chsattr_params;
177
178 #define CHSATTR_PCTRL                           0x01
179 #define CHSATTR_TCTRL                           0x02
180 #define CHSATTR_PRELAX                          0x04
181 #define CHSATTR_TRELAX                          0x08
182 #define CHSATTR_AVGRST                          0x10
183 #define CHSATTR_RSTEPS                          0x20
184
185 typedef struct s_set_temp_params {
186         u8 type;
187         double val;
188 } t_set_temp_params;
189
190 #define SET_TEMP_CURRENT                        0x01
191 #define SET_TEMP_VALUE                          0x02
192
193 typedef struct s_set_timestep_params {
194         double tau;
195 } t_set_timestep_params;
196
197 /*
198  * function prototypes
199  */
200
201
202 #endif