X-Git-Url: https://www.hackdaworld.org/gitweb/?a=blobdiff_plain;f=moldyn.h;h=83414dd09fc045b99f07bca932c5c855a0d6d96b;hb=c40d54eb3e319b17b2f6174c4eddcfd6ee3a407b;hp=212db144cd500c9c578b2b842c596999c564067e;hpb=e2c5d8b0eb4ce6faeb48830634eef522dbdb52b0;p=physik%2Fposic.git diff --git a/moldyn.h b/moldyn.h index 212db14..83414dd 100644 --- a/moldyn.h +++ b/moldyn.h @@ -33,11 +33,13 @@ typedef struct s_virial { /* the atom of the md simulation */ typedef struct s_atom { + t_3dvec r_0; /* initial position */ t_3dvec r; /* position */ t_3dvec v; /* velocity */ t_3dvec f; /* force */ t_virial virial; /* virial */ double e; /* site energy */ + double ekin; /* kinetic energy */ int element; /* number of element in pse */ double mass; /* atom mass */ u8 brand; /* brand id */ @@ -62,8 +64,6 @@ typedef struct s_linkcell { int dnlc; /* direct neighbour lists counter */ } t_linkcell; -#include "visual/visual.h" - /* moldyn schedule structure */ typedef struct s_moldyn_schedule { int count; @@ -74,8 +74,18 @@ typedef struct s_moldyn_schedule { void *hook_params; } t_moldyn_schedule; +/* visualization structure */ +typedef struct s_visual { + int fd; /* rasmol script file descriptor */ + char fb[128]; /* basename of the save files */ + t_3dvec dim; /* dimensions of the simulation cell */ +} t_visual; + /* moldyn main structure */ typedef struct s_moldyn { + int argc; /* number of arguments */ + char **args; /* pointer to arguments */ + int count; /* total amount of atoms */ double mass; /* total system mass */ t_atom *atom; /* pointer to the atoms */ @@ -109,18 +119,24 @@ typedef struct s_moldyn { double t_sum; /* sum over all t */ double t_avg; /* average value of t */ - t_virial virial; /* global virial (absolute coordinates) */ + t_virial gvir; /* global virial (absolute coordinates) */ + double gv; + double gv_sum; + double gv_avg; + double gp; /* pressure computed from global virial */ double gp_sum; /* sum over all gp */ double gp_avg; /* average value of gp */ - double virial_avg; /* average of virial */ + double virial; /* actual virial */ double virial_sum; /* sum over all calculated virials */ + double virial_avg; /* average of virial */ double p_ref; /* reference pressure */ double p; /* actual pressure (computed by virial) */ double p_sum; /* sum over all p */ double p_avg; /* average value of p */ + t_3dvec tp; /* thermodynamic pressure dU/dV */ double dv; /* dV for thermodynamic pressure calc */ @@ -316,7 +332,7 @@ typedef struct s_moldyn { #define ALBE_R_SI (2.82-0.14) #define ALBE_S_SI (2.82+0.14) #define ALBE_A_SI (3.24*EV/0.842) -#define ALBE_B_SI (1.842*3.24*EV/0.842) +#define ALBE_B_SI (-1.842*3.24*EV/0.842) #define ALBE_R0_SI 2.232 #define ALBE_LAMBDA_SI (1.4761*sqrt(2.0*1.842)) #define ALBE_MU_SI (1.4761*sqrt(2.0/1.842)) @@ -330,7 +346,7 @@ typedef struct s_moldyn { #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_B_C (2.167*6.00*EV/1.167) +#define ALBE_B_C (-2.167*6.00*EV/1.167) #define ALBE_R0_C 1.4276 #define ALBE_LAMBDA_C (2.0099*sqrt(2.0*2.167)) #define ALBE_MU_C (2.0099*sqrt(2.0/2.167)) @@ -342,9 +358,9 @@ typedef struct s_moldyn { #define ALBE_LC_C 3.566 #define ALBE_R_SIC (2.40-0.20) -#define ALBE_S_SIC (2.40+0.10) +#define ALBE_S_SIC (2.40+0.20) #define ALBE_A_SIC (4.36*EV/0.847) -#define ALBE_B_SIC (1.847*4.36*EV/0.847) +#define ALBE_B_SIC (-1.847*4.36*EV/0.847) #define ALBE_R0_SIC 1.79 #define ALBE_LAMBDA_SIC (1.6991*sqrt(2.0*1.847)) #define ALBE_MU_SIC (1.6991*sqrt(2.0/1.847)) @@ -364,7 +380,6 @@ typedef struct s_moldyn { #define FCC 0x02 #define DIAMOND 0x04 - /* * * function prototypes @@ -404,11 +419,12 @@ int moldyn_log_shutdown(t_moldyn *moldyn); int create_lattice(t_moldyn *moldyn,u8 type,double lc,int element,double mass, u8 attr,u8 brand,int a,int b,int c,t_3dvec *origin); +int add_atom(t_moldyn *moldyn,int element,double mass,u8 brand,u8 attr, + t_3dvec *r,t_3dvec *v); +int del_atom(t_moldyn *moldyn,int tag); int cubic_init(int a,int b,int c,double lc,t_atom *atom,t_3dvec *origin); int fcc_init(int a,int b,int c,double lc,t_atom *atom,t_3dvec *origin); int diamond_init(int a,int b,int c,double lc,t_atom *atom,t_3dvec *origin); -int add_atom(t_moldyn *moldyn,int element,double mass,u8 brand,u8 attr, - t_3dvec *r,t_3dvec *v); int destroy_atoms(t_moldyn *moldyn); int thermal_init(t_moldyn *moldyn,u8 equi_init); @@ -416,6 +432,7 @@ 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 virial_sum(t_moldyn *moldyn); double pressure_calc(t_moldyn *moldyn); int energy_fluctuation_calc(t_moldyn *moldyn); int get_heat_capacity(t_moldyn *moldyn); @@ -456,4 +473,8 @@ int moldyn_bc_check(t_moldyn *moldyn); int get_line(int fd,char *line,int max); +int visual_init(t_visual *v,char *filebase); +int visual_atoms(t_visual *v,double time,t_atom *atom,int n); + #endif +