openmc.Halfspace

class openmc.Halfspace(surface, side)[source]

A positive or negative half-space region.

A half-space is either of the two parts into which a two-dimension surface divides the three-dimensional Euclidean space. If the equation of the surface is \(f(x,y,z) = 0\), the region for which \(f(x,y,z) < 0\) is referred to as the negative half-space and the region for which \(f(x,y,z) > 0\) is referred to as the positive half-space.

Instances of Halfspace are generally not instantiated directly. Rather, they can be created from an existing Surface through the __neg__ and __pos__ operators, as the following example demonstrates:

>>> sphere = openmc.Sphere(surface_id=1, R=10.0)
>>> inside_sphere = -sphere
>>> outside_sphere = +sphere
>>> type(inside_sphere)
<class 'openmc.surface.Halfspace'>
Parameters:
  • surface (openmc.Surface) – Surface which divides Euclidean space.
  • side ({'+', '-'}) – Indicates whether the positive or negative half-space is used.
Variables:
  • surface (openmc.Surface) – Surface which divides Euclidean space.
  • side ({'+', '-'}) – Indicates whether the positive or negative half-space is used.
  • bounding_box (tuple of numpy.ndarray) – Lower-left and upper-right coordinates of an axis-aligned bounding box