#include "list/list.h"
-/* datatypes */
+/*
+ *
+ * datatypes
+ *
+ */
+/* general */
typedef unsigned char u8;
/* the atom of the md simulation */
-
typedef struct s_atom {
t_3dvec r; /* position */
t_3dvec v; /* velocity */
#define ATOM_ATTR_3BP 0x40 /* 3 body potential */
/* cell lists */
-
typedef struct s_linkcell {
int nx,ny,nz; /* amount of cells in x, y and z direction */
int cells; /* total amount of cells */
#include "visual/visual.h"
-# moldyn structure */
+# moldyn schedule structure */
+typedef struct s_moldyn_schedule {
+ int content_count;
+ int *runs;
+ int *tau;
+ int (*hook)(t_moldyn *,void *);
+ void *hook_params;
+} t_moldyn_schedule;
+/* moldyn main structure */
typedef struct s_moldyn {
-
int count; /* total amount of atoms */
t_atom *atom; /* pointer to the atoms */
double t; /* temperature */
+ /* simulation schedule */
+ t_moldyn_schedule schedule;
+ int current; /* current position in schedule */
+
/* integration function pointer */
int (*integrate)(struct s_moldyn *moldyn);
int time_steps; /* amount of iterations */
double tau; /* delta t */
double tau_square; /* delta t squared */
+ double elapsed; /* total elapsed time */
double energy; /* energy */
t_visual vis; /* visualization/log/save interface structure */
- u8 lvstat; /* log & vis properties */
+ u8 lvstat; /* log & vis properties */
unsigned int ewrite; /* how often to log energy */
char efb[64]; /* energy log filename */
int efd; /* fd for energy log */
void *visual; /* pointer (hack!) */
unsigned int swrite; /* how often to create a save file */
- u8 status; /* general moldyn properties */
+ u8 status; /* general moldyn properties */
t_random random; /* random interface */
} t_moldyn;
#define MOLDYN_STAT_PBY 0x10 /* y */
#define MOLDYN_STAT_PBZ 0x20 /* and z direction */
+
+/*
+ *
+ * potential parameter structures
+ *
+ */
+
+/*
+ * harmonic oscillator potential parameter structure
+ */
+
typedef struct s_ho_params {
double spring_constant;
double equilibrium_distance;
} t_ho_params;
+/*
+ * lennard jones potential parameter structure
+ */
+
typedef struct s_lj_params {
double sigma6;
double sigma12;
double epsilon4;
} t_lj_params;
-/* tersoff exchange structure to exchange 2bp and 3bp calculated values */
+/*
+ * tersoff
+ */
+/* tersoff exchange structure to exchange 2bp and 3bp calculated values */
typedef struct s_tersoff_exchange {
double f_c,df_c;
} t_tersoff_exchange;
/* tersoff multi (2!) potential parameters */
-
typedef struct s_tersoff_mult_params {
double S[2]; /* tersoff cutoff radii */
double R[2]; /* tersoff cutoff radii */
t_tersoff_exchange exchange; /* exchange between 2bp and 3bp calc */
} t_tersoff_params;
+
+
/*
+ *
* defines
+ *
*/
-/* general defines */
+/* default values */
#define MOLDYN_TEMP 273.0
#define MOLDYN_TAU 1.0e-15
-#define MOLDYN_CUTOFF 10.0e-9
+#define MOLDYN_CUTOFF 1.0e-9
#define MOLDYN_RUNS 1000000
#define MOLDYN_INTEGRATE_VERLET 0x00
#define MOLDYN_POTENTIAL_HO 0x00
#define MOLDYN_POTENTIAL_LJ 0x01
-#define MOLDYN_POTENTIAL_DEFAULT MOLDYN_POTENTIAL_LJ
+#define MOLDYN_POTENTIAL_TM 0x02
-/* phsical values */
+#define MOLDYN_SET_POTENTIAL 0x00
+#define MOLDYN_SET_
+#define MOLDYN_SET_
+#define MOLDYN_SET_
+
+/*
+ *
+ * phsical values / constants
+ *
+ */
#define K_BOLTZMANN 1.3807e-27 /* Nm/K */
#define AMU 1.660540e-27 /* kg */
#define LJ_SIGMA_SI ((0.25*sqrt(3.0)*LC_SI)/1.122462) /* m */
#define LJ_EPSILON_SI (2.1678*1.60e-19) /* Nm */
-/* function prototypes */
+
+/*
+ *
+ * function prototypes
+ *
+ */
int moldyn_usage(char **argv);
int moldyn_parse_argv(t_moldyn *moldyn,int argc,char **argv);