Skip to content

Commit

Permalink
Changed behaviour of Lattice::get_next_boundary_point so that it beha…
Browse files Browse the repository at this point in the history
…ves like it used to (no error thrown when ran out of boundary points)
  • Loading branch information
ceschoon committed Jun 18, 2024
1 parent 0fad9f5 commit ed93cce
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/Lattice.h
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ void init(double L[])
bool get_next_boundary_point(int &ix, int &iy, int &iz) const
{
int b = boundary_width_;
long pos_input = pos(ix,iy,iz);

// are we in x-boundary ?
if(ix <= b || ix >= Nx_-b)
Expand Down Expand Up @@ -346,7 +347,9 @@ void init(double L[])
if(iz > b && iz < Nz_-1) {iz++; ix = b+1; iy = b+1; return true;}
}
// no where left to go or we were fed a bad starting point
throw std::runtime_error("Lattice::get_next_boundary_point called with bad arguments");
if (!is_boundary_point(pos_input))
throw std::runtime_error("Lattice::get_next_boundary_point called with bad arguments");
else return false;
}

bool get_next_boundary_point(long &p) const
Expand Down

0 comments on commit ed93cce

Please sign in to comment.