added position insertion method + fixed positioning
[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 /* elements */
22 #include "pse.h"
23
24 /* list api */
25 #include "list/list.h"
26
27 /* potentials */
28 #include "potentials/harmonic_oscillator.h"
29 #include "potentials/lennard_jones.h"
30 #include "potentials/albe.h"
31 #ifdef TERSOFF_ORIG
32 #include "potentials/tersoff_orig.h"
33 #else
34 #include "potentials/tersoff.h"
35 #endif
36
37 /*
38  * datatypes & definitions
39  */
40
41 typedef struct s_stage {
42         u8 type;
43         void *params;
44         u8 executed;
45 } t_stage;
46
47 #define STAGE_INSERT_ATOMS                      0x01
48 #define STAGE_CONTINUE                          0x02
49 #define STAGE_ANNEAL                            0x03
50 #define STAGE_CHAATTR                           0x04
51 #define STAGE_CHSATTR                           0x05
52
53 typedef struct s_mdrun {
54         char cfile[128];                        // config file
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_insert_atoms_params {
106         u8 type;
107         double x0,y0,z0,x1,y1,z1;
108         double cr;
109         int ins_steps;
110         int cnt_steps;
111         int ins_atoms;
112         int element;
113         u8 brand;
114         u8 attr;
115 } t_insert_atoms_params;
116
117 #define INS_TOTAL                               0x01
118 #define INS_REGION                              0x02
119 #define INS_POS                                 0x03
120
121 typedef struct s_continue_params {
122         int runs;
123 } t_continue_params;
124
125 typedef struct s_anneal_params {
126         int runs;
127         int count;
128         double dt;
129 } t_anneal_params;
130
131 typedef struct s_chaattr_params {
132         u8 type;
133         double x0,y0,z0;
134         double x1,y1,z1;
135         int element;
136         u8 attr;
137 } t_chaattr_params;
138
139 #define CHAATTR_TOTALV                          0x01
140 #define CHAATTR_REGION                          0x02
141 #define CHAATTR_ELEMENT                         0x04
142
143 typedef struct s_chsattr_params {
144         u8 type;
145         double ttau;
146         double ptau;
147         double dt;
148         double dp;
149         int rsteps;
150         u8 avgrst;
151 } t_chsattr_params;
152
153 #define CHSATTR_PCTRL                           0x01
154 #define CHSATTR_TCTRL                           0x02
155 #define CHSATTR_PRELAX                          0x04
156 #define CHSATTR_TRELAX                          0x08
157 #define CHSATTR_AVGRST                          0x10
158 #define CHSATTR_RSTEPS                          0x20
159
160 /*
161  * function prototypes
162  */
163
164
165 #endif