Skip to content
Snippets Groups Projects
Commit 4f2317af authored by Gareth Tribello's avatar Gareth Tribello
Browse files

Added check on whether point is within bounds in GridVessel

parent 12be3adf
No related branches found
No related tags found
No related merge requests found
...@@ -139,6 +139,7 @@ void GridVessel::getIndices( const std::vector<double>& point, std::vector<unsig ...@@ -139,6 +139,7 @@ void GridVessel::getIndices( const std::vector<double>& point, std::vector<unsig
for(unsigned i=0;i<dimension;++i){ for(unsigned i=0;i<dimension;++i){
indices[i]=std::floor( (point[i] - min[i])/dx[i] ); indices[i]=std::floor( (point[i] - min[i])/dx[i] );
if( pbc[i] ) indices[i]=indices[i]%nbin[i]; if( pbc[i] ) indices[i]=indices[i]%nbin[i];
else if( indices[i]>nbin[i] ) plumed_merror("point is outside grid range");
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment