Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GridBase<>::boundingBox().inbounds() does not work correctly with torus topologies #64

Open
klreuther opened this issue Feb 8, 2019 · 0 comments

Comments

@klreuther
Copy link

klreuther commented Feb 8, 2019

If the grid overlaps the boundaries of the actual simulation domain, it should include cells on the other side of the domain. The bounding box does not reflect that.

Not Working:

Coord<3> c(x, y, z);
box = grid->boundingBox();
if (box.inbounds(c))
   { … }

Workaround:

Coord<3> c(x, y, z);
Coord<3> relativeCoord = c - box.origin;
Coord<3> normalizedRelativeCoord = 
	LibGeoDecomp::Topologies::Torus<3>::Topology::normalize(relativeCoord, gridDimensions());
if (box.inBounds(normalizedRelativeCoord + box.origin))
  { … }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant