basic linked list / cell method support implemented
[physik/posic.git] / moldyn.h
index 266436b..53a22fd 100644 (file)
--- 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);