X-Git-Url: https://hackdaworld.org/gitweb/?a=blobdiff_plain;f=potentials%2Falbe_fast.c;fp=potentials%2Falbe_fast.c;h=45ebff9203abf296c9d3b6f5e4af454ff7049599;hb=99a9305339d568641a7ec55783faa161b3c33311;hp=4523938ba271e4d5de6e899ac0b892e4d014688c;hpb=e3e1d8e2f7fc65748c8da0accb9b3e6b0b1eb049;p=physik%2Fposic.git diff --git a/potentials/albe_fast.c b/potentials/albe_fast.c index 4523938..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 @@ -173,8 +174,15 @@ int albe_potential_force_calc(t_moldyn *moldyn) { 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); @@ -238,8 +246,15 @@ int albe_potential_force_calc(t_moldyn *moldyn) { 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); @@ -468,8 +485,15 @@ 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