Adding some point checks for the hex prism test and removing import from surfae.py.

This commit is contained in:
Patrick Shriwise 2019-03-08 14:45:33 -06:00
parent 758d9b45d5
commit e1aa836ea6
2 changed files with 18 additions and 8 deletions

View file

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

View file

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