From e1aa836ea6e301da54bb68a73382d61845796bf9 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Fri, 8 Mar 2019 14:45:33 -0600 Subject: [PATCH] Adding some point checks for the hex prism test and removing import from surfae.py. --- openmc/surface.py | 1 - tests/unit_tests/test_geometry.py | 25 ++++++++++++++++++------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/openmc/surface.py b/openmc/surface.py index c861880c56..1776fc10cf 100644 --- a/openmc/surface.py +++ b/openmc/surface.py @@ -1,7 +1,6 @@ from abc import ABCMeta from collections import OrderedDict from copy import deepcopy -from functools import partial from numbers import Real, Integral from xml.etree import ElementTree as ET diff --git a/tests/unit_tests/test_geometry.py b/tests/unit_tests/test_geometry.py index 2c9306cb90..2068c9883f 100644 --- a/tests/unit_tests/test_geometry.py +++ b/tests/unit_tests/test_geometry.py @@ -206,14 +206,25 @@ def test_get_by_name(): def test_hex_prism(): hex_prism = openmc.model.get_hexagonal_prism(edge_length=5.0, origin=(0.0, 0.0), - boundary_type='reflective', - orientation='y', - corner_radius=0.10) - - hex_prism = openmc.model.get_hexagonal_prism(edge_length=5.0, - origin=(0.0, 0.0), - boundary_type='reflective', orientation='y') + # clear checks + assert (0.0, 0.0, 0.0) in hex_prism + assert (10.0, 10.0, 10.0) not in hex_prism + # edge checks + assert (0.0, 5.01, 0.0) not in hex_prism + assert (0.0, 4.99, 0.0) in hex_prism + + rounded_hex_prism = openmc.model.get_hexagonal_prism(edge_length=5.0, + origin=(0.0, 0.0), + orientation='y', + corner_radius=1.0) + + # clear checks + assert (0.0, 0.0, 0.0) in rounded_hex_prism + assert (10.0, 10.0, 10.0) not in rounded_hex_prism + # edge checks + assert (0.0, 5.01, 0.0) not in rounded_hex_prism + assert (0.0, 4.99, 0.0) not in rounded_hex_prism def test_get_lattice_by_name(cell_with_lattice):