From: hackbard Date: Thu, 27 Apr 2006 15:51:06 +0000 (+0000) Subject: muss zum c3a ... X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=877139ec35cf357c96fdb314f690fd6075554c47;p=physik%2Fposic.git muss zum c3a ... --- diff --git a/moldyn.c b/moldyn.c index dbb3e6c..1772067 100644 --- a/moldyn.c +++ b/moldyn.c @@ -511,19 +511,23 @@ int moldyn_integrate(t_moldyn *moldyn) { 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;itime_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); @@ -597,13 +601,13 @@ int velocity_verlet(t_moldyn *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); @@ -701,15 +705,19 @@ double potential_lennard_jones(t_moldyn *moldyn) { 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; @@ -717,8 +725,15 @@ double potential_lennard_jones(t_moldyn *moldyn) { u=0.0; for(i=0;ix; + 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));