+ /* integration function pointer */
+ int (*integrate)(struct s_moldyn *moldyn);
+ int time_steps; /* amount of iterations */
+ double tau; /* delta t */
+ double time; /* absolute time */
+ double tau_square; /* delta t squared */
+ int total_steps; /* total steps */
+
+ /* energy */
+ double energy; /* potential energy */
+ double ekin; /* kinetic energy */
+
+ /* energy averages & fluctuations */
+ double k_sum; /* sum of kinetic energy */
+ double v_sum; /* sum of potential energy */
+ double k_avg; /* average of kinetic energy */
+ double v_avg; /* average of potential energy */
+ double k2_sum; /* sum of kinetic energy squared */
+ double v2_sum; /* sum of potential energy squared */
+ double k2_avg; /* average of kinetic energy squared */
+ double v2_avg; /* average of potential energy squared */
+ double dk2_avg; /* mean square kinetic energy fluctuations */
+ double dv2_avg; /* mean square potential energy fluctuations */
+
+ /* response functions */
+ double c_v_nve; /* constant volume heat capacity (nve) */
+ double c_v_nvt; /* constant volume heat capacity (nvt) */
+
+ char vlsdir[128]; /* visualization/log/save directory */
+ t_visual vis; /* visualization interface structure */
+ u8 vlsprop; /* log/vis/save properties */
+ unsigned int ewrite; /* how often to log energy */
+ int efd; /* fd for energy log */
+ unsigned int mwrite; /* how often to log momentum */
+ int mfd; /* fd for momentum log */
+ unsigned int pwrite; /* how often to log pressure */
+ int pfd; /* fd for pressure log */
+ unsigned int twrite; /* how often to log temperature */
+ int tfd; /* fd for temperature log */
+ unsigned int vwrite; /* how often to log volume */
+ int vfd; /* fd for volume log */
+ unsigned int awrite; /* how often to visualize atom information */
+ unsigned int swrite; /* how often to create a save file */
+ int rfd; /* report file descriptor */
+ char rtitle[64]; /* report title */
+ char rauthor[64]; /* report author */
+ int epfd; /* energy gnuplot script file descriptor */
+ int ppfd; /* pressure gnuplot script file descriptor */
+ int tpfd; /* temperature gnuplot script file descriptor */
+
+ u8 status; /* general moldyn properties */
+
+ t_random random; /* random interface */
+
+ double debug; /* debugging stuff, ignore */
+
+ /* potential 2 body check function */
+ int (*check_2b_bond)(struct s_moldyn *moldyn,
+ t_atom *itom,t_atom *jtom,u8 bc);
+} t_moldyn;
+
+typedef struct s_pcc {
+ int o1;
+ int o2;
+ double dr;
+ double *stat;
+} t_pcc;
+
+typedef struct s_ba {
+ int *acnt;
+ int *bcnt;
+ int tcnt;
+} t_ba;
+
+typedef struct s_vb {
+ int fd;
+} t_vb;
+
+/*
+ *
+ * defines
+ *
+ */
+
+#define MOLDYN_STAT_PBX 0x01 /* periodic boudaries in x */
+#define MOLDYN_STAT_PBY 0x02 /* y */
+#define MOLDYN_STAT_PBZ 0x04 /* and z direction */
+
+#define MOLDYN_PSCALE 0x08 /* size controlled by piston */
+
+#define MOLDYN_1BP 0x10 /* care about single */
+#define MOLDYN_2BP 0x20 /* 2 body */
+#define MOLDYN_3BP 0x40 /* and 3 body particle pots */
+
+#define T_SCALE_NONE 0x00
+#define T_SCALE_BERENDSEN 0x01 /* berendsen t control */
+#define T_SCALE_DIRECT 0x02 /* direct t control */
+#define T_SCALE_MASK 0x03
+
+#define P_SCALE_NONE 0x00
+#define P_SCALE_BERENDSEN 0x04 /* berendsen p control */
+#define P_SCALE_DIRECT 0x08 /* direct p control */
+#define P_SCALE_MASK 0x0c
+
+/*
+ * default values & units
+ *
+ * - length unit: 1 A (1 A = 1e-10 m)
+ * - time unit: 1 fs (1 fs = 1e-15 s)
+ * - mass unit: 1 amu (1 amu = 1.6605388628e-27 kg )
+ *
+ * fyi: in the following 1 N = (amu*A)/(fs*fs)
+ *
+ */
+
+#define METER 1e10 /* A */
+#define SECOND 1e15 /* fs */
+#define AMU 1.6605388628e-27 /* kg */
+#define KILOGRAM (1.0/AMU) /* amu */
+#define NEWTON (METER*KILOGRAM/(SECOND*SECOND)) /* A amu / fs^2 */
+#define PASCAL (NEWTON/(METER*METER)) /* N / A^2 */
+#define GPA (1e9*PASCAL) /* N / A^2 */
+#define BAR ((1.0e5*PASCAL)) /* N / A^2 */
+#define K_BOLTZMANN (1.380650524e-23*METER*NEWTON) /* NA/K */
+#define K_B2 (K_BOLTZMANN*K_BOLTZMANN) /* (NA)^2/K^2 */
+#define EV (1.6021765314e-19*METER*NEWTON) /* NA */
+#define JOULE (NEWTON*METER) /* NA */
+
+#define MOLDYN_TEMP 273.0
+#define MOLDYN_TAU 1.0
+#define MOLDYN_CUTOFF 10.0
+#define MOLDYN_RUNS 1000000
+
+#define MOLDYN_INTEGRATE_VERLET 0x00
+#define MOLDYN_INTEGRATE_DEFAULT MOLDYN_INTEGRATE_VERLET
+
+#define MOLDYN_POTENTIAL_HO 0x00
+#define MOLDYN_POTENTIAL_LJ 0x01
+#define MOLDYN_POTENTIAL_TM 0x02
+#define MOLDYN_POTENTIAL_AM 0x03
+#define MOLDYN_POTENTIAL_AO 0x04
+
+#define LOG_TOTAL_ENERGY 0x01
+#define LOG_TOTAL_MOMENTUM 0x02
+#define LOG_PRESSURE 0x04
+#define LOG_TEMPERATURE 0x08
+#define LOG_VOLUME 0x10
+#define SAVE_STEP 0x20
+#define VISUAL_STEP 0x40
+#define CREATE_REPORT 0x80
+
+#define TRUE 1
+#define FALSE 0
+
+#define VERBOSE 1
+#define QUIET 0
+
+#define SCALE_UP 'u'
+#define SCALE_DOWN 'd'
+#define SCALE_DIRECT 'D'
+
+/*
+ * usefull constants
+ */
+
+#define ONE_THIRD (1.0/3.0)
+
+/*
+ * element specific defines
+ */