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