Skip to content

Commit

Permalink
inherit groups in HierarchicalTopology.interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
joostvanzwieten committed Apr 14, 2020
1 parent 96d0fbb commit 3479309
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions nutils/topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -2117,11 +2117,9 @@ def boundary(self):
def interfaces(self):
'interfaces'

hreferences = []
htransforms = []
hopposites = []
levelsifaces = []
for level, indices in zip(self.levels, self._indices_per_level):
selection = []
selection = set()
to = level.interfaces.transforms, level.interfaces.opposites
for trans, ref in zip(map(level.transforms.__getitem__, indices), map(level.references.__getitem__, indices)):
for trans_etrans in transform.unempty_edge_transforms(trans, ref):
Expand All @@ -2131,14 +2129,11 @@ def interfaces(self):
except ValueError:
continue
if self.transforms.contains_with_tail(opposites[i]):
selection.append(i)
selection.add(i)
break
if selection:
selection = types.frozenarray(numpy.unique(selection))
hreferences.append(level.interfaces.references[selection])
htransforms.append(level.interfaces.transforms[selection])
hopposites.append(level.interfaces.opposites[selection])
return Topology(self.roots, elementseq.chain(hreferences, self.ndims-1), transformseq.chain(htransforms, tuple(root.ndims for root in self.roots)), transformseq.chain(hopposites, tuple(root.ndims for root in self.roots)))
levelsifaces.append(SubsetTopology(level.interfaces, tuple(ref if i in selection else ref.empty for i, ref in enumerate(level.interfaces.references))))
return DisjointUnionTopology(levelsifaces)

@log.withcontext
def basis(self, name, *args, truncation_tolerance=1e-15, **kwargs):
Expand Down

0 comments on commit 3479309

Please sign in to comment.