safety checkin
[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
15 #include <math.h>
16
17 /* main molecular dynamics api */
18 #include "moldyn.h"
19
20 /* list api */
21 #include "list/list.h"
22
23 /* potentials */
24 #include "potentials/harmonic_oscillator.h"
25 #include "potentials/lennard_jones.h"
26 #include "potentials/albe.h"
27 #ifdef TERSOFF_ORIG
28 #include "potentials/tersoff_orig.h"
29 #else
30 #include "potentials/tersoff.h"
31 #endif
32
33 /*
34  * datatypes & definitions
35  */
36
37 typedef struct s_stage {
38         u8 type;
39         void *params;
40         u8 executed;
41 } t_stage;
42
43 #define STAGE_INSERT_ATOMS                      0x01
44 #define STAGE_CONTINUE                          0x02
45 #define STAGE_ANNEAL                            0x03
46 #define STAGE_CHAATTR                           0x04
47 #define STAGE_CHSATTR                           0x05
48
49 typedef struct s_mdrun {
50         char cfile[128];                        // config file
51
52         u8 intalgo;                             // integration algorithm
53         double timestep;                        // timestep
54
55         u8 potential;                           // potential
56
57         double cutoff;                          // cutoff radius
58         t_3dvec dim;                            // simulation volume
59         u8 pbcx;                                // periodic boundary conditions
60         u8 pbcy;
61         u8 pbcz;
62
63         int element1;                           // element 1
64         double m1;
65         int element2;                           // element 2
66         double m2;
67         double lc;                              // lattice constant
68         int lx;                                 // amount of lc units
69         int ly;
70         int lz;
71         u8 lattice;                             // type of lattice
72
73         u8 sattr;                               // system attributes
74         double temperature;                     // temperature
75         double pressure;                        // pressure
76         double p_tau;                           // pressure tau
77         double t_tau;                           // temperature tau
78         double dp;                              // delta p fpr pctrl
79         double dt;                              // delta t for tctrl
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 aattr;
112 } t_insert_atoms_params;
113
114 #define INS_TOTAL                               0x01
115 #define INS_REGION                              0x02
116
117 typedef struct s_continue_params {
118         int runs;
119 } t_continue_params;
120
121 typedef struct s_anneal_params {
122         int runs;
123         int count;
124         double dt;
125 } t_anneal_params;
126
127 typedef struct s_chaattr_params {
128         u8 type;
129         double x0,y0,z0;
130         double x1,y1,z1;
131         int element;
132         u8 attr;
133 } t_chaattr_params;
134
135 #define CHAATTR_TOTALV                          0x01
136 #define CHAATTR_REGION                          0x02
137 #define CHAATTR_ELEMENT                         0x04
138
139 typedef struct s_chsattr_params {
140         u8 type;
141         double tau;
142         u8 ctrl;
143         double delta;
144 } t_chsattr_params;
145
146 #define CHSATTR_PCTRL                           0x01
147 #define CHSATTR_TCTRL                           0x02
148 #define CHSATTR_PRELAX                          0x04
149 #define CHSATTR_TRELAX                          0x08
150 #define CHSATTR_AVGRST                          0x10
151
152 /*
153  * function prototypes
154  */
155
156
157 #endif