An open source method of characteristics neutron transport code.
|
Represents a Cell inside of a Universe. More...
#include "src/Cell.h"
Public Member Functions | |
Cell (int id=0, const char *name="") | |
Constructor sets the unique and user-specifed IDs for this Cell. More... | |
virtual | ~Cell () |
Destructor clears vector of Surface pointers bounding the Cell. | |
int | getUid () const |
Return the Cell's unique ID. More... | |
int | getId () const |
Return the Cell's user-specified ID. More... | |
char * | getName () const |
Return the user-defined name of the Cell. More... | |
cellType | getType () const |
Return the Cell type (FILL or MATERIAL). More... | |
Material * | getFillMaterial () |
Return a pointer to the Material filling this Cell. More... | |
Universe * | getFillUniverse () |
Return a pointer to the Material filling this Cell. More... | |
Region * | getRegion () |
Return the Cell's Region, its spatial domain. More... | |
double | getVolume () |
Return the aggregate volume/area of all instances of this Cell. More... | |
int | getNumInstances () |
Return the number of instances of this Cell in the Geometry. More... | |
bool | isRotated () |
Return a boolean indicating whether the Cell has been rotated. More... | |
bool | isTranslated () |
Return a boolean indicating whether the Cell has been translated. More... | |
double | getPhi (std::string units="degrees") |
Get the rotation angle about the x-axis in degrees. More... | |
double | getTheta (std::string units="degrees") |
Get the rotation angle about the y-axis in degrees. More... | |
double | getPsi (std::string units="degrees") |
Get the rotation angle about the z-axis in degrees. More... | |
double * | getRotationMatrix () |
Return pointer to array for the rotation matrix. More... | |
double * | getTranslation () |
Return pointer to array for the translations along x, y and z. More... | |
void | retrieveRotation (double *rotations, int num_axes, std::string units="degrees") |
Fills an array with the rotation angles for x, y and z. More... | |
void | retrieveTranslation (double *translations, int num_axes) |
Fills an array with the translations along x, y and z. More... | |
int | getNumRings () |
Return the number of rings in the Cell. More... | |
int | getNumSectors () |
Return the number of sectors in the Cell. More... | |
double | getMinX () |
Return the minimum reachable x-coordinate in the Cell. More... | |
double | getMaxX () |
Return the maximum reachable x-coordinate in the Cell. More... | |
double | getMinY () |
Return the minimum reachable y-coordinate in the Cell. More... | |
double | getMaxY () |
Return the maximum reachable y-coordinate in the Cell. More... | |
double | getMinZ () |
Return the minimum reachable z-coordinate in the Cell. More... | |
double | getMaxZ () |
Return the maximum reachable z-coordinate in the Cell. More... | |
boundaryType | getMinXBoundaryType () |
Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) at the minimum reachable x-coordinate in the Cell. More... | |
boundaryType | getMaxXBoundaryType () |
Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) at the maximum reachable x-coordinate in the Cell. More... | |
boundaryType | getMinYBoundaryType () |
Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) at the minimum reachable y-coordinate in the Cell. More... | |
boundaryType | getMaxYBoundaryType () |
Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) at the maximum reachable y-coordinate in the Cell. More... | |
boundaryType | getMinZBoundaryType () |
Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) at the minimum reachable z-coordinate in the Cell. More... | |
boundaryType | getMaxZBoundaryType () |
Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) at the maximum reachable z-coordinate in the Cell. More... | |
int | getNumSurfaces () const |
Return the number of Surfaces in the Cell. More... | |
std::map< int, Halfspace * > | getSurfaces () const |
Return the std::map of Halfspace object pointers for all surfaces within the Region bounding the Cell. More... | |
std::vector< Cell * > | getNeighbors () const |
Return the std::vector of neighbor Cells to this Cell. More... | |
bool | hasParent () |
Return true if the Cell has a parent and false otherwise. More... | |
Cell * | getParent () |
Return this Cell's parent Cell. More... | |
Cell * | getOldestAncestor () |
Get the oldest ancestor Cell for this Cell. More... | |
int | getNumZCylinders () |
Obtain and return the number of ZCylinders in the cell's surfaces. More... | |
std::map< int, Cell * > | getAllCells () |
Returns the std::map of Cell IDs and Cell pointers within any nested Universes filling this Cell. More... | |
std::map< int, Universe * > | getAllUniverses () |
Returns the std::map of all nested Universe IDs and Universe pointers filling this Cell. More... | |
void | setName (const char *name) |
Sets the name of the Cell. More... | |
void | setFill (Material *fill) |
Sets the Material filling this Cell. More... | |
void | setFill (Universe *fill) |
Sets the Universe filling this Cell. More... | |
void | setRegion (Region *region) |
Sets the Region this Cell lives in. More... | |
void | setVolume (double volume) |
Set the volume/area of the Cell. More... | |
void | incrementVolume (double volume) |
Increment the volume/area of the Cell by some amount. More... | |
void | setNumInstances (int num_instances) |
Set the number of instances of this Cell. More... | |
void | incrementNumInstances () |
Increment the number of instances of this Cell. More... | |
void | setRotation (double *rotation, int num_axes, std::string units="degrees") |
Set the Cell's rotation angles about the x, y and z axes. More... | |
void | setTranslation (double *translation, int num_axes) |
Set the Cell's translation along the x, y and z axes. More... | |
void | setNumRings (int num_rings) |
Set the Cell's number of rings. More... | |
void | setNumSectors (int num_sectors) |
Set the Cell's number of sectors. More... | |
void | setParent (Cell *parent) |
Assign a parent Cell to this Cell. More... | |
void | addSurface (int halfspace, Surface *surface) |
Insert a Surface into this Cell's bounding Region, assuming that an intersection between the region and the halfspace is desired. More... | |
void | addSurfaceInRegion (int halfspace, Surface *surface) |
Insert a Surface into this Cell's bounding Region. More... | |
void | addLogicalNode (int region_type) |
Insert a logical node (intersection or union) into the cell region. More... | |
void | goUpOneRegionLogical () |
Climb up the logical tree of regions. | |
void | removeSurface (Surface *surface) |
Removes a Surface from this Cell's container of bounding Surfaces. More... | |
void | addNeighborCell (Cell *cell) |
Add a neighboring Cell to this Cell's collection of neighbors. More... | |
bool | isFissionable () |
Returns true if this Cell is filled with a fissionable Material. More... | |
bool | containsPoint (Point *point) |
Determines whether a Point is contained inside a Cell. More... | |
bool | containsCoords (LocalCoords *coords) |
Determines whether a Point is contained inside a Cell. More... | |
double | minSurfaceDist (Point *point, double azim, double polar) |
Computes the minimum distance to a Surface from a Point with a given trajectory at a certain angle. More... | |
double | minSurfaceDist (LocalCoords *coords) |
Computes the minimum distance to a Surface in the Cell's Region from a point with a given trajectory at a certain angle stored in a LocalCoords object. More... | |
Cell * | clone (bool clone_region=true) |
Create a duplicate of the Cell. More... | |
void | subdivideCell (double max_radius) |
Subdivides a Cell into rings and sectors aligned with the z-axis. More... | |
void | buildNeighbors () |
Build a collection of neighboring Cells for optimized ray tracing. | |
std::string | toString () |
Convert this Cell's attributes to a string format. More... | |
void | printString () |
Prints a string representation of all of the Cell's attributes to the console. | |
Cell::Cell | ( | int | id = 0 , |
const char * | name = "" |
||
) |
void Cell::addLogicalNode | ( | int | region_type | ) |
Insert a logical node (intersection or union) into the cell region.
This method creates a node in a tree of regions. The leaves, or the nodes at the very bottom of the tree, are halfspaces. The region is defined by that tree.
region_type | the logical operation |
void Cell::addNeighborCell | ( | Cell * | cell | ) |
void Cell::addSurface | ( | int | halfspace, |
Surface * | surface | ||
) |
void Cell::addSurfaceInRegion | ( | int | halfspace, |
Surface * | surface | ||
) |
Cell * Cell::clone | ( | bool | clone_region = true | ) |
Create a duplicate of the Cell.
bool Cell::containsCoords | ( | LocalCoords * | coords | ) |
Determines whether a Point is contained inside a Cell.
Queries each Surface inside the Cell to determine if the Point is on the same side of the Surface. This Point is only inside the Cell if it is on the same side of every Surface in the Cell.
coords | a pointer to a localcoord |
bool Cell::containsPoint | ( | Point * | point | ) |
std::map< int, Cell * > Cell::getAllCells | ( | ) |
std::map< int, Universe * > Cell::getAllUniverses | ( | ) |
Material * Cell::getFillMaterial | ( | ) |
Universe * Cell::getFillUniverse | ( | ) |
double Cell::getMaxX | ( | ) |
Return the maximum reachable x-coordinate in the Cell.
boundaryType Cell::getMaxXBoundaryType | ( | ) |
Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) at the maximum reachable x-coordinate in the Cell.
double Cell::getMaxY | ( | ) |
Return the maximum reachable y-coordinate in the Cell.
boundaryType Cell::getMaxYBoundaryType | ( | ) |
Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) at the maximum reachable y-coordinate in the Cell.
double Cell::getMaxZ | ( | ) |
Return the maximum reachable z-coordinate in the Cell.
boundaryType Cell::getMaxZBoundaryType | ( | ) |
Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) at the maximum reachable z-coordinate in the Cell.
double Cell::getMinX | ( | ) |
Return the minimum reachable x-coordinate in the Cell.
boundaryType Cell::getMinXBoundaryType | ( | ) |
Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) at the minimum reachable x-coordinate in the Cell.
double Cell::getMinY | ( | ) |
Return the minimum reachable y-coordinate in the Cell.
boundaryType Cell::getMinYBoundaryType | ( | ) |
Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) at the minimum reachable y-coordinate in the Cell.
double Cell::getMinZ | ( | ) |
Return the minimum reachable z-coordinate in the Cell.
boundaryType Cell::getMinZBoundaryType | ( | ) |
Return the boundary condition (REFLECTIVE, VACUUM, or INTERFACE) at the minimum reachable z-coordinate in the Cell.
std::vector< Cell * > Cell::getNeighbors | ( | ) | const |
int Cell::getNumInstances | ( | ) |
int Cell::getNumRings | ( | ) |
Return the number of rings in the Cell.
int Cell::getNumSectors | ( | ) |
Return the number of sectors in the Cell.
int Cell::getNumSurfaces | ( | ) | const |
Return the number of Surfaces in the Cell.
int Cell::getNumZCylinders | ( | ) |
Obtain and return the number of ZCylinders in the cell's surfaces.
Cell * Cell::getOldestAncestor | ( | ) |
Cell * Cell::getParent | ( | ) |
double Cell::getPhi | ( | std::string | units = "degrees" | ) |
Get the rotation angle about the x-axis in degrees.
units | the angular units in "radians" or "degrees" (default) |
double Cell::getPsi | ( | std::string | units = "degrees" | ) |
Get the rotation angle about the z-axis in degrees.
units | the angular units in "radians" or "degrees" (default) |
double * Cell::getRotationMatrix | ( | ) |
Return pointer to array for the rotation matrix.
std::map< int, Halfspace * > Cell::getSurfaces | ( | ) | const |
double Cell::getTheta | ( | std::string | units = "degrees" | ) |
Get the rotation angle about the y-axis in degrees.
units | the angular units in "radians" or "degrees" (default) |
double * Cell::getTranslation | ( | ) |
Return pointer to array for the translations along x, y and z.
double Cell::getVolume | ( | ) |
bool Cell::hasParent | ( | ) |
void Cell::incrementNumInstances | ( | ) |
Increment the number of instances of this Cell.
This routine is called by the TrackGenerator during track generation and segmentation.
void Cell::incrementVolume | ( | double | volume | ) |
Increment the volume/area of the Cell by some amount.
This routine is called by the TrackGenerator during track generation and segmentation.
volume | the amount to increment the current volume by |
bool Cell::isFissionable | ( | ) |
Returns true if this Cell is filled with a fissionable Material.
If the Cell is filled by a Material, this method will simply query the filling Material. If the Cell is filled by a Universe, this method will consider any Materials filling those Cells contained by the filling Universe. This method should not be called prior to the calling of the Geometry::computeFissionability() method.
bool Cell::isRotated | ( | ) |
bool Cell::isTranslated | ( | ) |
double Cell::minSurfaceDist | ( | Point * | point, |
double | azim, | ||
double | polar | ||
) |
Computes the minimum distance to a Surface from a Point with a given trajectory at a certain angle.
If the trajectory will not intersect any of the Surfaces in the Cell returns INFINITY.
point | the Point of interest |
azim | the azimuthal angle of the trajectory (in radians from ) |
polar | the polar angle of the trajectory (in radians from ) |
double Cell::minSurfaceDist | ( | LocalCoords * | coords | ) |
Computes the minimum distance to a Surface in the Cell's 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 Cell returns INFINITY.
coords | a pointer to a localcoords |
void Cell::removeSurface | ( | Surface * | surface | ) |
void Cell::retrieveRotation | ( | double * | rotations, |
int | num_axes, | ||
std::string | units = "degrees" |
||
) |
Fills an array with the rotation angles for x, y and z.
This class method is intended to be called by the OpenMOC Python OpenMC compatiblity module. Although this method appears to require two arguments, in reality it only requires one due to SWIG and would be called from within Python as follows:
rotations | an array of rotation angles of length 3 for x, y and z |
num_axes | the number of axes (this must always be 3) |
units | the angular units in "radians" or "degrees" (default) |
void Cell::retrieveTranslation | ( | double * | translations, |
int | num_axes | ||
) |
Fills an array with the translations along x, y and z.
This class method is intended to be called by the OpenMOC Python OpenMC compatiblity module. Although this method appears to require two arguments, in reality it only requires one due to SWIG and would be called from within Python as follows:
translations | an array of translations of length 3 for x, y and z |
num_axes | the number of axes (this must always be 3) |
void Cell::setFill | ( | Material * | fill | ) |
void Cell::setFill | ( | Universe * | fill | ) |
void Cell::setName | ( | const char * | name | ) |
void Cell::setNumInstances | ( | int | num_instances | ) |
void Cell::setNumRings | ( | int | num_rings | ) |
void Cell::setNumSectors | ( | int | num_sectors | ) |
void Cell::setParent | ( | Cell * | parent | ) |
void Cell::setRegion | ( | Region * | region | ) |
void Cell::setRotation | ( | double * | rotation, |
int | num_axes, | ||
std::string | units = "degrees" |
||
) |
Set the Cell's rotation angles about the x, y and z axes.
This method is a helper function to allow OpenMOC users to assign the Cell's rotation angles in Python. A user must initialize a length 3 NumPy array as input to this function. This function then stores the data values in the NumPy array in the Cell's rotation array. An example of how this function might be called in Python is as follows:
rotation | the array of rotation angles |
num_axes | the number of axes (this must always be 3) |
units | the angular units in "radians" or "degrees" (default) |
void Cell::setTranslation | ( | double * | translation, |
int | num_axes | ||
) |
Set the Cell's translation along the x, y and z axes.
This method is a helper function to allow OpenMOC users to assign the Cell's translations in Python. A user must initialize a length 3 NumPy array as input to this function. This function then stores the data values in the NumPy array in the Cell's translation array. An example of how this function might be called in Python is as follows:
translation | the array of translations |
num_axes | the number of axes (this must always be 3) |
void Cell::setVolume | ( | double | volume | ) |
void Cell::subdivideCell | ( | double | max_radius | ) |
Subdivides a Cell into rings and sectors aligned with the z-axis.
This method uses the Cell's clone method to produce a vector of this Cell's subdivided ring and sector Cells.
max_radius | the maximum allowable radius used in the subdivisions |
A container of all Cell clones created for rings and sectors
std::string Cell::toString | ( | ) |