#include #include #include #ifndef _MAIN_H_ #define _MAIN_H_ #define DEFAULT_NSTEPS 150000 #define DEFAULT_TIMESTEP 10.0 /* femto-second */ #define DEFAULT_CUTOFF 5.0 #define DEFAULT_SWITCH_DIST 4.0 #define DEFAULT_SWTICH_METHOD SM_C2 #define LENGTH_UNIT 3.405 /* angstrom */ #define MASS_UNIT 39.95 /* AMU */ #define ENERGY_UNIT (120.0*8.314472135196751e-07/0.0004184) /* KCAL/MOL */ #define TIME_UNIT (sqrt(MASS_UNIT*LENGTH_UNIT*LENGTH_UNIT/(120.0*8.314472135196751e-07))) /* value = 2.1546e3 femto second */ enum { /* swithing function continuity */ SM_DC=0, SM_C0, SM_C1, SM_C2, SM_MAX_SWITCH_METHOD }; const char *SWITH_METHOD_NAME[ SM_MAX_SWITCH_METHOD ]; typedef struct Data { /* SIMULATION PARAMETERS */ double dt; /* timestep */ int natoms; /* number of atoms in the system */ int n, nsteps; /* n is the current iteration, nsteps the total number */ double pe, ke, energy; /* potential kinetic and total energy */ /* PER ATOMS PARAMETERS */ double *pos; /* atom positions */ double *vel; /* atom velocities */ double *f; /* forces on each atom */ double *mass; /* atom masses */ /* OUTPUT FILE PARAMETERS - 3 files are created by this program */ FILE *sim_out; /* energy, position, & velocity: .sim */ int switch_method; double cutoff, switch_distance; double LJs, LJs_p, LJs_pp; /* potential & derivatives at switch distance */ double systemsize; /* periodic boundary conditon */ const char *outfile; } Data; int initialize(Data *data); int cleanup(Data *data); void applyPBC(Data *data); #endif /* _MAIN_H_ */