def test_get_coord_sys_3D(): """Test the _get_coord_sys function for a 3D mesh.""" if not HAVE_PYMOAB: raise SkipTest # Create mesh xvals = [-1.0, 0.0, 2.0] yvals = [-3.0, 0.0, 3.0] zvals = [-1.0, 0.0, 1.0] mesh = Mesh( structured_coords=[xvals, yvals, zvals], structured=True, structured_ordering="xyz", ) # Expected values igeom_expected = "x-y-z" bounds_expected = { "x": [-1.0, 0.0, 2.0], "y": [-3.0, 0.0, 3.0], "z": [-1.0, 0.0, 1.0], } igeom, bounds = partisn._get_coord_sys(mesh) assert igeom == igeom_expected assert bounds == bounds_expected
def test_get_coord_sys_3D(): """Test the _get_coord_sys function for a 3D mesh. """ if not HAVE_PYMOAB: raise SkipTest # Create mesh xvals = [-1.0, 0.0, 2.0] yvals = [-3.0, 0.0, 3.0] zvals = [-1.0, 0.0, 1.0] mesh = Mesh(structured_coords=[xvals, yvals, zvals], structured=True, structured_ordering='xyz') # Expected values igeom_expected = 'x-y-z' bounds_expected = { 'x': [-1.0, 0.0, 2.0], 'y': [-3.0, 0.0, 3.0], 'z': [-1.0, 0.0, 1.0] } igeom, bounds = partisn._get_coord_sys(mesh) assert (igeom == igeom_expected) assert (bounds == bounds_expected)
def test_get_coord_sys_2D(): """Test the _get_coord_sys function for a 2D mesh. """ # Create mesh xvals = [-1.0, 0.0, 2.0] yvals = [-3.0, 3.0] zvals = [-1.0, 0.0, 1.0] pn = 2 mesh=Mesh(structured_coords=[xvals, yvals, zvals], structured=True, structured_ordering='xyz') # Expected values igeom_expected = 'x-y' bounds_expected = {'x': [-1.0, 0.0, 2.0], 'z':[-1.0, 0.0, 1.0]} igeom, bounds, nmq = partisn._get_coord_sys(mesh, pn) assert(igeom == igeom_expected) assert(bounds == bounds_expected) assert(nmq == 6)