From 8e76870b55a147e5fa037618bf56c03a99bf4908 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Wed, 15 Apr 2020 10:26:30 -0500 Subject: [PATCH] allow projecting empty chained connections --- meshmode/discretization/connection/projection.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meshmode/discretization/connection/projection.py b/meshmode/discretization/connection/projection.py index 5d274a96..fae3f9b7 100644 --- a/meshmode/discretization/connection/projection.py +++ b/meshmode/discretization/connection/projection.py @@ -54,6 +54,9 @@ class L2ProjectionInverseDiscretizationConnection(DiscretizationConnection): if isinstance(connections, DirectDiscretizationConnection): return DiscretizationConnection.__new__(cls) elif isinstance(connections, ChainedDiscretizationConnection): + if len(connections.connections) == 0: + return connections + return cls(connections.connections, is_surjective=is_surjective) else: conns = [] -- GitLab