diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b68dc3fe4346d5a1c035700d5a9d17c94bf161b3..3f331f0cc2aa5b5d8def8df4b97f8e09526b25b7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,15 +15,15 @@ Python 2.7 POCL: reports: junit: test/pytest.xml -Python 3.6 Nvidia K40: +Python 3 Nvidia K40: script: - - export PY_EXE=python3.6 + - export PY_EXE=python3 - export PYOPENCL_TEST=nvi:k40 - export EXTRA_INSTALL="pybind11 numpy mako" - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project.sh - ". ./build-and-test-py-project.sh" tags: - - python3.6 + - python3 - nvidia-k40 except: - tags @@ -31,15 +31,15 @@ Python 3.6 Nvidia K40: reports: junit: test/pytest.xml -Python 3.6 POCL: +Python 3 POCL: script: - - export PY_EXE=python3.6 + - export PY_EXE=python3 - export PYOPENCL_TEST=portable - export EXTRA_INSTALL="pybind11 numpy mako mpi4py" - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project.sh - ". ./build-and-test-py-project.sh" tags: - - python3.6 + - python3 - pocl - mpi except: @@ -48,15 +48,15 @@ Python 3.6 POCL: reports: junit: test/pytest.xml -Python 3.7 POCL: +Python 3 POCL: script: - - export PY_EXE=python3.7 + - export PY_EXE=python3 - export PYOPENCL_TEST=portable - export EXTRA_INSTALL="pybind11 numpy mako mpi4py" - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project.sh - ". ./build-and-test-py-project.sh" tags: - - python3.7 + - python3 - pocl - mpi except: @@ -71,7 +71,7 @@ Documentation: - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-docs.sh - ". ./build-docs.sh" tags: - - python3.5 + - python3 only: - master @@ -80,6 +80,6 @@ Flake8: - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/prepare-and-run-flake8.sh - ". ./prepare-and-run-flake8.sh meshmode test" tags: - - python3.5 + - python3 except: - tags diff --git a/meshmode/mesh/io.py b/meshmode/mesh/io.py index e4adf7ce50983c863d82da66edfbc405c9c68f23..49e816f84940d4f765703a8adc53ff327e3e69a8 100644 --- a/meshmode/mesh/io.py +++ b/meshmode/mesh/io.py @@ -375,6 +375,9 @@ def from_vertices_and_simplices(vertices, simplices, order=1, fix_orientation=Fa grp = make_group_from_vertices(vertices, simplices, order) if fix_orientation: + if grp.dim != vertices.shape[0]: + raise ValueError("can only fix orientation of volume meshes") + from meshmode.mesh.processing import ( find_volume_mesh_element_group_orientation, flip_simplex_element_group) diff --git a/meshmode/mesh/processing.py b/meshmode/mesh/processing.py index 2094c99bd9dbe0f0db29b2fe7253c8796eedc149..9cb71a1a501f2e79d94e9c09a7ef6847b5b621f7 100644 --- a/meshmode/mesh/processing.py +++ b/meshmode/mesh/processing.py @@ -289,6 +289,9 @@ def find_volume_mesh_element_group_orientation(vertices, grp): ambient_dim = spanning_vectors.shape[0] nspan_vectors = spanning_vectors.shape[-1] + if ambient_dim != grp.dim: + raise ValueError("can only find orientation of volume meshes") + spanning_object_array = np.empty( (nspan_vectors, ambient_dim), dtype=np.object)