displace stage type added
[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_CONTINUE                          0x02
47 #define STAGE_ANNEAL                            0x03
48 #define STAGE_CHAATTR                           0x04
49 #define STAGE_CHSATTR                           0x05
50
51 typedef struct s_mdrun {
52         char cfile[128];                        // config file
53
54         u8 intalgo;                             // integration algorithm
55         double timestep;                        // timestep
56
57         u8 potential;                           // potential
58         double cutoff;                          // cutoff radius
59         double nnd;                             // next neighbour distance
60
61         t_3dvec dim;                            // simulation volume
62         u8 pbcx;                                // periodic boundary conditions
63         u8 pbcy;
64         u8 pbcz;
65
66         int element1;                           // element 1
67         double m1;
68         int element2;                           // element 2
69         double m2;
70         double lc;                              // lattice constant
71         int lx;                                 // amount of lc units
72         int ly;
73         int lz;
74         u8 lattice;                             // type of lattice
75
76         u8 sattr;                               // system attributes
77         double temperature;                     // temperature
78         double pressure;                        // pressure
79         double dp;
80         double dt;
81         int relax_steps;                        // amount of relaxation steps
82
83         int prerun;                             // amount of loops in first run
84
85         int elog;                               // logging
86         int tlog;
87         int plog;
88         int vlog;
89         int save;
90         int visualize;
91         u8 vis;
92         int avgskip;                            // average skip
93         char sdir[128];                         // save root
94
95         t_list stage;                           // stages
96         int s_cnt;                              // stage counter
97 } t_mdrun;
98
99 #define SATTR_PRELAX                            0x01
100 #define SATTR_TRELAX                            0x02
101 #define SATTR_AVGRST                            0x04
102
103 typedef struct s_displace_atom_params {
104         int nr;
105         double dx,dy,dz;
106 } t_displace_atom_params;
107
108 typedef struct s_insert_atoms_params {
109         u8 type;
110         double x0,y0,z0,x1,y1,z1;
111         double cr;
112         int ins_steps;
113         int cnt_steps;
114         int ins_atoms;
115         int element;
116         u8 brand;
117         u8 attr;
118 } t_insert_atoms_params;
119
120 #define INS_TOTAL                               0x01
121 #define INS_REGION                              0x02
122 #define INS_POS                                 0x03
123
124 typedef struct s_continue_params {
125         int runs;
126 } t_continue_params;
127
128 typedef struct s_anneal_params {
129         int runs;
130         int count;
131         double dt;
132 } t_anneal_params;
133
134 typedef struct s_chaattr_params {
135         u8 type;
136         double x0,y0,z0;
137         double x1,y1,z1;
138         int element;
139         u8 attr;
140 } t_chaattr_params;
141
142 #define CHAATTR_TOTALV                          0x01
143 #define CHAATTR_REGION                          0x02
144 #define CHAATTR_ELEMENT                         0x04
145
146 typedef struct s_chsattr_params {
147         u8 type;
148         double ttau;
149         double ptau;
150         double dt;
151         double dp;
152         int rsteps;
153         u8 avgrst;
154 } t_chsattr_params;
155
156 #define CHSATTR_PCTRL                           0x01
157 #define CHSATTR_TCTRL                           0x02
158 #define CHSATTR_PRELAX                          0x04
159 #define CHSATTR_TRELAX                          0x08
160 #define CHSATTR_AVGRST                          0x10
161 #define CHSATTR_RSTEPS                          0x20
162
163 /*
164  * function prototypes
165  */
166
167
168 #endif