From be46e6b603458ace69a6fd96bf5d3aaeb1cb3748 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 13 Apr 2020 14:43:00 -0500 Subject: [PATCH] Add example of using union operator on half-spaces --- docs/source/usersguide/geometry.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/source/usersguide/geometry.rst b/docs/source/usersguide/geometry.rst index f83af0b2f..c929503df 100644 --- a/docs/source/usersguide/geometry.rst +++ b/docs/source/usersguide/geometry.rst @@ -113,6 +113,19 @@ Boolean operators ``&`` (intersection), ``|`` (union), and ``~`` (complement):: >>> type(northern_hemisphere) +The ``&`` operator can be thought of as a logical AND, the ``|`` operator as a +logical OR, and the ``~`` operator as a logical NOT. Thus, if you wanted to +create a region that consists of the space for which :math:`-4 < z < -3` or +:math:`3 < z < 4`, a union could be used:: + + >>> region_bottom = +openmc.ZPlane(-4) & -openmc.ZPlane(-3) + >>> region_top = +openmc.ZPlane(3) & -openmc.ZPlane(4) + >>> combined_region = region_bottom | region_top + +Half-spaces and the objects resulting from taking the intersection, union, +and/or complement or half-spaces are all considered *regions* that can be +assigned to :ref:`cells `. + For many regions, a bounding-box can be determined automatically:: >>> northern_hemisphere.bounding_box