An open source method of characteristics neutron transport code.
Region Class Referenceabstract

A region of space that can be assigned to a Cell. More...

#include "src/Region.h"

Public Member Functions

 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...
 
virtual std::map< int, Halfspace * > getAllSurfaces ()
 Extracts a map of all Halfspaces contained in the Region. More...
 
virtual double getMinX ()
 Return the minimum reachable x-coordinate in the Region. More...
 
virtual double getMaxX ()
 Return the maximum reachable x-coordinate in the Region. More...
 
virtual double getMinY ()
 Return the minimum reachable y-coordinate in the Region. More...
 
virtual double getMaxY ()
 Return the maximum reachable y-coordinate in the Region. More...
 
virtual double getMinZ ()
 Return the minimum reachable z-coordinate in the Region. More...
 
virtual double getMaxZ ()
 Return the maximum reachable z-coordinate in the Region. More...
 
virtual boundaryType getMinXBoundaryType ()
 Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) at the minimum reachable x-coordinate in the Region. More...
 
virtual boundaryType getMaxXBoundaryType ()
 Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) at the maximum reachable x-coordinate in the Region. More...
 
virtual boundaryType getMinYBoundaryType ()
 Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) at the minimum reachable y-coordinate in the Region. More...
 
virtual boundaryType getMaxYBoundaryType ()
 Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) at the maximum reachable y-coordinate in the Region. More...
 
virtual boundaryType getMinZBoundaryType ()
 Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) at the minimum reachable z-coordinate in the Region. More...
 
virtual boundaryType getMaxZBoundaryType ()
 Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) at the maximum reachable z-coordinate in the Region. More...
 
virtual bool containsPoint (Point *point)=0
 
virtual double minSurfaceDist (LocalCoords *coords)
 Computes the minimum distance to a Surface in the Region from a point with a given trajectory at a certain angle stored in a LocalCoords object. More...
 
virtual double minSurfaceDist (Point *point, double azim, double polar=M_PI_2)
 Computes the minimum distance to a Surface in the Region from a point with a given trajectory at a certain angle stored in a LocalCoords object. More...
 
virtual Regionclone ()
 Create a duplicate of the Region. More...
 

Protected Attributes

regionType _region_type
 
std::vector< Region * > _nodes
 
Region_parent_region
 

Detailed Description

A region of space that can be assigned to a Cell.

Member Function Documentation

◆ addNode()

void Region::addNode ( Region node,
bool  clone = true 
)
virtual

Add a node to the Region.

NOTE: This method deep copies the Region and stores the copy. Any changes made to the Region will not be reflected in the Region copy stored by the Region. The clone boolean can be used to avoid this behavior.

Parameters
nodea Region node to add to this Region
clonewhether to clone or not the node when adding it

Reimplemented in Complement.

◆ clone()

Region * Region::clone ( )
virtual

Create a duplicate of the Region.

Returns
a pointer to the clone

Reimplemented in Halfspace.

◆ getAllNodes()

std::vector< Region * > Region::getAllNodes ( )
virtual

Return a vector of all of the Region's nodes.

This method will return a list of the Region's nodes, including nodes at lower levels.

Returns
a vector of the Region's nodes

◆ getAllSurfaces()

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

Extracts a map of all Halfspaces contained in the Region.

This method recurses through all of the Region's nodes and collects the Halfspaces into a map indexed by Surface ID. This method will return a dictionary of the Halfspaces indexed by Surface ID called in Python.

Returns
a map of all Halfspaces in the Region

Reimplemented in Halfspace.

◆ getMaxX()

double Region::getMaxX ( )
virtual

Return the maximum reachable x-coordinate in the Region.

This routine is overloaded for a Halfspace

Returns
the maximum x-coordinate

Reimplemented in Halfspace.

◆ getMaxXBoundaryType()

boundaryType Region::getMaxXBoundaryType ( )
virtual

Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) at the maximum reachable x-coordinate in the Region.

Returns
the boundary condition at the maximum x-coordinate

Reimplemented in Halfspace.

◆ getMaxY()

double Region::getMaxY ( )
virtual

Return the maximum reachable y-coordinate in the Region.

This routine is overloaded for a Halfspace

Returns
the maximum y-coordinate

Reimplemented in Halfspace.

◆ getMaxYBoundaryType()

