Skip to content
Snippets Groups Projects
Commit 0c1dc43b authored by Ellis Hoag's avatar Ellis Hoag
Browse files

added partition_mesh test

parent 934ec897
No related branches found
No related tags found
1 merge request!9Master
...@@ -47,6 +47,29 @@ import pytest ...@@ -47,6 +47,29 @@ import pytest
import logging import logging
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
# {{{ partition_mesh
@pytest.mark.parametrize("mesh_type", ["cloverleaf", "starfish"])
@pytest.mark.parametrize("npoints", [10, 1000])
def test_partition_mesh(mesh_type, npoints):
from meshmode.mesh.generation import make_curve_mesh, cloverleaf, starfish
if mesh_type == "cloverleaf":
mesh = make_curve_mesh(cloverleaf, np.linspace(0, 1, npoints), order=3)
elif mesh_type == "starfish":
mesh = make_curve_mesh(starfish, np.linspace(0, 1, npoints), order=3)
#TODO: Create an actuall adjacency list from the mesh.
adjacency_list = mesh.nodal_adjacency
from pymetis import part_graph
part_per_element = np.array(part_graph(3, adjacency=adjacency_list))
from meshmode.mesh.processing import partition_mesh
(part_mesh, part_to_global) = partition_mesh(mesh, part_per_element, 0)
# }}}
# {{{ circle mesh # {{{ circle mesh
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment