![]() |
An open source method of characteristics neutron transport code.
|
The LocalCoords represents a set of local coordinates on some level of nested Universes making up the geometry. _next and _prev allow for use of LocalCoords as a linked list but _next_array can also be used to access coordinates. More...
#include "openmoc/src/host/LocalCoords.h"
Public Member Functions | |
| LocalCoords (double x=0.0, double y=0.0, double z=0.0, bool first=false) | |
| Constructor sets the x, y and z coordinates and position as a coord. More... | |
| virtual | ~LocalCoords () |
| Destructor. | |
| coordType | getType () |
| Return the level (UNIV or LAT) of this LocalCoords. More... | |
| Universe * | getUniverse () const |
| Return the Universe within which this LocalCoords resides. More... | |
| Cell * | getCell () const |
| Return the Cell within which this LocalCoords resides. More... | |
| Lattice * | getLattice () const |
| Return the Lattice within which this LocalCoords resides. More... | |
| int | getLatticeX () const |
| Return the first index of the Lattice cell within which this LocalCoords resides. More... | |
| int | getLatticeY () const |
| Return the second index of the Lattice cell within which this LocalCoords resides. More... | |
| int | getLatticeZ () const |
| Return the third index of the Lattice cell within which this LocalCoords resides. More... | |
| double | getX () const |
| Returns the x-coordinate for this LocalCoords location. More... | |
| double | getY () const |
| Returns the y-coordinate for this LocalCoords location. More... | |
| double | getZ () const |
| Returns the z-coordinate for this LocalCoords location. More... | |
| double | getPhi () const |
| Returns the direction angle in radians with respect to the x-axis. More... | |
| double | getPolar () const |
| Returns the direction angle in radians with respect to the z-axis. More... | |
| Point * | getPoint () |
| Returns a pointer to the Point containing the coordinates for this LocalCoord. More... | |
| LocalCoords * | getNext () const |
| Return a pointer to the LocalCoord at the next lower nested Universe level if one exists. More... | |
| LocalCoords * | getNextCreate (double x, double y, double z) |
| Creates and returns a pointer to the next LocalCoords (nested deeper). More... | |
| LocalCoords * | getPrev () const |
| Return a pointer to the LocalCoord at the next higher nested Universe level if one exists. More... | |
| int | getVersionNum () |
| Returns the version of the LocalCoords object. More... | |
| int | getPosition () |
| Returns the LocalCoords position in the _next_array. More... | |
| void | setType (coordType type) |
| Set the type of LocalCoords (UNIV or LAT). More... | |
| void | setUniverse (Universe *universe) |
| Set the Universe within which this LocalCoords resides. More... | |
| void | setCell (Cell *cell) |
| Set the Cell within which this LocalCoords resides. More... | |
| void | setLattice (Lattice *lattice) |
| Sets the Lattice within which this LocalCoords resides. More... | |
| void | setLatticeX (int lattice_x) |
| Sets the row index for the Lattice cell within which this LocalCoords resides. More... | |
| void | setLatticeY (int lattice_y) |
| Sets the column index for the Lattice cell within which this LocalCoords resides. More... | |
| void | setLatticeZ (int lattice_z) |
| Sets the z index for the Lattice cell within which this LocalCoords resides. More... | |
| void | setX (double x) |
| Set the x-coordinate for this LocalCoords. More... | |
| void | setY (double y) |
| Set the y-coordinate for this Localcoords. More... | |
| void | setZ (double z) |
| Set the z-coordinate for this LocalCoords. More... | |
| void | setPhi (double phi) |
| Set the azimuthal angle for this LocalCoords. More... | |
| void | setPolar (double polar) |
| Set the polar angle for this LocalCoords. More... | |
| void | setNext (LocalCoords *next) |
| Sets the pointer to the LocalCoords on the next lower nested Universe level. More... | |
| void | setPrev (LocalCoords *coords) |
| Sets the pointer to the LocalCoords on the next higher nested Universe level. More... | |
| void | setVersionNum (int version_num) |
| Sets the version of the LocalCoords object. More... | |
| LocalCoords * | getLowestLevel () |
| Find and return the last LocalCoords in the linked list which represents the local coordinates on the lowest level of a geometry of nested universes. More... | |
| LocalCoords * | getHighestLevel () |
| Find and return the first LocalCoords in the linked list which represents the local coordinates on the highest level of a geometry of nested universes. More... | |
| void | adjustCoords (double delta_x, double delta_y, double delta_z=0.0) |
| Translate all of the x,y,z coordinates for each LocalCoords object in the linked list. More... | |
| void | updateMostLocal (Point *point) |
| Update the last element in the linked list (the one at the lowest level of nested Universes) to have the same coordinates as a given point. More... | |
| void | prune () |
| Removes and frees memory for all LocalCoords beyond this one in the linked list. | |
| void | deleteArray () |
| Deletes the underlying array for next coordinates. | |
| void | copyCoords (LocalCoords *coords) |
| Copies a LocalCoords' values to this one. More... | |
| std::string | toString () |
| Converts this LocalCoords's attributes to a character array representation. More... | |
| void | detectLoop () |
| Searches through the LocalCoords object to detect a loop. More... | |
The LocalCoords represents a set of local coordinates on some level of nested Universes making up the geometry. _next and _prev allow for use of LocalCoords as a linked list but _next_array can also be used to access coordinates.
| LocalCoords::LocalCoords | ( | double | x = 0.0, |
| double | y = 0.0, |
||
| double | z = 0.0, |
||
| bool | first = false |
||
| ) |
Constructor sets the x, y and z coordinates and position as a coord.
| x | the x-coordinate |
| y | the y-coordinate |
| z | the z-coordinate |
| first | whether the LocalCoords is the first one, that will contain an array to all the next LocalCoords |
| void LocalCoords::adjustCoords | ( | double | delta_x, |
| double | delta_y, | ||
| double | delta_z = 0.0 |
||
| ) |
Translate all of the x,y,z coordinates for each LocalCoords object in the linked list.
This method will traverse the entire linked list and apply the translation to each element.
| delta_x | amount we wish to move x by |
| delta_y | amount we wish to move y by |
| delta_z | amount we wish to move z by |
| void LocalCoords::copyCoords | ( | LocalCoords * | coords | ) |
Copies a LocalCoords' values to this one.
Given a pointer to a LocalCoords, it first prunes it and then creates a copy of the linked list of LocalCoords in the linked list below this one to give to the input LocalCoords.
| coords | a pointer to the LocalCoords to give the linked list copy to |
| void LocalCoords::detectLoop | ( | ) |
Searches through the LocalCoords object to detect a loop.
A loop is assumed if the LocalCoords apparent length is greater 1000 members
| Cell * LocalCoords::getCell | ( | ) | const |
Return the Cell within which this LocalCoords resides.
| LocalCoords * LocalCoords::getHighestLevel | ( | ) |
Find and return the first LocalCoords in the linked list which represents the local coordinates on the highest level of a geometry of nested universes.
Traverses a linked list of LocalCoords to find the one at the highest nested Universe level.
| Lattice * LocalCoords::getLattice | ( | ) | const |
Return the Lattice within which this LocalCoords resides.
| int LocalCoords::getLatticeX | ( | ) | const |
Return the first index of the Lattice cell within which this LocalCoords resides.
| int LocalCoords::getLatticeY | ( | ) | const |
Return the second index of the Lattice cell within which this LocalCoords resides.
| int LocalCoords::getLatticeZ | ( | ) | const |
Return the third index of the Lattice cell within which this LocalCoords resides.
| LocalCoords * LocalCoords::getLowestLevel | ( | ) |
Find and return the last LocalCoords in the linked list which represents the local coordinates on the lowest level of a geometry of nested universes.
Traverses a linked list of LocalCoords to find the one at the lowest nested Universe level.
| LocalCoords * LocalCoords::getNext | ( | ) | const |
Return a pointer to the LocalCoord at the next lower nested Universe level if one exists.
| LocalCoords * LocalCoords::getNextCreate | ( | double | x, |
| double | y, | ||
| double | z | ||
| ) |
Creates and returns a pointer to the next LocalCoords (nested deeper).
| x | the x-coordinate |
| y | the y-coordinate |
| z | the z-coordinate |
| double LocalCoords::getPhi | ( | ) | const |
Returns the direction angle in radians with respect to the x-axis.
| Point * LocalCoords::getPoint | ( | ) |
| double LocalCoords::getPolar | ( | ) | const |
Returns the direction angle in radians with respect to the z-axis.
| int LocalCoords::getPosition | ( | ) |
Returns the LocalCoords position in the _next_array.
| LocalCoords * LocalCoords::getPrev | ( | ) | const |
Return a pointer to the LocalCoord at the next higher nested Universe level if one exists.
| coordType LocalCoords::getType | ( | ) |
Return the level (UNIV or LAT) of this LocalCoords.
| Universe * LocalCoords::getUniverse | ( | ) | const |
Return the Universe within which this LocalCoords resides.
| int LocalCoords::getVersionNum | ( | ) |
Returns the version of the LocalCoords object.
The version number differentiates otherwise matching FSR keys
| double LocalCoords::getX | ( | ) | const |
Returns the x-coordinate for this LocalCoords location.
| double LocalCoords::getY | ( | ) | const |
Returns the y-coordinate for this LocalCoords location.
| double LocalCoords::getZ | ( | ) | const |
Returns the z-coordinate for this LocalCoords location.
| void LocalCoords::setCell | ( | Cell * | cell | ) |
Set the Cell within which this LocalCoords resides.
| cell | the Cell |
| void LocalCoords::setLattice | ( | Lattice * | lattice | ) |
Sets the Lattice within which this LocalCoords resides.
| lattice | the Lattice |
| void LocalCoords::setLatticeX | ( | int | lattice_x | ) |
Sets the row index for the Lattice cell within which this LocalCoords resides.
| lattice_x | the row Lattice cell index |
| void LocalCoords::setLatticeY | ( | int | lattice_y | ) |
Sets the column index for the Lattice cell within which this LocalCoords resides.
| lattice_y | the column Lattice cell index |
| void LocalCoords::setLatticeZ | ( | int | lattice_z | ) |
Sets the z index for the Lattice cell within which this LocalCoords resides.
| lattice_z | the z Lattice cell index |
| void LocalCoords::setNext | ( | LocalCoords * | next | ) |
Sets the pointer to the LocalCoords on the next lower nested Universe level.
| next | pointer to the next LocalCoords |
| void LocalCoords::setPhi | ( | double | phi | ) |
Set the azimuthal angle for this LocalCoords.
| phi | the azimuthal angle |
| void LocalCoords::setPolar | ( | double | polar | ) |
Set the polar angle for this LocalCoords.
| polar | the polar angle |
| void LocalCoords::setPrev | ( | LocalCoords * | prev | ) |
Sets the pointer to the LocalCoords on the next higher nested Universe level.
| prev | pointer to the previous LocalCoords |
| void LocalCoords::setType | ( | coordType | type | ) |
Set the type of LocalCoords (UNIV or LAT).
| type | the type for LocalCoords (UNIV or LAT) |
| void LocalCoords::setUniverse | ( | Universe * | universe | ) |
Set the Universe within which this LocalCoords resides.
| universe | the Universe |
| void LocalCoords::setVersionNum | ( | int | version_num | ) |
Sets the version of the LocalCoords object.
The version number differentiates otherwise matching FSR keys
| version_num | the version number |
| void LocalCoords::setX | ( | double | x | ) |
Set the x-coordinate for this LocalCoords.
| x | the x-coordinate |
| void LocalCoords::setY | ( | double | y | ) |
Set the y-coordinate for this Localcoords.
| y | the y-coordinate |
| void LocalCoords::setZ | ( | double | z | ) |
Set the z-coordinate for this LocalCoords.
| z | the z-coordinate |
| std::string LocalCoords::toString | ( | ) |
Converts this LocalCoords's attributes to a character array representation.
| void LocalCoords::updateMostLocal | ( | Point * | point | ) |
Update the last element in the linked list (the one at the lowest level of nested Universes) to have the same coordinates as a given point.
| point | a pointer to a point of interest |