return -1;
}
- /* create the verlet list */
- verlet_list_update(moldyn);
+ /* create the neighbour list */
+ //verlet_list_update(moldyn);
+ link_cell_update(moldyn);
/* calculate initial forces */
moldyn->force(moldyn);
for(i=0;i<moldyn->time_steps;i++) {
- /* check for velet list update */
+ /* show runs */
printf(".");
- if(moldyn->dr_max1+moldyn->dr_max2>rlc) {
- printf("\n");
- verlet_list_update(moldyn);
- }
+
+ /* neighbour list update */
+ link_cell_update(moldyn);
+ //if(moldyn->dr_max1+moldyn->dr_max2>rlc) {
+ // printf("\n");
+ // verlet_list_update(moldyn);
+ //}
/* integration step */
moldyn->integrate(moldyn);
v3_add(&(atom[i].dr),&(atom[i].dr),&delta);
v3_per_bound(&(atom[i].r),&(moldyn->dim));
- /* set maximum dr (possible list update) */
- dr=v3_norm(&(atom[i].dr));
- if(dr>moldyn->dr_max1) {
- moldyn->dr_max2=moldyn->dr_max1;
- moldyn->dr_max1=dr;
- }
- else if(dr>moldyn->dr_max2) moldyn->dr_max2=dr;
+ /* set maximum dr (possible list update) [obsolete] */
+ //dr=v3_norm(&(atom[i].dr));
+ //if(dr>moldyn->dr_max1) {
+ // moldyn->dr_max2=moldyn->dr_max1;
+ // moldyn->dr_max1=dr;
+ //}
+ //else if(dr>moldyn->dr_max2) moldyn->dr_max2=dr;
/* velocities */
v3_scale(&delta,&(atom[i].f),0.5*tau/atom[i].mass);
t_lj_params *params;
t_atom *atom,*btom;
+ t_linkcell *lc;
int i;
int count;
t_3dvec distance;
double d,help;
double u;
double eps,sig6,sig12;
+ int i,j,k;
+ int ni,nj,nk;
params=moldyn->pot_params;
atom=moldyn->atom;
+ lc=&(moldyn->lc);
count=moldyn->count;
eps=params->epsilon4;
sig6=params->sigma6;
u=0.0;
for(i=0;i<count;i++) {
- list_reset(&(atom[i].verlet));
- if(atom[i].verlet.current==NULL) continue;
+ /* verlet list [obsolete] */
+ //list_reset(&(atom[i].verlet));
+ //if(atom[i].verlet.current==NULL) continue;
+
+ /* determine cell */
+ ni=atom[i].r.x/lc->x;
+ nj=atom[i].r.y/lc->y;
+ nk=atom[i].r.z/lc->z;
+
while(1) {
btom=atom[i].verlet.current->data;
v3_sub(&distance,&(atom[i].r),&(btom->r));