Skip to content

Commit

Permalink
simplify partitioning in test
Browse files Browse the repository at this point in the history
  • Loading branch information
majosm committed Aug 9, 2022
1 parent 6af8108 commit dce83fb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/test_grudge.py
Original file line number Diff line number Diff line change
Expand Up @@ -1086,10 +1086,9 @@ def test_multi_volume(actx_factory):
meg, = mesh.groups
x = mesh.vertices[0, meg.vertex_indices]
x_elem_avg = np.sum(x, axis=1)/x.shape[1]
volume_per_element = (x_elem_avg > 0).astype(np.int32)

from meshmode.distributed import membership_list_to_map
volume_to_elements = membership_list_to_map(volume_per_element)
volume_to_elements = {
0: np.where(x_elem_avg <= 0)[0],
1: np.where(x_elem_avg > 0)[0]}

from meshmode.mesh.processing import partition_mesh
volume_to_mesh = partition_mesh(mesh, volume_to_elements)
Expand Down

0 comments on commit dce83fb

Please sign in to comment.