boundaryType Region::getMaxYBoundaryType ( )
virtual

Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) at the maximum reachable y-coordinate in the Region.

Returns
the boundary condition at the maximum y-coordinate

Reimplemented in Halfspace.

◆ getMaxZ()

double Region::getMaxZ ( )
virtual

Return the maximum reachable z-coordinate in the Region.

This routine is overloaded for a Halfspace

Returns
the maximum z-coordinate

Reimplemented in Halfspace.

◆ getMaxZBoundaryType()

boundaryType Region::getMaxZBoundaryType ( )
virtual

Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) at the maximum reachable z-coordinate in the Region.

Returns
the boundary condition at the maximum z-coordinate

Reimplemented in Halfspace.

◆ getMinX()

double Region::getMinX ( )
virtual

Return the minimum reachable x-coordinate in the Region.

This routine is overloaded for a Halfspace

Returns
the minimum x-coordinate

Reimplemented in Halfspace.

◆ getMinXBoundaryType()

boundaryType Region::getMinXBoundaryType ( )
virtual

Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) at the minimum reachable x-coordinate in the Region.

Returns
the boundary condition at the minimum x-coordinate

Reimplemented in Halfspace.

◆ getMinY()

double Region::getMinY ( )
virtual

Return the minimum reachable y-coordinate in the Region.

This routine is overloaded for a Halfspace

Returns
the minimum y-coordinate

Reimplemented in Halfspace.

◆ getMinYBoundaryType()

boundaryType Region::getMinYBoundaryType ( )
virtual

Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) at the minimum reachable y-coordinate in the Region.

Returns
the boundary condition at the minimum y-coordinate

Reimplemented in Halfspace.

◆ getMinZ()

double Region::getMinZ ( )
virtual

Return the minimum reachable z-coordinate in the Region.

This routine is overloaded for a Halfspace

Returns
the minimum z-coordinate

Reimplemented in Halfspace.

◆ getMinZBoundaryType()

boundaryType Region::getMinZBoundaryType ( )
virtual

Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) at the minimum reachable z-coordinate in the Region.

Returns
the boundary condition at the minimum z-coordinate

Reimplemented in Halfspace.

◆ getNodes()

std::vector< Region * > Region::getNodes ( )
virtual

Return a vector of all of the Region's immediate nodes.

This method will return a list of the Region's nodes when called from Python.

Returns
a vector of the Region's immediate nodes

◆ getParentRegion()

Region * Region::getParentRegion ( )

Get the parent of the current node/Region.

Returns
_parent_region the node/Region that contains the current node/Region

◆ getRegionType()

regionType Region::getRegionType ( )

Return the type of Region (ie, UNION, INTERSECTION, etc).

Returns
the Region type

◆ minSurfaceDist() [1/2]

double Region::minSurfaceDist ( LocalCoords coords)
virtual

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

If the trajectory will not intersect any of the Surfaces in the Region returns INFINITY.

Parameters
coordsa pointer to a localcoords
Returns
distance to the region boundaries

Reimplemented in Halfspace.

◆ minSurfaceDist() [2/2]

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

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

If the trajectory will not intersect any of the Surfaces in the Region returns INFINITY.

Parameters
pointthe Point of interest
azimthe azimuthal angle of the trajectory (in radians from $[0,2\pi]$)
polarthe polar angle of the trajectory (in radians from $[0,\pi]$)
Returns
distance to nearest intersection with the region's boundaries

Reimplemented in Halfspace.

◆ removeHalfspace()

void Region::removeHalfspace ( Surface surface,
int  halfspace 
)

Removes a Node from this Region.

//FIXME Does not handle complex CSG cells, only intersections

Parameters
surfacethe surface of Halfspace to remove
halfspacethe side of that surface

◆ setParentRegion()

void Region::setParentRegion ( Region parent)

Set the parent of the current node/Region.

Parameters
parentthe node/Region that contains the current node/Region

Member Data Documentation

◆ _nodes

std::vector<Region*> Region::_nodes
protected

A collection of the nodes within the Region

◆ _parent_region

Region* Region::_parent_region
protected

The parent region, a region which has this region among its nodes

◆ _region_type

regionType Region::_region_type
protected

The type of Region (ie, UNION, INTERSECTION, etc)


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