X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=moldyn.h;h=3bc40c0cd86235e282dd0daf79b46f9488ad3519;hb=acdd9a6aa72f3692ccd03cc0df20e3d60555f555;hp=85a4950cc513c9cde9b7dc0cb66f9d49503e3b8f;hpb=ea612b88a0588b8f46fafaebf3b37fb46c83c0cf;p=physik%2Fposic.git diff --git a/moldyn.h b/moldyn.h index 85a4950..3bc40c0 100644 --- a/moldyn.h +++ b/moldyn.h @@ -85,11 +85,15 @@ typedef struct s_moldyn { /* potential force function and parameter pointers */ int (*func1b)(struct s_moldyn *moldyn,t_atom *ai); int (*func2b)(struct s_moldyn *moldyn,t_atom *ai,t_atom *aj,u8 bc); - int (*func2b_post)(struct s_moldyn *moldyn,t_atom *ai,t_atom *aj,u8 bc); - int (*func3b)(struct s_moldyn *moldyn,t_atom *ai,t_atom *aj,t_atom *ak, - u8 bck); + int (*func3b_j1)(struct s_moldyn *moldyn,t_atom *ai,t_atom *aj,u8 bc); + int (*func3b_j2)(struct s_moldyn *moldyn,t_atom *ai,t_atom *aj,u8 bc); + int (*func3b_j3)(struct s_moldyn *moldyn,t_atom *ai,t_atom *aj,u8 bc); + int (*func3b_k1)(struct s_moldyn *moldyn, + t_atom *ai,t_atom *aj,t_atom *ak,u8 bck); + int (*func3b_k2)(struct s_moldyn *moldyn, + t_atom *ai,t_atom *aj,t_atom *ak,u8 bck); void *pot_params; - //int (*potential_force_function)(struct s_moldyn *moldyn); + unsigned char run3bp; double cutoff; /* cutoff radius */ double cutoff_square; /* square of the cutoff radius */ @@ -99,9 +103,18 @@ typedef struct s_moldyn { double t_ref; /* reference temperature */ double t; /* actual temperature */ + double t_sum; /* sum over all t */ + double mean_t; /* mean value of t */ + + t_virial virial; /* global virial (absolute coordinates) */ + double gp; /* pressure computed from global virial */ + double gp_sum; /* sum over all gp */ + double mean_gp; /* mean value of gp */ double p_ref; /* reference pressure */ double p; /* actual pressure (computed by virial) */ + double p_sum; /* sum over all p */ + double mean_p; /* mean value of p */ t_3dvec tp; /* thermodynamic pressure dU/dV */ double dv; /* dV for thermodynamic pressure calc */ @@ -121,7 +134,7 @@ typedef struct s_moldyn { double tau; /* delta t */ double time; /* absolute time */ double tau_square; /* delta t squared */ - double elapsed; /* total elapsed time */ + int total_steps; /* total steps */ double energy; /* potential energy */ double ekin; /* kinetic energy */ @@ -175,7 +188,7 @@ typedef struct s_moldyn { #define P_SCALE_DIRECT 0x08 /* direct p control */ /* - * default values + * default values & units * * - length unit: 1 A (1 A = 1e-10 m) * - time unit: 1 fs (1 fs = 1e-15 s) @@ -191,7 +204,9 @@ typedef struct s_moldyn { #define KILOGRAM (1.0/AMU) /* amu */ #define NEWTON (METER*KILOGRAM/(SECOND*SECOND)) /* A amu / fs^2 */ #define PASCAL (NEWTON/(METER*METER)) /* N / A^2 */ -#define ATM ((1.0133e5*PASCAL)) /* N / A^2 */ +#define BAR ((1.0e5*PASCAL)) /* N / A^2 */ +#define K_BOLTZMANN (1.380650524e-23*METER*NEWTON) /* NA/K */ +#define EV (1.6021765314e-19*METER*NEWTON) /* NA */ #define MOLDYN_TEMP 273.0 #define MOLDYN_TAU 1.0 @@ -220,24 +235,22 @@ typedef struct s_moldyn { #define QUIET 0 /* - * - * phsical values / constants - * + * potential related phsical values / constants * */ #define ONE_THIRD (1.0/3.0) -#define K_BOLTZMANN (1.380650524e-23*METER*NEWTON) /* NA/K */ -#define EV (1.6021765314e-19*METER*NEWTON) /* NA */ - #define C 0x06 +#define LC_C (0.3567e-9*METER) /* A */ #define M_C 12.011 /* amu */ #define SI 0x0e #define LC_SI (0.543105e-9*METER) /* A */ #define M_SI 28.08553 /* amu */ +#define LC_3C_SIC (0.43596e-9*METER) /* A */ + #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 */ @@ -269,6 +282,8 @@ typedef struct s_moldyn { #define TM_CHI_SIC 0.9776 +#define TM_LC_3C_SIC (0.432e-9*METER) /* A */ + /* * lattice constants */ @@ -284,10 +299,9 @@ typedef struct s_moldyn { * */ -typedef int (*pf_func1b)(t_moldyn *,t_atom *ai); -typedef int (*pf_func2b)(t_moldyn *,t_atom *,t_atom *,u8 bc); -typedef int (*pf_func2b_post)(t_moldyn *,t_atom *,t_atom *,u8 bc); -typedef int (*pf_func3b)(t_moldyn *,t_atom *,t_atom *,t_atom *,u8 bc); +typedef int (*pf_func1b)(t_moldyn *,t_atom *); +typedef int (*pf_func2b)(t_moldyn *,t_atom *,t_atom *,u8); +typedef int (*pf_func3b)(t_moldyn *,t_atom *,t_atom *,t_atom *,u8); int moldyn_init(t_moldyn *moldyn,int argc,char **argv); int moldyn_shutdown(t_moldyn *moldyn); @@ -302,8 +316,11 @@ int set_nn_dist(t_moldyn *moldyn,double dist); int set_pbc(t_moldyn *moldyn,u8 x,u8 y,u8 z); int set_potential1b(t_moldyn *moldyn,pf_func1b func); int set_potential2b(t_moldyn *moldyn,pf_func2b func); -int set_potential2b_post(t_moldyn *moldyn,pf_func2b_post func); -int set_potential3b(t_moldyn *moldyn,pf_func3b func); +int set_potential3b_j1(t_moldyn *moldyn,pf_func2b func); +int set_potential3b_j2(t_moldyn *moldyn,pf_func2b func); +int set_potential3b_j3(t_moldyn *moldyn,pf_func2b func); +int set_potential3b_k1(t_moldyn *moldyn,pf_func3b func); +int set_potential3b_k2(t_moldyn *moldyn,pf_func3b func); int set_potential_params(t_moldyn *moldyn,void *params); int moldyn_set_log_dir(t_moldyn *moldyn,char *dir); @@ -312,7 +329,7 @@ int moldyn_set_log(t_moldyn *moldyn,u8 type,int timer); 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); + u8 attr,u8 brand,int a,int b,int c,t_3dvec *origin); 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); @@ -331,8 +348,7 @@ 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); -double get_e_kin(t_moldyn *moldyn); -double update_e_kin(t_moldyn *moldyn); +double e_kin_calc(t_moldyn *moldyn); double get_total_energy(t_moldyn *moldyn); t_3dvec get_total_p(t_moldyn *moldyn);