diff --git a/src/Solvers/MGPoissonSolver.cpp b/src/Solvers/MGPoissonSolver.cpp index 5e90eab44f5623afe39ee06c7fcef903bcb3fe92..7af57a4941ffc5c18561c6a9d844e5da520d0dfe 100644 --- a/src/Solvers/MGPoissonSolver.cpp +++ b/src/Solvers/MGPoissonSolver.cpp @@ -354,10 +354,11 @@ void MGPoissonSolver::computePotential(Field_t &rho, Vector_t hr) { for (int idy = localId[1].first(); idy <= localId[1].last(); idy++) { for (int idx = localId[0].first(); idx <= localId[0].last(); idx++) { NDIndex<3> l(Index(idx, idx), Index(idy, idy), Index(idz, idz)); - if (bp_m->isInside(idx, idy, idz)) - id++ + if (bp_m->isInside(idx, idy, idz)) { + id++; RHS->replaceGlobalValue(bp_m->getIdx(idx, idy, idz), 4.0 * M_PI * rho.localElement(l) / scaleFactor); + } } } }