An open source method of characteristics neutron transport code.
Halfspace Class Reference

A positive or negative halfspace Region. More...

#include "src/Region.h"

Public Member Functions

 Halfspace (int halfspace, Surface *surface)
 Constructor sets the type of Region (HALFSPACE). More...
 
Halfspaceclone ()
 Create a duplicate of the Halfspace. More...
 
SurfacegetSurface ()
 Return a pointer to the Halfspace's Surface. More...
 
int getHalfspace ()
 Return the side of the Surface for this Halfspace. More...
 
void reverseHalfspace ()
 Changes the side of the surface for this Halfspace.
 
std::map< int, Halfspace * > getAllSurfaces ()
 Extracts a map of this Halfspace indexed by its Surface ID. More...
 
double getMinX ()
 Return the minimum reachable x-coordinate in the Halfspace. More...
 
double getMaxX ()
 Return the maximum reachable x-coordinate in the Halfspace. More...
 
double getMinY ()
 Return the minimum reachable y-coordinate in the Halfspace. More...
 
double getMaxY ()
 Return the maximum reachable y-coordinate in the Halfspace. More...
 
double getMinZ ()
 Return the minimum reachable z-coordinate in the Halfspace. More...
 
double getMaxZ ()
 Return the maximum reachable z-coordinate in the Halfspace. More...
 
boundaryType getMinXBoundaryType ()
 Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) of the Halfspace's Surface. More...
 
boundaryType getMaxXBoundaryType ()
 Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) of the Halfspace's Surface. More...
 
boundaryType getMinYBoundaryType ()
 Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) of the Halfspace's Surface. More...
 
boundaryType getMaxYBoundaryType ()
 Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) of the Halfspace's Surface. More...
 
boundaryType getMinZBoundaryType ()
 Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) of the Halfspace's Surface. More...
 
boundaryType getMaxZBoundaryType ()
 Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) of the Halfspace's Surface. More...
 
bool containsPoint (Point *point)
 Determines whether a Point is contained inside the Halfspace. More...
 
double minSurfaceDist (LocalCoords *coords)
 Computes the minimum distance to the Surface in the Halfspace from a point with a given trajectory at a certain angle stored in a LocalCoords object. More...
 
double minSurfaceDist (Point *point, double azim, double polar=M_PI_2)
 Computes the minimum distance to the Surface in the Halfspace from a point with a given trajectory at a certain angle. More...
 
- Public Member Functions inherited from Region
 Region ()
 Constructor sets a few pointers to NULL.
 
virtual ~Region ()
 Destructor clears vector of the nodes within the Region.
 
virtual void addNode (Region *node, bool clone=true)
 Add a node to the Region. More...
 
void removeHalfspace (Surface *surface, int halfspace)
 Removes a Node from this Region. More...
 
regionType getRegionType ()
 Return the type of Region (ie, UNION, INTERSECTION, etc). More...
 
void setParentRegion (Region *node)
 Set the parent of the current node/Region. More...
 
RegiongetParentRegion ()
 Get the parent of the current node/Region. More...
 
virtual std::vector< Region * > getNodes ()
 Return a vector of all of the Region's immediate nodes. More...
 
virtual std::vector< Region * > getAllNodes ()
 Return a vector of all of the Region's nodes. More...
 

Public Attributes

Surface_surface
 
int _halfspace
 

Additional Inherited Members

- Protected Attributes inherited from Region
regionType _region_type
 
std::vector< Region * > _nodes
 
Region_parent_region
 

Detailed Description

A positive or negative halfspace Region.

Constructor & Destructor Documentation

◆ Halfspace()

Halfspace::Halfspace ( int  halfspace,
Surface surface 
)

Constructor sets the type of Region (HALFSPACE).

Parameters
halfspacethe side of the Surface (+1 or -1)
surfacea pointer to the Surface of interest

Member Function Documentation

◆ clone()

Halfspace * Halfspace::clone ( )
virtual

Create a duplicate of the Halfspace.

Returns
a pointer to the clone

Reimplemented from Region.

◆ containsPoint()

bool Halfspace::containsPoint ( Point point)
virtual

Determines whether a Point is contained inside the Halfspace.

Queries whether the Point is on the same side of the Surface as the Halfspace.

Returns
true if the Point is inside the Halfspace; otherwise false

