X-Git-Url: https://hackdaworld.org/gitweb/?a=blobdiff_plain;f=moldyn.h;h=2d1a438b3935b05cc8dfd791a6505b8abf03a093;hb=0fbd532d8ddce9848df592ed586ffba439369284;hp=5160668f5379b72a1cee78db4aa31f7ca381299c;hpb=92ef07d77a4c879527180224acea73a3f6564497;p=physik%2Fposic.git diff --git a/moldyn.h b/moldyn.h index 5160668..2d1a438 100644 --- a/moldyn.h +++ b/moldyn.h @@ -77,6 +77,7 @@ typedef struct s_moldyn_schedule { /* 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 */ @@ -139,9 +140,26 @@ typedef struct s_moldyn { 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 */ @@ -209,7 +227,9 @@ typedef struct s_moldyn { #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 @@ -388,10 +408,13 @@ int add_atom(t_moldyn *moldyn,int element,double mass,u8 brand,u8 attr, 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); @@ -427,4 +450,6 @@ int check_per_bound(t_moldyn *moldyn,t_3dvec *a); int moldyn_bc_check(t_moldyn *moldyn); +int get_line(int fd,char *line,int max); + #endif