Permalink
Browse files

Merge pull request #12766 from dschwen/ebsd_bounds_12764

Meaningful error for out of bounds points
  • Loading branch information...
permcody committed Jan 24, 2019
2 parents cd1fbf4 + 83daaa3 commit 23136f5f267bd40e19577d3621f7a852ec820bc9
Showing with 5 additions and 1 deletion.
  1. +5 −1 modules/phase_field/src/userobjects/EBSDReader.C
@@ -269,11 +269,15 @@ EBSDReader::indexFromPoint(const Point & p) const

x_index = (unsigned int)((p(0) - _minx) / _dx);
y_index = (unsigned int)((p(1) - _miny) / _dy);

if (p(0) <= _minx || p(0) >= _maxx || p(1) <= _miny || p(1) >= _maxy)
mooseError("Data points must be on the interior of the mesh elements. In EBSDReader ", name());
if (_mesh_dimension == 3)
{
z_index = (unsigned int)((p(2) - _minz) / _dz);
global_index = z_index * _ny;
if (p(2) <= _minz || p(2) >= _maxz)
mooseError("Data points must be on the interior of the mesh elements. In EBSDReader ",
name());
}
else
global_index = 0;

0 comments on commit 23136f5

Please sign in to comment.