added warning about non-transmissive boundary_type

This commit is contained in:
Ethan Peterson 2022-10-20 15:28:26 -04:00
parent a587f5e1c9
commit 8ddb045c7d

View file

@ -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