-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
Description
ReaDDy should support periodic boundary conditions. Following steps are necessary (at least):
- Whenever a distance between two particles is computed, use the minimal distance over the 27 (3x3x3) adjacent periodic cells. This can be done as follows:
dist_periodic(double x1, double x2, double length)
{
d_dir = (x2 - x1) * (x2 - x1);
d_per = length - d_dir;
return Math.min(d_dir, d_per);
}
dx = dist_periodic(x1,x2,Lx);
dy = dist_periodic(y1,y2,Ly);
dz = dist_periodic(z1,z2,Lz);
d = sqrt(dx^2 + dy^2 + dz^2);- Neighbor lattices needs to have periodic connectivity, i.e. boundary cells need to check cells behind the periodic boundary
When needed I (FN) can dig up code which does this - although it might be less efficient than the current ReaDDy impl.