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

A Universe represents an unbounded space in 3D. More...

#include "src/Universe.h"

Public Member Functions

 Universe (const int id=-1, const char *name="")
 Constructor assigns a unique and user-specified ID for the Universe. More...
 
virtual ~Universe ()
 Destructor clears the Cell pointers container.
 
int getUid () const
 Returns the Universe's unique ID. More...
 
int getId () const
 Return the user-specified ID for this Universe. More...
 
char * getName () const
 Return the user-defined name of the Universe. More...
 
universeType getType ()
 Return the Universe type (SIMPLE or LATTICE). More...
 
int getNumCells () const
 Return the number of Cells in this Universe. More...
 
double getMinX ()
 Returns the minimum reachable x-coordinate in the Universe. More...
 
double getMaxX ()
 Returns the maximum reachable x-coordinate in the Universe. More...
 
double getMinY ()
 Returns the minimum reachable y-coordinate in the Universe. More...
 
double getMaxY ()
 Returns the maximum reachable y-coordinate in the Universe. More...
 
double getMinZ ()
 Returns the minimum reachable z-coordinate in the Universe. More...
 
double getMaxZ ()
 Returns the maximum reachable z-coordinate in the Universe. More...
 
boundaryType getMinXBoundaryType ()
 Returns the boundary conditions (VACUUM or REFLECTIVE) at the minimum reachable x-coordinate in the Universe. More...
 
boundaryType getMaxXBoundaryType ()
 Returns the boundary conditions (VACUUM or REFLECTIVE) at the maximum reachable x-coordinate in the Universe. More...
 
boundaryType getMinYBoundaryType ()
 Returns the boundary conditions (VACUUM or REFLECTIVE) at the minimum reachable y-coordinate in the Universe. More...
 
boundaryType getMaxYBoundaryType ()
 Returns the boundary conditions (VACUUM or REFLECTIVE) at the maximum reachable y-coordinate in the Universe. More...
 
boundaryType getMinZBoundaryType ()
 Returns the boundary conditions (VACUUM or REFLECTIVE) at the minimum reachable z-coordinate in the Universe. More...
 
boundaryType getMaxZBoundaryType ()
 Returns the boundary conditions (VACUUM or REFLECTIVE) at the maximum reachable z-coordinate in the Universe. More...
 
CellgetCell (int cell_id)
 Returns a Cell in this universe. More...
 
std::map< int, Cell * > getCells () const
 Return the container of Cell IDs and Cell pointers in this Universe. More...
 
std::map< int, Cell * > getAllCells ()
 Returns the std::map of Cell IDs and Cell pointers in this Universe at all nested Universe levels. More...
 
std::map< int, Material * > getAllMaterials ()
 Returns the std::map of all IDs and Material pointers filling this Universe. More...
 
std::map< int, Universe * > getAllUniverses ()
 Returns the std::map of all nested Universe IDs and Universe pointers filling this Universe. More...
 
bool isFissionable ()
 Returns true if the Universe contains a Cell filled by a fissionable Material and false otherwise. More...
 
void resetBoundaries ()
 Sets _boundaries_not_updated to true so boundaries will be recalculated if needed.
 
void calculateBoundaries ()
 Calculates the boundary locations and conditions (VACUUM or REFLECTIVE) at the maximum and minimum reachable coordinates in the Universe.
 
void setName (const char *name)
 Sets the name of the Universe. More...
 
void setType (universeType type)
 Sets the Universe type to SIMPLE or LATTICE. More...
 
void addCell (Cell *cell)
 Adds a Cell to this Universe. More...
 
void removeCell (Cell *cell)
 Removes a Cell from this Universe's container of Cells. More...
 
bool containsPoint (Point *point)
 Determines whether a Point is contained inside a Universe. More...
 
CellfindCell (LocalCoords *coords)
 Finds the Cell for which a LocalCoords object resides. More...
 
void setFissionability (bool fissionable)
 Sets whether or not this Universe contains a fissionable Material with a non-zero fission cross-section. More...
 
void subdivideCells (double max_radius=INFINITY)
 Subdivides all of the Material-filled Cells within this Universe into rings and angular sectors aligned with the z-axis. More...
 
void buildNeighbors ()
 Builds collections of neighboring Cells for all Cells in this Universe for optimized ray tracing.
 
virtual std::string toString ()
 Convert the member attributes of this Universe to a character array. More...
 
void printString ()
 Prints a string representation of the Universe's attributes to the console.
 
Universeclone ()
 Clones this Universe and copy cells map. More...
 

Protected Attributes

