From f02c77b6d05c60276d2db0b44d1aa0ee6b905211 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 24 Apr 2020 20:01:57 +0200 Subject: [PATCH] more reasonable tolerance still relatively high because ctf files store position with constant number of digits and floating dot. Hence, the precision is very low --- python/damask/grid_filters.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/damask/grid_filters.py b/python/damask/grid_filters.py index 4fb1012c0..62e9147f7 100644 --- a/python/damask/grid_filters.py +++ b/python/damask/grid_filters.py @@ -237,8 +237,8 @@ def cell_coord0_gridSizeOrigin(coord0,ordered=True): start = origin + delta*.5 end = origin - delta*.5 + size - - atol = _np.max(size) + + atol = _np.max(size)*5e-2 if not (_np.allclose(coords[0],_np.linspace(start[0],end[0],grid[0]),atol=atol) and \ _np.allclose(coords[1],_np.linspace(start[1],end[1],grid[1]),atol=atol) and \ _np.allclose(coords[2],_np.linspace(start[2],end[2],grid[2]),atol=atol)): @@ -386,7 +386,7 @@ def node_coord0_gridSizeOrigin(coord0,ordered=True): if (grid+1).prod() != len(coord0): raise ValueError('Data count {} does not match grid {}.'.format(len(coord0),grid)) - atol = _np.max(size) + atol = _np.max(size)*5e-2 if not (_np.allclose(coords[0],_np.linspace(mincorner[0],maxcorner[0],grid[0]+1),atol=atol) and \ _np.allclose(coords[1],_np.linspace(mincorner[1],maxcorner[1],grid[1]+1),atol=atol) and \ _np.allclose(coords[2],_np.linspace(mincorner[2],maxcorner[2],grid[2]+1),atol=atol)):