From 717466ba62d1da0757a9462f91449b0c25fe5eba Mon Sep 17 00:00:00 2001 From: ellis <eshoag2@illinois.edu> Date: Thu, 9 Mar 2017 00:22:21 -0600 Subject: [PATCH] Whitespace fixes --- meshmode/mesh/__init__.py | 15 ++++++++------- meshmode/mesh/processing.py | 3 ++- test/test_meshmode.py | 3 ++- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/meshmode/mesh/__init__.py b/meshmode/mesh/__init__.py index 0a01529d..aeeec359 100644 --- a/meshmode/mesh/__init__.py +++ b/meshmode/mesh/__init__.py @@ -54,6 +54,7 @@ Predefined Boundary tags .. autoclass:: BTAG_ALL .. autoclass:: BTAG_REALLY_ALL .. autoclass:: BTAG_NO_BOUNDARY +.. autoclass:: BTAG_PARTITION """ @@ -88,12 +89,12 @@ class BTAG_NO_BOUNDARY(object): # noqa pass -class BTAG_PARTITION(object): +class BTAG_PARTITION(object): # noqa """ A boundary tag indicating that this edge is adjacent to an element of another :class:`Mesh`. The partition number of the adjacent mesh is given by ``part_nr``. - + .. attribute:: part_nr .. versionadded:: 2017.1 @@ -416,27 +417,27 @@ class NodalAdjacency(Record): class InterPartitionAdj(): """ Describes facial adjacency information of elements in one :class:`Mesh` to - elements in another :class:`Mesh`. The element's boundary tag gives the + elements in another :class:`Mesh`. The element's boundary tag gives the partition that it is connected to. .. attribute:: elements `:class:Mesh`-local element numbers that have neighbors. - + .. attribute:: element_faces ``element_faces[i]`` is the face of ``elements[i]`` that has a neighbor. .. attribute:: neighbors - ``neighbors[i]`` gives the element number within the neighboring partiton + ``neighbors[i]`` gives the element number within the neighboring partiton of the element connected to ``elements[i]``. .. attribute:: neighbor_faces ``neighbor_faces[i]`` gives face index within the neighboring partition of the face connected to ``elements[i]`` - + .. automethod:: add_connection .. automethod:: get_neighbor @@ -451,7 +452,7 @@ class InterPartitionAdj(): def add_connection(self, elem, face, neighbor_elem, neighbor_face): """ - Adds a connection from ``elem`` and ``face`` within :class:`Mesh` to + Adds a connection from ``elem`` and ``face`` within :class:`Mesh` to ``neighbor_elem`` and ``neighbor_face`` of another neighboring partion of type :class:`Mesh`. :arg elem diff --git a/meshmode/mesh/processing.py b/meshmode/mesh/processing.py index dba72d9d..bb097e17 100644 --- a/meshmode/mesh/processing.py +++ b/meshmode/mesh/processing.py @@ -177,7 +177,8 @@ def partition_mesh(mesh, part_per_element, part_nr): n_part_nr = part_per_element[rank_neighbor] tags = tags & ~part_mesh.boundary_tag_bit(BTAG_ALL) - tags = tags | part_mesh.boundary_tag_bit(BTAG_PARTITION(n_part_nr)) + tags = tags | part_mesh.boundary_tag_bit( + BTAG_PARTITION(n_part_nr)) boundary_adj.neighbors[elem_idx] = -tags # Find the neighbor element from the other partition diff --git a/test/test_meshmode.py b/test/test_meshmode.py index c0a697b9..c6859cc9 100644 --- a/test/test_meshmode.py +++ b/test/test_meshmode.py @@ -130,7 +130,7 @@ def test_partition_boxes_mesh(): while p_elem >= mesh.groups[p_grp_nr].nelements: p_elem -= mesh.groups[p_grp_nr].nelements p_grp_nr += 1 - p_elem_base = mesh.groups[p_grp_nr].element_nr_base + #p_elem_base = mesh.groups[p_grp_nr].element_nr_base f_groups = mesh.facial_adjacency_groups[p_grp_nr] for _, p_bnd_adj in f_groups.items(): for idx in range(len(p_bnd_adj.elements)): @@ -148,6 +148,7 @@ def test_partition_boxes_mesh(): assert num_tags[tag_nr] == tag_sum,\ "part_mesh has the wrong number of BTAG_PARTITION boundaries" + def count_tags(mesh, tag): num_bnds = 0 for adj_dict in mesh.facial_adjacency_groups: -- GitLab