int _uid
 
int _id
 
char * _name
 
universeType _type
 
std::map< int, Cell * > _cells
 
bool _fissionable
 
double _min_x
 
double _max_x
 
double _min_y
 
double _max_y
 
double _min_z
 
double _max_z
 
bool _boundaries_inspected
 
boundaryType _min_x_bound
 
boundaryType _max_x_bound
 
boundaryType _min_y_bound
 
boundaryType _max_y_bound
 
boundaryType _min_z_bound
 
boundaryType _max_z_bound
 

Static Protected Attributes

static int _n = 0
 

Detailed Description

A Universe represents an unbounded space in 3D.

A Universe contains cell which are bounded subspaces in 3D which together form the Universe. Universes allow for complex, repeating (i.e. lattices) geometries to be simply represented with as few data structures as possible.

Constructor & Destructor Documentation

◆ Universe()

Universe::Universe ( const int  id = -1,
const char *  name = "" 
)

Constructor assigns a unique and user-specified ID for the Universe.

Parameters
idthe user-specified optional Universe ID
namethe user-specified optional Universe ID

Member Function Documentation

◆ addCell()

void Universe::addCell ( Cell cell)

Adds a Cell to this Universe.

Stores the user-specified Cell ID and Cell pointer in a std::map along with all of other Cells added to this Universe.

Parameters
cellthe Cell pointer

◆ clone()

Universe * Universe::clone ( )

Clones this Universe and copy cells map.

Returns
a pointer to the Universe clone

◆ containsPoint()

bool Universe::containsPoint ( Point point)

Determines whether a Point is contained inside a Universe.

Queries each Cell in the Universe to determine if the Point is within the Universe. This point is only inside the Universe if it is inside one of the Cells.

Parameters
pointa pointer to a Point
Returns
true if the Point is inside the Universe; otherwise false

◆ findCell()

Cell * Universe::findCell ( LocalCoords coords)

Finds the Cell for which a LocalCoords object resides.

Finds the Cell that a LocalCoords object is located inside by checking each of this Universe's Cells. Returns NULL if the LocalCoords is not in any of the Cells.

Parameters
coordsa pointer to the LocalCoords of interest
Returns
a pointer the Cell where the LocalCoords is located

◆ getAllCells()

std::map< int, Cell * > Universe::getAllCells ( )

Returns the std::map of Cell IDs and Cell pointers in this Universe at all nested Universe levels.

Returns
std::map of Cell IDs and pointers

◆ getAllMaterials()

std::map< int, Material * > Universe::getAllMaterials ( )

Returns the std::map of all IDs and Material pointers filling this Universe.

Returns
std::map of Material IDs and pointers

◆ getAllUniverses()

std::map< int, Universe * > Universe::getAllUniverses ( )

Returns the std::map of all nested Universe IDs and Universe pointers filling this Universe.

Returns
std::map of Universe IDs and pointers

◆ getCell()

Cell * Universe::getCell ( int  cell_id)

Returns a Cell in this universe.

Parameters
cell_idthe integer the cell_id
Returns
Returns the cell pointer.

◆ getCells()

std::map< int, Cell * > Universe::getCells ( ) const

Return the container of Cell IDs and Cell pointers in this Universe.

Returns
std::map of Cell IDs

◆ getId()

int Universe::getId ( ) const

Return the user-specified ID for this Universe.

Returns
the user-specified Universe ID

◆ getMaxX()

double Universe::getMaxX ( )

Returns the maximum reachable x-coordinate in the Universe.

Returns
the maximum reachable x-coordinate

◆ getMaxXBoundaryType()

boundaryType Universe::getMaxXBoundaryType ( )

Returns the boundary conditions (VACUUM or REFLECTIVE) at the maximum reachable x-coordinate in the Universe.

Returns
the boundary conditions at the maximum reachable x-coordinate

◆ getMaxY()

double Universe::getMaxY ( )

Returns the maximum reachable y-coordinate in the Universe.

Returns
the maximum reachable y-coordinate

◆ getMaxYBoundaryType()

boundaryType Universe::getMaxYBoundaryType ( )

Returns the boundary conditions (VACUUM or REFLECTIVE) at the maximum reachable y-coordinate in the Universe.

Returns
the boundary conditions at the maximum reachable y-coordinate

◆ getMaxZ()

double Universe::getMaxZ ( )

Returns the maximum reachable z-coordinate in the Universe.

Returns
the maximum reachable z-coordinate

◆ getMaxZBoundaryType()

boundaryType Universe::getMaxZBoundaryType ( )

