#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
+#include <unistd.h>
#include <math.h>
#endif
/*
- * datatypes
+ * datatypes & definitions
*/
typedef struct s_stage {
u8 type;
- u8 attr;
- int runs;
+ void *params;
+ u8 executed;
} t_stage;
+#define STAGE_DISPLACE_ATOM 0x00
+#define STAGE_INSERT_ATOMS 0x01
+#define STAGE_INSERT_MIXED_ATOMS 0x02
+#define STAGE_CONTINUE 0x03
+#define STAGE_ANNEAL 0x04
+#define STAGE_CHAATTR 0x05
+#define STAGE_CHSATTR 0x06
+#define STAGE_SET_TEMP 0x07
+#define STAGE_SET_TIMESTEP 0x08
+#define STAGE_FILL 0x09
+#define STAGE_THERMAL_INIT 0x10
+#define STAGE_DEL_ATOMS 0x11
+#define STAGE_MODIFY_ATOMS 0x12
+#define STAGE_CRT 0x13
+
typedef struct s_mdrun {
char cfile[128]; // config file
+
+ char continue_file[128]; // moldyn save file to continue
+
u8 intalgo; // integration algorithm
double timestep; // timestep
+
u8 potential; // potential
double cutoff; // cutoff radius
+ double nnd; // next neighbour distance
+
t_3dvec dim; // simulation volume
u8 pbcx; // periodic boundary conditions
u8 pbcy;
u8 pbcz;
+
int element1; // element 1
- double m1;
int element2; // element 2
- double m2;
+
double lc; // lattice constant
- int lx; // amount of lc units
- int ly;
- int lz;
- u8 aattrib; // atom attributes
u8 lattice; // type of lattice
+
+ u8 sattr; // system attributes
double temperature; // temperature
double pressure; // pressure
- double p_tau; // pressure tau
- double t_tau; // temperature tau
+ double dp;
+ double dt;
+ int relax_steps; // amount of relaxation steps
+
int prerun; // amount of loops in first run
+
int elog; // logging
int tlog;
int plog;
u8 vis;
int avgskip; // average skip
char sdir[128]; // save root
- t_list stage; // list of stages
+
+ t_list stage; // stages
+ int s_cnt; // stage counter
} t_mdrun;
+#define SATTR_PRELAX 0x01
+#define SATTR_TRELAX 0x02
+#define SATTR_AVGRST 0x04
+
+typedef struct s_displace_atom_params {
+ int nr;
+ double dx,dy,dz;
+} t_displace_atom_params;
+
+typedef struct s_del_atoms_params {
+ double r;
+ t_3dvec o;
+} t_del_atoms_params;
+
+typedef struct s_modify_aoms_params {
+ u8 type;
+ int tag;
+ t_3dvec ekin;
+} t_modify_atoms_params;
+
+typedef struct s_insert_atoms_params {
+ u8 type;
+ double x0,y0,z0,x1,y1,z1;
+ double cr;
+ int ins_steps;
+ int cnt_steps;
+ int ins_atoms;
+ int element;
+ u8 brand;
+ u8 attr;
+} t_insert_atoms_params;
+
+typedef struct s_insert_mixed_atoms_params {
+ int element1;
+ int element2;
+ int amount1;
+ int amount2;
+ u8 brand1;
+ u8 brand2;
+ u8 attr1;
+ u8 attr2;
+ double crmin;
+ double crmax;
+} t_insert_mixed_atoms_params;
+
+#define INS_TOTAL 0x01
+#define INS_RECT 0x02
+#define INS_SPHERE 0x03
+#define INS_POS 0x04
+#define INS_RELPOS 0x05
+
+typedef struct s_continue_params {
+ int runs;
+} t_continue_params;
+
+typedef struct s_anneal_params {
+ int runs;
+ int count;
+ double dt;
+ int interval;
+} t_anneal_params;
+
+typedef struct s_chaattr_params {
+ u8 type;
+ double x0,y0,z0;
+ double x1,y1,z1;
+ int element;
+ u8 attr;
+} t_chaattr_params;
+
+#define CHAATTR_TOTALV 0x01
+#define CHAATTR_REGION 0x02
+#define CHAATTR_ELEMENT 0x04
+#define CHAATTR_NUMBER 0x08
+
+typedef struct s_chsattr_params {
+ u8 type;
+ double ttau;
+ double ptau;
+ double dt;
+ double dp;
+ int rsteps;
+ u8 avgrst;
+} t_chsattr_params;
+
+#define CHSATTR_PCTRL 0x01
+#define CHSATTR_TCTRL 0x02
+#define CHSATTR_PRELAX 0x04
+#define CHSATTR_TRELAX 0x08
+#define CHSATTR_AVGRST 0x10
+#define CHSATTR_RSTEPS 0x20
+
+typedef struct s_set_temp_params {
+ u8 type;
+ double val;
+} t_set_temp_params;
+
+#define SET_TEMP_CURRENT 0x01
+#define SET_TEMP_VALUE 0x02
+
+typedef struct s_set_timestep_params {
+ double tau;
+} t_set_timestep_params;
+
+typedef struct s_fill_params {
+ double lc; // lattice constant
+ int lx; // amount of lc units
+ int ly;
+ int lz;
+ u8 lattice;
+ int fill_element;
+ u8 fill_brand;
+ t_part_params p_params;
+ t_defect_params d_params;
+ t_offset_params o_params;
+} t_fill_params;
+
+typedef struct s_crt_params {
+ u8 type;
+ char file[128];
+ t_3dvec *r_fin;
+ u8 *constraints;
+ int steps;
+ int count;
+} t_crt_params;
+
/*
- * function prototypes
+ * extern variables
*/
+// constraint relaxation technique
+extern u8 crtt;
+extern u8 *constraints;
+extern double *trafo_angle;
+
+/*
+ * function prototypes
+ */
#endif