From 725d78ec1bd21cbed774367e1c2e046e2243807a Mon Sep 17 00:00:00 2001
From: ellis <eshoag2@illinois.edu>
Date: Sat, 4 Mar 2017 17:20:20 -0600
Subject: [PATCH] Add test for partition tags

---
 meshmode/mesh/__init__.py |  2 +-
 test/test_meshmode.py     | 14 +++++++++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/meshmode/mesh/__init__.py b/meshmode/mesh/__init__.py
index c2e108ae..dcefeb28 100644
--- a/meshmode/mesh/__init__.py
+++ b/meshmode/mesh/__init__.py
@@ -425,7 +425,7 @@ class OtherPossibility():
                             (neighbor_group, neighbor_elem, neighbor_face)
 
     def get_neighbor(self, tag, elem, face):
-        return self.adjacent((tag, elem, face))
+        return self.adjacent[(tag, elem, face)]
     
 # }}}
 
diff --git a/test/test_meshmode.py b/test/test_meshmode.py
index f4926134..57775dd0 100644
--- a/test/test_meshmode.py
+++ b/test/test_meshmode.py
@@ -101,6 +101,18 @@ def test_partition_boxes_mesh():
     assert count_btag_all(mesh) == np.sum(
         [count_btag_all(new_meshes[i]) for i in range(num_parts)]), \
         "part_mesh has the wrong number of BTAG_ALL boundaries"
+        
+    for part_num in range(num_parts):
+        for f_groups in new_meshes[part_num].facial_adjacency_groups:
+            f_grp = f_groups[None]
+            for idx in range(len(f_grp.elements)):
+                tag = -f_grp.neighbors[idx]
+                if tag >= 0:
+                    elem = f_grp.elements[idx]
+                    face = f_grp.element_faces[idx]
+                    (n_part, n_elem, n_face) = ...get_neighbor(tag, elem, face)
+                    assert (part_num, elem, face) = ...get_neighbor(n_part, n_elem, n_face)
+        
 
 
 def count_btag_all(mesh):
@@ -111,7 +123,7 @@ def count_btag_all(mesh):
                 if neighbors < 0:
                     if -neighbors & mesh.boundary_tag_bit(BTAG_ALL) != 0:
                         num_bnds += 1
-    return num_bnds
+    return num_bnds 
 
 # }}}
 
-- 
GitLab