Returns the boundary conditions (VACUUM or REFLECTIVE) at the maximum reachable z-coordinate in the Universe.

Returns
the boundary conditions at the maximum reachable z-coordinate

◆ getMinX()

double Universe::getMinX ( )

Returns the minimum reachable x-coordinate in the Universe.

Returns
the minimum reachable x-coordinate

◆ getMinXBoundaryType()

boundaryType Universe::getMinXBoundaryType ( )

Returns the boundary conditions (VACUUM or REFLECTIVE) at the minimum reachable x-coordinate in the Universe.

Returns
the boundary conditions at the minimum reachable x-coordinate

◆ getMinY()

double Universe::getMinY ( )

Returns the minimum reachable y-coordinate in the Universe.

Returns
the minimum reachable y-coordinate

◆ getMinYBoundaryType()

boundaryType Universe::getMinYBoundaryType ( )

Returns the boundary conditions (VACUUM or REFLECTIVE) at the minimum reachable y-coordinate in the Universe.

Returns
the boundary conditions at the minimum reachable y-coordinate

◆ getMinZ()

double Universe::getMinZ ( )

Returns the minimum reachable z-coordinate in the Universe.

Returns
the minimum reachable z-coordinate

◆ getMinZBoundaryType()

boundaryType Universe::getMinZBoundaryType ( )

Returns the boundary conditions (VACUUM or REFLECTIVE) at the minimum reachable z-coordinate in the Universe.

Returns
the boundary conditions at the minimum reachable z-coordinate

◆ getName()

char * Universe::getName ( ) const

Return the user-defined name of the Universe.

Returns
the Universe name

◆ getNumCells()

int Universe::getNumCells ( ) const

Return the number of Cells in this Universe.

Returns
the number of Cells

◆ getType()

universeType Universe::getType ( )

Return the Universe type (SIMPLE or LATTICE).

Returns
the Universe type

◆ getUid()

int Universe::getUid ( ) const

Returns the Universe's unique ID.

Returns
the Universe's unique ID.

◆ isFissionable()

bool Universe::isFissionable ( )

Returns true if the Universe contains a Cell filled by a fissionable Material and false otherwise.

This method should not be called prior to the calling of the Geometry::computeFissionability() method.

Returns
true if contains a fissionable Material

◆ removeCell()

void Universe::removeCell ( Cell cell)

Removes a Cell from this Universe's container of Cells.

Parameters
cella pointer to the Cell to remove

◆ setFissionability()

void Universe::setFissionability ( bool  fissionable)

Sets whether or not this Universe contains a fissionable Material with a non-zero fission cross-section.

This method is called by the Geometry::computeFissionability() class method.

Parameters
fissionabletrue if the Universe contains a fissionable Material; false otherwise

◆ setName()

void Universe::setName ( const char *  name)

Sets the name of the Universe.

Parameters
namethe Universe name string

◆ setType()

void Universe::setType ( universeType  type)

Sets the Universe type to SIMPLE or LATTICE.

Parameters
typethe Universe type

◆ subdivideCells()

void Universe::subdivideCells ( double  max_radius = INFINITY)

Subdivides all of the Material-filled Cells within this Universe into rings and angular sectors aligned with the z-axis.

Parameters
max_radiusthe maximum allowable radius used in the subdivisions

◆ toString()

std::string Universe::toString ( )
virtual

Convert the member attributes of this Universe to a character array.

Returns
a character array representing the Universe's attributes

Reimplemented in Lattice.

Member Data Documentation

◆ _boundaries_inspected

bool Universe::_boundaries_inspected
protected

A flag for determining if boundaries are up to date

◆ _cells

std::map<int, Cell*> Universe::_cells
protected

A collection of Cell IDs and Cell pointers in this Universe

◆ _fissionable

bool Universe::_fissionable
protected

A boolean representing whether or not this Universe contains a Material with a non-zero fission cross-section and is fissionable

◆ _id

int Universe::_id
protected

A user-defined id for each Universe created

◆ _min_x

double Universe::_min_x
protected

The extrema of the Universe

◆ _min_x_bound

boundaryType Universe::_min_x_bound
protected

The boundaryTypes of the universe

◆ _n

int Universe::_n = 0
staticprotected

A static counter for the number of Universes

◆ _name

char* Universe::_name
protected

A user-defined name for the Surface

◆ _type

universeType Universe::_type
protected

The type of Universe (ie, SIMPLE or LATTICE)

◆ _uid

int Universe::_uid
protected

A monotonically increasing unique ID for each Universe created


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