X-Git-Url: https://hackdaworld.org/gitweb/?a=blobdiff_plain;f=moldyn.h;h=53a22fdd0d0d3e2e3eb09caa451ea63383c89173;hb=881d130efd1104bd886507e3d90f262f7a82cf2d;hp=266436bf3db718a55a0b1f149d749dfcb0c51a5d;hpb=bdb198c5a5fe38361d10f98e7db366b0915e56fb;p=physik%2Fposic.git diff --git a/moldyn.h b/moldyn.h index 266436b..53a22fd 100644 --- a/moldyn.h +++ b/moldyn.h @@ -10,6 +10,7 @@ #include "math/math.h" #include "random/random.h" +#include "list/list.h" /* datatypes */ @@ -17,11 +18,18 @@ typedef struct s_atom { t_3dvec r; /* positions */ t_3dvec v; /* velocities */ t_3dvec f; /* forces */ + t_3dvec dr; /* delta r for verlet list updates */ int element; /* number of element in pse */ double mass; /* atom mass */ - //t_list vicinity /* verlet neighbour list */ + t_list verlet; /* verlet neighbour list */ } t_atom; +typedef struct s_linkcell { + int nx,ny,nz; + double x,y,z; + t_list *subcell; +} t_linkcell; + #include "visual/visual.h" typedef struct s_moldyn { @@ -33,8 +41,14 @@ typedef struct s_moldyn { double (*potential)(struct s_moldyn *moldyn); int (*force)(struct s_moldyn *moldyn); void *pot_params; + /* cut off radius, verlet list & co */ double cutoff; double cutoff_square; + double r_verlet; + double dr_max1; + double dr_max2; + /* linked list / cell method */ + t_linkcell lc; /* temperature */ double t; /* integration of newtons equations */ @@ -129,6 +143,13 @@ t_3dvec get_total_p(t_atom *atom,int count); double estimate_time_step(t_moldyn *moldyn,double nn_dist,double t); +int verlet_list_init(t_moldyn *moldyn); +int link_cell_init(t_moldyn *moldyn); +int verlet_list_update(t_moldyn *moldyn); +int link_cell_update(t_moldyn *moldyn); +int verlet_list_shutdown(t_moldyn *moldyn); +int link_cell_shutdown(t_moldyn *moldyn); + int moldyn_integrate(t_moldyn *moldyn); int velocity_verlet(t_moldyn *moldyn);