X-Git-Url: https://hackdaworld.org/gitweb/?a=blobdiff_plain;f=potentials%2Falbe_fast.c;h=45ebff9203abf296c9d3b6f5e4af454ff7049599;hb=94ddbad8d315e02d81e20a62560f2e67b4bae115;hp=6331064eb63b2f217470214b2024256cc5458acd;hpb=a198ee2eb93c0f14bdaea14722f4d98e5890935f;p=physik%2Fposic.git diff --git a/potentials/albe_fast.c b/potentials/albe_fast.c index 6331064..45ebff9 100644 --- a/potentials/albe_fast.c +++ b/potentials/albe_fast.c @@ -45,7 +45,9 @@ int albe_potential_force_calc(t_moldyn *moldyn) { #ifdef STATIC_LISTS int *neighbour_i[27]; int p,q; - t_atom *atom; +#elif LOWMEM_LISTS + int neighbour_i[27]; + int p,q; #else t_list neighbour_i[27]; t_list neighbour_i2[27]; @@ -102,9 +104,6 @@ int albe_potential_force_calc(t_moldyn *moldyn) { count=moldyn->count; itom=moldyn->atom; lc=&(moldyn->lc); -#ifdef STATIC_LISTS - atom=moldyn->atom; -#endif // optimized params=moldyn->pot_params; @@ -157,7 +156,9 @@ int albe_potential_force_calc(t_moldyn *moldyn) { dnlc=lc->dnlc; /* copy the neighbour lists */ -#ifndef STATIC_LISTS +#ifdef STATIC_LISTS +#elif LOWMEM_LISTS +#else memcpy(neighbour_i2,neighbour_i,27*sizeof(t_list)); #endif @@ -171,10 +172,17 @@ int albe_potential_force_calc(t_moldyn *moldyn) { #ifdef STATIC_LISTS p=0; - while(neighbour_i[j][p]!=0) { + while(neighbour_i[j][p]!=-1) { - jtom=&(atom[neighbour_i[j][p]]); + jtom=&(itom[neighbour_i[j][p]]); p++; +#elif LOWMEM_LISTS + p=neighbour_i[j]; + + while(p!=-1) { + + jtom=&(itom[p]); + p=lc->subcell->list[p]; #else this=&(neighbour_i[j]); list_reset_f(this); @@ -236,10 +244,17 @@ int albe_potential_force_calc(t_moldyn *moldyn) { #ifdef STATIC_LISTS q=0; - while(neighbour_i[j][q]!=0) { + while(neighbour_i[k][q]!=-1) { - ktom=&(atom[neighbour_i[k][q]]); + ktom=&(itom[neighbour_i[k][q]]); q++; +#elif LOWMEM_LISTS + q=neighbour_i[k]; + + while(q!=-1) { + + ktom=&(itom[q]); + q=lc->subcell->list[q]; #else that=&(neighbour_i2[k]); list_reset_f(that); @@ -359,6 +374,8 @@ int albe_potential_force_calc(t_moldyn *moldyn) { #ifdef STATIC_LISTS } +#elif LOWMEM_LISTS + } #else } while(list_next_f(that)!=\ L_NO_NEXT_ELEMENT); @@ -466,10 +483,17 @@ if(moldyn->time>DSTART&&moldyn->timesubcell->list[q]; #else that=&(neighbour_i2[k]); list_reset_f(that); @@ -597,6 +621,8 @@ if(moldyn->time>DSTART&&moldyn->timetime>DSTART&&moldyn->time