From 2649bf9f03061061516f440b3c7ac98c05147bc5 Mon Sep 17 00:00:00 2001 From: Frederik Hennig <frederik.hennig@fau.de> Date: Wed, 7 Oct 2020 11:53:59 +0200 Subject: [PATCH] Fix: Boundary Index List Tests now also check `single_link=True` --- .../test_boundary_indexlist_creation.py | 76 ------------------- 1 file changed, 76 deletions(-) delete mode 100644 lbmpy_tests/test_boundary_indexlist_creation.py diff --git a/lbmpy_tests/test_boundary_indexlist_creation.py b/lbmpy_tests/test_boundary_indexlist_creation.py deleted file mode 100644 index 29493ca6..00000000 --- a/lbmpy_tests/test_boundary_indexlist_creation.py +++ /dev/null @@ -1,76 +0,0 @@ -import numpy as np - -import pystencils.boundaries.createindexlist as cil -from lbmpy.stencils import get_stencil - - -def test_equivalence_cython_python_version(): - if not cil.cython_funcs_available: - return - - stencil_2d = get_stencil("D2Q9") - stencil_3d = get_stencil("D3Q19") - - for dtype in [int, np.int16, np.uint32]: - fluid_mask = dtype(1) - mask = dtype(2) - flag_field_2d = np.ones([15, 16], dtype=dtype) * fluid_mask - flag_field_3d = np.ones([15, 16, 17], dtype=dtype) * fluid_mask - - flag_field_2d[0, :] = mask - flag_field_2d[-1, :] = mask - flag_field_2d[7, 7] = mask - - flag_field_3d[0, :, :] = mask - flag_field_3d[-1, :, :] = mask - flag_field_3d[7, 7, 7] = mask - - result_python_2d = cil._create_boundary_neighbor_index_list_python(flag_field_2d, 1, mask, fluid_mask, - stencil_2d, False) - - result_python_3d = cil._create_boundary_neighbor_index_list_python(flag_field_3d, 1, mask, fluid_mask, - stencil_3d, False) - - result_cython_2d = cil.create_boundary_index_list(flag_field_2d, stencil_2d, mask, - fluid_mask, 1, True, False) - result_cython_3d = cil.create_boundary_index_list(flag_field_3d, stencil_3d, mask, - fluid_mask, 1, True, False) - - np.testing.assert_equal(result_python_2d, result_cython_2d) - np.testing.assert_equal(result_python_3d, result_cython_3d) - - -def test_equivalence_cell_idx_list_cython_python_version(): - if not cil.cython_funcs_available: - return - - stencil_2d = get_stencil("D2Q9") - stencil_3d = get_stencil("D3Q19") - - for dtype in [int, np.int16, np.uint32]: - fluid_mask = dtype(1) - mask = dtype(2) - flag_field_2d = np.ones([15, 16], dtype=dtype) * fluid_mask - flag_field_3d = np.ones([15, 16, 17], dtype=dtype) * fluid_mask - - flag_field_2d[0, :] = mask - flag_field_2d[-1, :] = mask - flag_field_2d[7, 7] = mask - - flag_field_3d[0, :, :] = mask - flag_field_3d[-1, :, :] = mask - flag_field_3d[7, 7, 7] = mask - - result_python_2d = cil._create_boundary_cell_index_list_python(flag_field_2d, mask, fluid_mask, - stencil_2d, False) - - result_python_3d = cil._create_boundary_cell_index_list_python(flag_field_3d, mask, fluid_mask, - stencil_3d, False) - - result_cython_2d = cil.create_boundary_index_list(flag_field_2d, stencil_2d, mask, fluid_mask, None, - False, False) - result_cython_3d = cil.create_boundary_index_list(flag_field_3d, stencil_3d, mask, fluid_mask, None, - False, False) - - np.testing.assert_equal(result_python_2d, result_cython_2d) - np.testing.assert_equal(result_python_3d, result_cython_3d) -- GitLab