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

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...
 
UniversegetUniverse () const
 Return the Universe within which this LocalCoords resides. More...
 
CellgetCell () const
 Return the Cell within which this LocalCoords resides. More...
 
LatticegetLattice () 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...
 
PointgetPoint ()
 Returns a pointer to the Point containing the coordinates for this LocalCoord. More...
 
LocalCoordsgetNext () const
 Return a pointer to the LocalCoord at the next lower nested Universe level if one exists. More...
 
LocalCoordsgetNextCreate (double x, double y, double z)
 Creates and returns a pointer to the next LocalCoords (nested deeper). More...
 
LocalCoordsgetPrev () 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...
 
LocalCoordsgetLowestLevel ()
 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...
 
LocalCoordsgetHighestLevel ()
 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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ LocalCoords()

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.

Parameters
xthe x-coordinate
ythe y-coordinate
zthe z-coordinate
firstwhether the LocalCoords is the first one, that will contain an array to all the next LocalCoords

Member Function Documentation

◆ adjustCoords()

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.

Parameters
delta_xamount we wish to move x by
delta_yamount we wish to move y by
delta_zamount we wish to move z by

◆ copyCoords()

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.

Parameters
coordsa pointer to the LocalCoords to give the linked list copy to

◆ detectLoop()

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

◆ getCell()

Cell * LocalCoords::getCell ( ) const

Return the Cell within which this LocalCoords resides.

Returns
the Cell

◆ getHighestLevel()

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.

Returns
a pointer to the first LocalCoords object in the list

◆ getLattice()

Lattice * LocalCoords::getLattice ( ) const

Return the Lattice within which this LocalCoords resides.

Returns
the Lattice

◆ getLatticeX()

int LocalCoords::getLatticeX ( ) const

Return the first index of the Lattice cell within which this LocalCoords resides.

Returns
the first Lattice cell index

◆ getLatticeY()

int LocalCoords::getLatticeY ( ) const

Return the second index of the Lattice cell within which this LocalCoords resides.

Returns
the second Lattice cell index

◆ getLatticeZ()

int LocalCoords::getLatticeZ ( ) const

Return the third index of the Lattice cell within which this LocalCoords resides.

Returns
the third Lattice cell index

◆ getLowestLevel()

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.

Returns
a pointer to the last LocalCoords object in the list

◆ getNext()

LocalCoords * LocalCoords::getNext ( ) const

Return a pointer to the LocalCoord at the next lower nested Universe level if one exists.

Returns
pointer to the next LocalCoord

◆ getNextCreate()

LocalCoords * LocalCoords::getNextCreate ( double  x,
double  y,
double  z 
)

Creates and returns a pointer to the next LocalCoords (nested deeper).

Parameters
xthe x-coordinate
ythe y-coordinate
zthe z-coordinate
Returns
pointer to the next LocalCoords that was just created

◆ getPhi()

double LocalCoords::getPhi ( ) const

Returns the direction angle in radians with respect to the x-axis.

Returns
the direction angle in radians

◆ getPoint()

Point * LocalCoords::getPoint ( )

Returns a pointer to the Point containing the coordinates for this LocalCoord.

Returns
pointer to the Point containing the x and y coordinates

◆ getPolar()

double LocalCoords::getPolar ( ) const

Returns the direction angle in radians with respect to the z-axis.

Returns
the direction angle in radians

◆ getPosition()

int LocalCoords::getPosition ( )

Returns the LocalCoords position in the _next_array.

Returns
The position of this object in the underlying _next_array

◆ getPrev()

LocalCoords * LocalCoords::getPrev ( ) const

Return a pointer to the LocalCoord at the next higher nested Universe level if one exists.

Returns
pointer to the previous LocalCoord

◆ getType()

coordType LocalCoords::getType ( )

Return the level (UNIV or LAT) of this LocalCoords.

Returns
the nested Universe level (UNIV or LAT)

◆ getUniverse()

Universe * LocalCoords::getUniverse ( ) const

Return the Universe within which this LocalCoords resides.

Returns
the Universe

◆ getVersionNum()

int LocalCoords::getVersionNum ( )

Returns the version of the LocalCoords object.

The version number differentiates otherwise matching FSR keys

Returns
The version number

◆ getX()

double LocalCoords::getX ( ) const

Returns the x-coordinate for this LocalCoords location.

Returns
the x-coordinate of this LocalCoords location

◆ getY()

double LocalCoords::getY ( ) const

Returns the y-coordinate for this LocalCoords location.

Returns
the y-coordinate of this LocalCoords location

◆ getZ()

double LocalCoords::getZ ( ) const

Returns the z-coordinate for this LocalCoords location.

Returns
the z-coordinate of this LocalCoords location

◆ setCell()

void LocalCoords::setCell ( Cell cell)

Set the Cell within which this LocalCoords resides.

Parameters
cellthe Cell

◆ setLattice()

void LocalCoords::setLattice ( Lattice lattice)

Sets the Lattice within which this LocalCoords resides.

Parameters
latticethe Lattice

◆ setLatticeX()

void LocalCoords::setLatticeX ( int  lattice_x)

Sets the row index for the Lattice cell within which this LocalCoords resides.

Parameters
lattice_xthe row Lattice cell index

◆ setLatticeY()

void LocalCoords::setLatticeY ( int  lattice_y)

Sets the column index for the Lattice cell within which this LocalCoords resides.

Parameters
lattice_ythe column Lattice cell index

◆ setLatticeZ()

void LocalCoords::setLatticeZ ( int  lattice_z)

Sets the z index for the Lattice cell within which this LocalCoords resides.

Parameters
lattice_zthe z Lattice cell index

◆ setNext()

void LocalCoords::setNext ( LocalCoords next)

Sets the pointer to the LocalCoords on the next lower nested Universe level.

Parameters
nextpointer to the next LocalCoords

◆ setPhi()

void LocalCoords::setPhi ( double  phi)

Set the azimuthal angle for this LocalCoords.

Parameters
phithe azimuthal angle

◆ setPolar()

void LocalCoords::setPolar ( double  polar)

Set the polar angle for this LocalCoords.

Parameters
polarthe polar angle

◆ setPrev()

void LocalCoords::setPrev ( LocalCoords prev)

Sets the pointer to the LocalCoords on the next higher nested Universe level.

Parameters
prevpointer to the previous LocalCoords

◆ setType()

void LocalCoords::setType ( coordType  type)

Set the type of LocalCoords (UNIV or LAT).

Parameters
typethe type for LocalCoords (UNIV or LAT)

◆ setUniverse()

void LocalCoords::setUniverse ( Universe universe)

Set the Universe within which this LocalCoords resides.

Parameters
universethe Universe

◆ setVersionNum()

void LocalCoords::setVersionNum ( int  version_num)

Sets the version of the LocalCoords object.

The version number differentiates otherwise matching FSR keys

Parameters
version_numthe version number

◆ setX()

void LocalCoords::setX ( double  x)

Set the x-coordinate for this LocalCoords.

Parameters
xthe x-coordinate

◆ setY()

void LocalCoords::setY ( double  y)

Set the y-coordinate for this Localcoords.

Parameters
ythe y-coordinate

◆ setZ()

void LocalCoords::setZ ( double  z)

Set the z-coordinate for this LocalCoords.

Parameters
zthe z-coordinate

◆ toString()

std::string LocalCoords::toString ( )

Converts this LocalCoords's attributes to a character array representation.

Returns
a character array of the LocalCoord's attributes

◆ updateMostLocal()

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.

Parameters
pointa pointer to a point of interest

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