/* moldyn main structure */
typedef struct s_moldyn {
int count; /* total amount of atoms */
+ double mass; /* total system mass */
t_atom *atom; /* pointer to the atoms */
t_3dvec dim; /* dimensions of the simulation volume */
double gp_sum; /* sum over all gp */
double mean_gp; /* mean value of gp */
+ double mean_v; /* mean of virial */
+ double virial_sum; /* sum over all calculated virials */
+
double p_ref; /* reference pressure */
double p; /* actual pressure (computed by virial) */
double p_sum; /* sum over all p */
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_mean; /* average of kinetic energy */
+ double v_mean; /* average of potential energy */
+ double k2_sum; /* sum of kinetic energy squared */
+ double v2_sum; /* sum of potential energy squared */
+ double k2_mean; /* average of kinetic energy squared */
+ double v2_mean; /* average of potential energy squared */
+ double dk2_mean; /* mean square kinetic energy fluctuations */
+ double dv2_mean; /* 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 */
#define PASCAL (NEWTON/(METER*METER)) /* 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 VERBOSE 1
#define QUIET 0
+#define SCALE_UP 'u'
+#define SCALE_DOWN 'd'
+#define SCALE_DIRECT 'D'
+
/*
* potential related phsical values / constants
*
#define ONE_THIRD (1.0/3.0)
#define C 0x06
-//#define LC_C 3.567 /* A */
-#define LC_C 3.560 /* A */
+#define LC_C 3.567 /* A */
#define M_C 12.011 /* amu */
#define SI 0x0e
#define LJ_SIGMA_SI ((0.25*sqrt(3.0)*LC_SI)/1.122462) /* A */
//#define LJ_SIGMA_SI (LC_SI/1.122462) /* A */
-//#define LJ_SIGMA_SI (0.5*sqrt(2.0)*LC_SI/1.122462) /* A */
+//#define LJ_SIGMA_SI (0.5*sqrt(2.0)*LC_SI/1.122462) /* A */
#define LJ_EPSILON_SI (2.1678*EV) /* NA */
#define TM_R_SI 2.7 /* A */
#define ALBE_D_SI 0.81472
#define ALBE_H_SI 0.259
+#define LC_SI_ALBE 5.429
+
#define ALBE_R_C (2.00-0.15)
#define ALBE_S_C (2.00+0.15)
#define ALBE_A_C (6.00*EV/1.167)
#define ALBE_D_C 6.28433
#define ALBE_H_C 0.5556
+#define LC_C_ALBE 3.566
+
#define ALBE_R_SIC (2.40-0.20)
#define ALBE_S_SIC (2.40+0.10)
#define ALBE_A_SIC (4.36*EV/0.847)
#define ALBE_D_SIC 180.314
#define ALBE_H_SIC 0.68
-#define ALBE_CHI_SIC 1.0
+#define LC_SIC_ALBE 4.359
+
/*
- * lattice constants
+ * lattice types
*/
#define CUBIC 0x01
int destroy_atoms(t_moldyn *moldyn);
int thermal_init(t_moldyn *moldyn,u8 equi_init);
+double total_mass_calc(t_moldyn *moldyn);
double temperature_calc(t_moldyn *moldyn);
double get_temperature(t_moldyn *moldyn);
int scale_velocity(t_moldyn *moldyn,u8 equi_init);
double pressure_calc(t_moldyn *moldyn);
+int energy_fluctuation_calc(t_moldyn *moldyn);
+int get_heat_capacity(t_moldyn *moldyn);
double thermodynamic_pressure_calc(t_moldyn *moldyn);
double get_pressure(t_moldyn *moldyn);
int scale_volume(t_moldyn *moldyn);
-int scale_dim(t_moldyn *moldyn,double scale,u8 x,u8 y,u8 z);
-int scale_atoms(t_moldyn *moldyn,double scale,u8 x,u8 y,u8 z);
+int scale_dim(t_moldyn *moldyn,u8 dir,double scale,u8 x,u8 y,u8 z);
+int scale_atoms(t_moldyn *moldyn,u8 dir,double scale,u8 x,u8 y,u8 z);
double e_kin_calc(t_moldyn *moldyn);
double get_total_energy(t_moldyn *moldyn);
int moldyn_bc_check(t_moldyn *moldyn);
+int get_line(int fd,char *line,int max);
+
#endif