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