In the LB particle coupling code, real particles are folded onto the local domain to eliminate edge cases, such as when a particle is located at pos=[-1e-30,-1e-30,-1e-30] in unfolded coordinates. Here is the corresponding code:
In addition, the inertialess tracers code converts positions from MD units to LB units, even though add_md_force() expects positions in MD units since it calls LB::Solver::add_force_density(), which converts positions from MD units to LB units:
When using agrid values other than unity, inertialess tracers are converted twice. The confusion is probably due to the fact that LB::Solver methods don't convert all quantities. For example, forces aren't converted, but positions and velocities are.
The virtual_sites_tracers.py test fails when agrid=0.5 in virtual_sites_tracers_common.py.
This bug most likely affects all waLBerla versions of ESPResSo. Here is the same bug in the original commit that introduced waLBerla on the python branch:
In the LB particle coupling code, real particles are folded onto the local domain to eliminate edge cases, such as when a particle is located at
pos=[-1e-30,-1e-30,-1e-30]
in unfolded coordinates. Here is the corresponding code:https://github.com/espressomd/espresso/blob/4285bb685c4c5e5b1fca8a3c4abfada8c5f0319e/src/core/lb/particle_coupling.cpp#L179-L180
The LB inertialess tracers do not take this precaution:
https://github.com/espressomd/espresso/blob/4285bb685c4c5e5b1fca8a3c4abfada8c5f0319e/src/core/virtual_sites/lb_tracers.cpp#L63-L65
In addition, the inertialess tracers code converts positions from MD units to LB units, even though
add_md_force()
expects positions in MD units since it callsLB::Solver::add_force_density()
, which converts positions from MD units to LB units:https://github.com/espressomd/espresso/blob/4285bb685c4c5e5b1fca8a3c4abfada8c5f0319e/src/core/lb/Solver.cpp#L198-L200
When using
agrid
values other than unity, inertialess tracers are converted twice. The confusion is probably due to the fact thatLB::Solver
methods don't convert all quantities. For example, forces aren't converted, but positions and velocities are.Here is a MWE:
Output:
Expected output:
The
virtual_sites_tracers.py
test fails whenagrid=0.5
invirtual_sites_tracers_common.py
.This bug most likely affects all waLBerla versions of ESPResSo. Here is the same bug in the original commit that introduced waLBerla on the python branch:
https://github.com/espressomd/espresso/blob/3fd170980bed30c430a9b0264e9504632b4b7326/src/core/virtual_sites/VirtualSitesInertialessTracers.cpp#L74-L76