Implements Region.

◆ getAllSurfaces()

std::map< int, Halfspace * > Halfspace::getAllSurfaces ( )
virtual

Extracts a map of this Halfspace indexed by its Surface ID.

This is a base case and a helper method for the parent class' Region::getAllSurfaces() method. This method will return a dictionary of the Halfspace indexed by Surface ID if called in Python.

Returns
a map of this Halfspace indexed by its Surface ID

Reimplemented from Region.

◆ getHalfspace()

int Halfspace::getHalfspace ( )

Return the side of the Surface for this Halfspace.

Returns
the side of the surface for this Halfspace (+1 or -1)

◆ getMaxX()

double Halfspace::getMaxX ( )
virtual

Return the maximum reachable x-coordinate in the Halfspace.

Returns
the maximum x-coordinate

Reimplemented from Region.

◆ getMaxXBoundaryType()

boundaryType Halfspace::getMaxXBoundaryType ( )
virtual

Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) of the Halfspace's Surface.

Returns
the boundary condition

Reimplemented from Region.

◆ getMaxY()

double Halfspace::getMaxY ( )
virtual

Return the maximum reachable y-coordinate in the Halfspace.

Returns
the maximum y-coordinate

Reimplemented from Region.

◆ getMaxYBoundaryType()

boundaryType Halfspace::getMaxYBoundaryType ( )
virtual

Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) of the Halfspace's Surface.

Returns
the boundary condition

Reimplemented from Region.

◆ getMaxZ()

double Halfspace::getMaxZ ( )
virtual

Return the maximum reachable z-coordinate in the Halfspace.

Returns
the maximum z-coordinate

Reimplemented from Region.

◆ getMaxZBoundaryType()

boundaryType Halfspace::getMaxZBoundaryType ( )
virtual

Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) of the Halfspace's Surface.

Returns
the boundary condition

Reimplemented from Region.

◆ getMinX()

double Halfspace::getMinX ( )
virtual

Return the minimum reachable x-coordinate in the Halfspace.

Returns
the minimum x-coordinate

Reimplemented from Region.

◆ getMinXBoundaryType()

boundaryType Halfspace::getMinXBoundaryType ( )
virtual

Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) of the Halfspace's Surface.

Returns
the boundary condition

Reimplemented from Region.

◆ getMinY()

double Halfspace::getMinY ( )
virtual

Return the minimum reachable y-coordinate in the Halfspace.

Returns
the minimum y-coordinate

Reimplemented from Region.

◆ getMinYBoundaryType()

boundaryType Halfspace::getMinYBoundaryType ( )
virtual

Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) of the Halfspace's Surface.

Returns
the boundary condition

Reimplemented from Region.

◆ getMinZ()

double Halfspace::getMinZ ( )
virtual

Return the minimum reachable z-coordinate in the Halfspace.

Returns
the minimum z-coordinate

Reimplemented from Region.

◆ getMinZBoundaryType()

boundaryType Halfspace::getMinZBoundaryType ( )
virtual

Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) of the Halfspace's Surface.

Returns
the boundary condition

Reimplemented from Region.

◆ getSurface()

Surface * Halfspace::getSurface ( )

Return a pointer to the Halfspace's Surface.

Returns
a pointer to the Halfspace's Surface

◆ minSurfaceDist() [1/2]

double Halfspace::minSurfaceDist ( LocalCoords coords)
virtual

Computes the minimum distance to the Surface in the Halfspace from a point with a given trajectory at a certain angle stored in a LocalCoords object.

If the trajectory will not intersect the Surface in the Halfspace returns INFINITY.

Parameters
coordsa pointer to a localcoords

Reimplemented from Region.

◆ minSurfaceDist() [2/2]

double Halfspace::minSurfaceDist ( Point point,
double  azim,
double  polar = M_PI_2 
)
virtual

Computes the minimum distance to the Surface in the Halfspace from a point with a given trajectory at a certain angle.

If the trajectory will not intersect the Surface in the Halfspace returns INFINITY.

Parameters
coordsa pointer to a localcoords

Reimplemented from Region.

Member Data Documentation

◆ _halfspace

int Halfspace::_halfspace

The halfspace associated with this surface

◆ _surface

Surface* Halfspace::_surface

A pointer to the Surface object


The documentation for this class was generated from the following files: