From cfb17517eb3d3fefa2edced5529c15f7455e3800 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 5 Oct 2015 07:45:55 +0700 Subject: [PATCH] Overload __invert__ for Halfspace (return opposite Halfspace) --- openmc/surface.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openmc/surface.py b/openmc/surface.py index 66376c2a0c..afa426fa3b 100644 --- a/openmc/surface.py +++ b/openmc/surface.py @@ -988,6 +988,9 @@ class Halfspace(Region): self.surface = surface self.side = side + def __invert__(self): + return -self.surface if self.side == '+' else +self.surface + @property def surface(self): return self._surface