X-Git-Url: https://www.hackdaworld.org/gitweb/?a=blobdiff_plain;f=moldyn.h;h=2d4ca4873109a80732606ff7f425d764d8b59259;hb=95cfeec6fbbfa975d5ac5b99ec3f7386ca3d6071;hp=a595585981d95ffac6742251bc9021c0ecb23849;hpb=20409ee0c545235c9246edde2d3cda5de0ddabde;p=physik%2Fposic.git diff --git a/moldyn.h b/moldyn.h index a595585..2d4ca48 100644 --- a/moldyn.h +++ b/moldyn.h @@ -49,6 +49,8 @@ typedef struct s_atom { #define ATOM_ATTR_FP 0x01 /* fixed position (bulk material) */ #define ATOM_ATTR_HB 0x02 /* coupled to heat bath (velocity scaling) */ +#define ATOM_ATTR_VA 0x04 /* visualize this atom */ +#define ATOM_ATTR_VB 0x08 /* visualize the bond of this atom */ #define ATOM_ATTR_1BP 0x10 /* single paricle potential */ #define ATOM_ATTR_2BP 0x20 /* pair potential */ @@ -64,8 +66,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; @@ -76,8 +76,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 */ @@ -101,6 +111,7 @@ typedef struct s_moldyn { double cutoff; /* cutoff radius */ double cutoff_square; /* square of the cutoff radius */ double nnd; /* nearest neighbour distance (optional) */ + double bondlen[3]; /* bond lengthes (only 2 atomic systems) */ t_linkcell lc; /* linked cell list interface */ @@ -324,7 +335,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)) @@ -338,7 +349,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)) @@ -350,9 +361,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)) @@ -372,7 +383,6 @@ typedef struct s_moldyn { #define FCC 0x02 #define DIAMOND 0x04 - /* * * function prototypes @@ -388,6 +398,7 @@ int moldyn_shutdown(t_moldyn *moldyn); int set_int_alg(t_moldyn *moldyn,u8 algo); int set_cutoff(t_moldyn *moldyn,double cutoff); +int set_bondlen(t_moldyn *moldyn,double b0,double b1,double bm); int set_temperature(t_moldyn *moldyn,double t_ref); int set_pressure(t_moldyn *moldyn,double p_ref); int set_pt_scale(t_moldyn *moldyn,u8 ptype,double ptc,u8 ttype,double ttc); @@ -414,6 +425,7 @@ 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); @@ -465,4 +477,8 @@ int moldyn_bc_check(t_moldyn *moldyn); int get_line(int fd,char *line,int max); +int visual_init(t_moldyn *moldyn,char *filebase); +int visual_atoms(t_moldyn *moldyn); + #endif +