From 8ddb045c7d6501db3a85acadd1d9c46f972d6aa2 Mon Sep 17 00:00:00 2001 From: Ethan Peterson Date: Thu, 20 Oct 2022 15:28:26 -0400 Subject: [PATCH] added warning about non-transmissive boundary_type --- openmc/model/surface_composite.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/openmc/model/surface_composite.py b/openmc/model/surface_composite.py index 8c47ac1309..922e60f0aa 100644 --- a/openmc/model/surface_composite.py +++ b/openmc/model/surface_composite.py @@ -4,6 +4,7 @@ from math import sqrt, pi, sin, cos, isclose import numpy as np from scipy.spatial import ConvexHull, Delaunay from matplotlib.path import Path +import warnings import openmc from openmc.checkvalue import (check_greater_than, check_value, @@ -702,6 +703,18 @@ class Polygon(CompositeSurface): def _surface_names(self): return self._surfnames + @CompositeSurface.boundary_type.setter + def boundary_type(self, boundary_type): + if boundary_type != 'transmission': + warnings.warn("Setting boundary_type to a value other than " + "'transmission' on Polygon composite surfaces can " + "result in unintended behavior. Please use the " + "regions property of the Polygon to generate " + "individual openmc.Cell objects to avoid unwanted " + "behavior.") + for name in self._surface_names: + getattr(self, name).boundary_type = boundary_type + @property def points(self): return self._points