From 34793090475d1b67e61f5dca5d94b4a60287b3f8 Mon Sep 17 00:00:00 2001 From: Joost van Zwieten Date: Wed, 25 Mar 2020 22:08:14 +0100 Subject: [PATCH] inherit groups in HierarchicalTopology.interfaces --- nutils/topology.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/nutils/topology.py b/nutils/topology.py index 2d2188412..59f8e1047 100644 --- a/nutils/topology.py +++ b/nutils/topology.py @@ -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): @@ -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):