projects
/
physik
/
posic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
introduced lowmem lists
[physik/posic.git]
/
potentials
/
albe_fast.c
diff --git
a/potentials/albe_fast.c
b/potentials/albe_fast.c
index
4523938
..
45ebff9
100644
(file)
--- 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;
#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];
#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);
count=moldyn->count;
itom=moldyn->atom;
lc=&(moldyn->lc);
-#ifdef STATIC_LISTS
- atom=moldyn->atom;
-#endif
// optimized
params=moldyn->pot_params;
// optimized
params=moldyn->pot_params;
@@
-157,7
+156,9
@@
int albe_potential_force_calc(t_moldyn *moldyn) {
dnlc=lc->dnlc;
/* copy the neighbour lists */
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
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) {
while(neighbour_i[j][p]!=-1) {
- jtom=&(
a
tom[neighbour_i[j][p]]);
+ jtom=&(
i
tom[neighbour_i[j][p]]);
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);
#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) {
while(neighbour_i[k][q]!=-1) {
- ktom=&(
a
tom[neighbour_i[k][q]]);
+ ktom=&(
i
tom[neighbour_i[k][q]]);
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);
#else
that=&(neighbour_i2[k]);
list_reset_f(that);
@@
-359,6
+374,8
@@
int albe_potential_force_calc(t_moldyn *moldyn) {
#ifdef STATIC_LISTS
}
#ifdef STATIC_LISTS
}
+#elif LOWMEM_LISTS
+ }
#else
} while(list_next_f(that)!=\
L_NO_NEXT_ELEMENT);
#else
} while(list_next_f(that)!=\
L_NO_NEXT_ELEMENT);
@@
-468,8
+485,15
@@
if(moldyn->time>DSTART&&moldyn->time<DEND) {
while(neighbour_i[k][q]!=-1) {
while(neighbour_i[k][q]!=-1) {
- ktom=&(
a
tom[neighbour_i[k][q]]);
+ ktom=&(
i
tom[neighbour_i[k][q]]);
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);
#else
that=&(neighbour_i2[k]);
list_reset_f(that);
@@
-597,6
+621,8
@@
if(moldyn->time>DSTART&&moldyn->time<DEND) {
#ifdef STATIC_LISTS
}
#ifdef STATIC_LISTS
}
+#elif LOWMEM_LISTS
+ }
#else
} while(list_next_f(that)!=\
L_NO_NEXT_ELEMENT);
#else
} while(list_next_f(that)!=\
L_NO_NEXT_ELEMENT);
@@
-606,6
+632,8
@@
if(moldyn->time>DSTART&&moldyn->time<DEND) {
#ifdef STATIC_LISTS
}
#ifdef STATIC_LISTS
}
+#elif LOWMEM_LISTS
+ }
#else
} while(list_next_f(this)!=L_NO_NEXT_ELEMENT);
#endif
#else
} while(list_next_f(this)!=L_NO_NEXT_ELEMENT);
#endif