espressomd-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ESPResSo-devel] possible bug in external_potential.cpp


From: Ivan Cimrak
Subject: [ESPResSo-devel] possible bug in external_potential.cpp
Date: Thu, 22 Jan 2015 15:30:15 +0100

Hello,

Crawling through the code I found a possible bug in current master
version on github, namely in file
master/src/core/external_potential.cpp. I think the line
memcpy(img, p->r.p, 3*sizeof(int));
should be
memcpy(img, p->l.i, 3*sizeof(int));

Could you anybody check this?
Thank

Ivan


void add_external_potential_tabulated_forces(ExternalPotential* e,
Particle* p) {
if (p->p.type >= e->n_particle_types || e->scale[p->p.type] == 0 ) {
return;
}
double field[3];
double ppos[3];
int img[3];
memcpy(ppos, p->r.p, 3*sizeof(double));
memcpy(img, p->r.p, 3*sizeof(int));
fold_position(ppos, img);
e->tabulated.potential.interpolate_gradient(p->r.p, field);
p->f.f[0]-=e->scale[p->p.type]*field[0];
p->f.f[1]-=e->scale[p->p.type]*field[1];
p->f.f[2]-=e->scale[p->p.type]*field[2];
// printf("%d %f force: %f %f %f\n", p->p.type, e->scale[p->p.type],
e->scale[p->p.type]*field[0], e->scale[p->p.type]*field[1],
e->scale[p->p.type]*field[2]);
}


-- 
Ivan Cimrak
FRI Zilinska Univerzita v Ziline
personal web: http://www.kst.fri.uniza.sk/~icimrak/
cell-in-fluid group: http://cell-in-fluid.fri.uniza.sk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]