105 Universe(
const int id=-1,
const char* name=
"");
126 std::map<int, Cell*>
getCells()
const;
134 void setName(
const char* name);
177 std::vector<double> _widths_x;
178 std::vector<double> _accumulate_x;
185 std::vector<double> _widths_y;
186 std::vector<double> _accumulate_y;
193 std::vector<double> _widths_z;
194 std::vector<double> _accumulate_z;
200 std::vector< std::vector< std::vector< std::pair<int, Universe*> > > >
205 Lattice(
const int id=-1,
const char* name=
"");
208 void setOffset(
double x,
double y,
double z=0.0);
217 const std::vector<double>&
getWidthsX()
const;
218 const std::vector<double>&
getWidthsY()
const;
219 const std::vector<double>&
getWidthsZ()
const;
231 std::vector< std::vector< std::vector< std::pair<int, Universe*> > > >*
234 std::map<int, double>
getUniqueRadius(std::map<int, Universe*> unique_universes);
241 void setWidth(
double width_x,
double width_y,
242 double width_z=std::numeric_limits<double>::infinity());
272 void setWidths(std::vector<double> widths_x, std::vector<double> widths_y,
273 std::vector<double> widths_z);
287 template<
typename tPair>
289 typename tPair::second_type operator()(
const tPair& p)
const {
303 template<
typename tMap>
double getMaxX()
Returns the maximum reachable x-coordinate in the Lattice.
Definition: Universe.cpp:1250
int getLatticeCell(Point *point)
Finds the Lattice cell index that a point lies in.
Definition: Universe.cpp:2068
int universe_id()
Returns an auto-generated unique Universe ID.
Definition: Universe.cpp:19
Universe * getUniverse(int lat_x, int lat_y, int lat_z=0) const
Returns a pointer to the Universe within a specific Lattice cell.
Definition: Universe.cpp:1298
Represents a Cell inside of a Universe.
Definition: Cell.h:56
int _id
Definition: Universe.h:69
The LocalCoords represents a set of local coordinates on some level of nested Universes making up the...
Definition: LocalCoords.h:46
double getMaxZ()
Returns the maximum reachable z-coordinate in the Universe.
Definition: Universe.cpp:214
int getUid() const
Returns the Universe's unique ID.
Definition: Universe.cpp:104
int cell_id()
Returns an auto-generated unique Cell ID.
Definition: Cell.cpp:20
void setWidthsX(std::vector< double > widthsx)
Set the widths of non-uniform Lattice in x direction.
Definition: Universe.cpp:1489
void setWidthsY(std::vector< double > widthsy)
Set the widths of non-uniform Lattice in y direction.
Definition: Universe.cpp:1498
void setNumX(int num_x)
Set the number of Lattice cells along the x-axis.
Definition: Universe.cpp:1434
Universe * clone()
Clones this Universe and copy cells map.
Definition: Universe.cpp:699
Represents a general Surface in 3D.
Definition: Surface.h:70
boundaryType getMinYBoundaryType()
Returns the boundary conditions (VACUUM or REFLECTIVE) at the minimum reachable y-coordinate in the U...
Definition: Universe.cpp:270
double getMinZ()
Returns the minimum reachable z-coordinate in the Universe.
Definition: Universe.cpp:201
void printLatticeSizes()
For debug use.
Definition: Universe.cpp:2369
double getWidthY() const
Return the width of the Lattice along the y-axis.
Definition: Universe.cpp:1160
boundaryType
The types of boundary conditions supported by OpenMOC for Surfaces.
Definition: boundary_type.h:15
Math constants and comparision tolerances.
const std::vector< double > & getAccumulateX() const
Return the accumulate widths of non-uniform Lattice in x direction.
Definition: Universe.cpp:1214
A Universe represents an unbounded space in 3D.
Definition: Universe.h:58
int getNumCells() const
Return the number of Cells in this Universe.
Definition: Universe.cpp:140
boundaryType getMinZBoundaryType()
Returns the boundary conditions (VACUUM or REFLECTIVE) at the minimum reachable z-coordinate in the U...
Definition: Universe.cpp:312
void setAccumulateY(std::vector< double > accumulatey)
Set the accumulate widths of non-uniform Lattice in y direction.
Definition: Universe.cpp:1527
double getWidthX() const
Return the width of the Lattice along the x-axis.
Definition: Universe.cpp:1151
std::map< int, Cell * > _cells
Definition: Universe.h:78
const std::vector< double > & getWidthsZ() const
Return the widths of non-uniform Lattice in z direction.
Definition: Universe.cpp:1205
void setNonUniform(bool non_uniform)
Set the non-uniform boolean of Lattice.
Definition: Universe.cpp:1480
void printString()
Prints a string representation of all of the Lattice's attributes to the console. ...
Definition: Universe.cpp:2051
void reset_universe_id()
Resets the auto-generated unique Universe ID counter to 1,000,000.
Definition: Universe.cpp:33
char * getName() const
Return the user-defined name of the Universe.
Definition: Universe.cpp:122
int getId() const
Return the user-specified ID for this Universe.
Definition: Universe.cpp:113
int getLatZ(Point *point)
Finds the Lattice cell z index that a point lies in.
Definition: Universe.cpp:1968
const std::vector< double > & getAccumulateZ() const
Return the accumulate widths of non-uniform Lattice in z direction.
Definition: Universe.cpp:1232
bool getNonUniform() const
Return the non-uniform boolean of Lattice.
Definition: Universe.cpp:1178
Class to represent a 2D/3D point in space.
Definition: Point.h:24
void removeCell(Cell *cell)
Removes a Cell from this Universe's container of Cells.
Definition: Universe.cpp:528
void setFissionability(bool fissionable)
Sets whether or not this Universe contains a fissionable Material with a non-zero fission cross-secti...
Definition: Universe.cpp:497
void computeSizes()
Set _widths_x, _widths_y, _widths_z for uniform case, compute accumulate variables.
Definition: Universe.cpp:2337
void setName(const char *name)
Sets the name of the Universe.
Definition: Universe.cpp:465
int getLatticeSurface(int cell, Point *point)
Finds the Lattice cell surface that a point lies on. If the point is not on a surface, -1 is returned.
Definition: Universe.cpp:2085
universeType _type
Definition: Universe.h:75
void setWidthsZ(std::vector< double > widthsz)
Set the widths of non-uniform Lattice in z direction.
Definition: Universe.cpp:1507
Cell * findCell(LocalCoords *coords)
Finds the Cell within this Lattice that a LocalCoords is in.
Definition: Universe.cpp:1778
double getMaxY()
Returns the maximum reachable y-coordinate in the Lattice.
Definition: Universe.cpp:1268
double getMaxX()
Returns the maximum reachable x-coordinate in the Universe.
Definition: Universe.cpp:162
void setUniverses(int num_z, int num_y, int num_x, Universe **universes)
Sets the array of Universe pointers filling each Lattice cell.
Definition: Universe.cpp:1563
double getMinZ()
Returns the minimum reachable z-coordinate in the Lattice.
Definition: Universe.cpp:1277
int getLatX(Point *point)
Finds the Lattice cell x index that a point lies in.
Definition: Universe.cpp:1897
void setAccumulateZ(std::vector< double > accumulatez)
Set the accumulate widths of non-uniform Lattice in z direction.
Definition: Universe.cpp:1537
boundaryType getMaxYBoundaryType()
Returns the boundary conditions (VACUUM or REFLECTIVE) at the maximum reachable y-coordinate in the U...
Definition: Universe.cpp:291
boundaryType getMaxXBoundaryType()
Returns the boundary conditions (VACUUM or REFLECTIVE) at the maximum reachable x-coordinate in the U...
Definition: Universe.cpp:249
const std::vector< double > & getWidthsY() const
Return the widths of non-uniform Lattice in y direction.
Definition: Universe.cpp:1196
Point * getOffset()
Return a pointer to the offset for this Cell (in global coordinates).
Definition: Universe.cpp:1115
double getMinX()
Returns the minimum reachable x-coordinate in the Lattice.
Definition: Universe.cpp:1241
void printString()
Prints a string representation of the Universe's attributes to the console.
Definition: Universe.cpp:690
void setNumY(int num_y)
Set the number of Lattice cells along the y-axis.
Definition: Universe.cpp:1443
void setAccumulateX(std::vector< double > accumulatex)
Set the accumulate widths of non-uniform Lattice in x direction.
Definition: Universe.cpp:1517
void buildNeighbors()
Builds collections of neighboring Cells for all Cells in this Universe for optimized ray tracing...
Definition: Universe.cpp:650
double getMaxZ()
Returns the maximum reachable z-coordinate in the Lattice.
Definition: Universe.cpp:1286
second_t< typename tMap::value_type > pair_second(const tMap &map)
A helper routine for the Universe::findCell() method.
Definition: Universe.h:304
virtual ~Universe()
Destructor clears the Cell pointers container.
Definition: Universe.cpp:89
double getMinX()
Returns the minimum reachable x-coordinate in the Universe.
Definition: Universe.cpp:149
double getMaxY()
Returns the maximum reachable y-coordinate in the Universe.
Definition: Universe.cpp:188
Cell * getCell(int cell_id)
Returns a Cell in this universe.
Definition: Universe.cpp:354
int _uid
Definition: Universe.h:66
double minSurfaceDist(Point *point, double azim, double polar=M_PI/2.0)
Finds the distance to the nearest surface.
Definition: Universe.cpp:1835
void calculateBoundaries()
Calculates the boundary locations and conditions (VACUUM or REFLECTIVE) at the maximum and minimum re...
Definition: Universe.cpp:736
int getNumY() const
Return the number of Lattice cells along the y-axis.
Definition: Universe.cpp:1133
std::map< int, Universe * > getUniqueUniverses()
Aggregates a list (vector) of the IDs of all Universes within the FILL type Cells filling this Univer...
Definition: Universe.cpp:1328
std::map< int, Cell * > getCells() const
Return the container of Cell IDs and Cell pointers in this Universe.
Definition: Universe.cpp:368
A helper struct for the Universe::findCell() method.
Definition: Universe.h:288
std::map< int, Material * > getAllMaterials()
Returns the std::map of all IDs and Material pointers filling this Universe.
Definition: Universe.cpp:401
std::string toString()
Converts a Lattice's attributes to a character array representation.
Definition: Universe.cpp:2007
bool _fissionable
Definition: Universe.h:82
void removeUniverse(Universe *universe)
Removes all references to a Universe from the Lattice.
Definition: Universe.cpp:1650
std::map< int, Cell * > getAllCells()
Returns the std::map of Cell IDs and Cell pointers in this Universe at all nested Universe levels...
Definition: Universe.cpp:378
int getLatticeSurfaceOTF(int cell, double z, int surface_2D)
Finds the Lattice cell surface that a point lies on. If the point is not on a surface, -1 is returned.
Definition: Universe.cpp:2225
void subdivideCells(double max_radius=INFINITY)
Subdivides all of the Material-filled Cells within this Lattice into rings and angular sectors aligne...
Definition: Universe.cpp:1671
void setWidth(double width_x, double width_y, double width_z=std::numeric_limits< double >::infinity())
Set the width of each Lattice cell.
Definition: Universe.cpp:1463
The Material class represents a unique material and its relevant nuclear data (i.e., multigroup cross-sections) for neutron transport.
Definition: Material.h:51
Cell * findCell(LocalCoords *coords)
Finds the Cell for which a LocalCoords object resides.
Definition: Universe.cpp:544
const std::vector< double > & getAccumulateY() const
Return the accumulate widths of non-uniform Lattice in y direction.
Definition: Universe.cpp:1223
bool containsPoint(Point *point)
Determines whether a Point is contained inside a Universe.
Definition: Universe.cpp:1719
void buildNeighbors()
Builds collections of neighboring Cells for all Cells in each Universe in the Lattice for optimized r...
Definition: Universe.cpp:1699
virtual std::string toString()
Convert the member attributes of this Universe to a character array.
Definition: Universe.cpp:663
std::map< int, Cell * > getAllCells()
Returns the std::map of Cell IDs and Cell pointers in this Lattice at all nested Universe levels...
Definition: Universe.cpp:1383
bool containsPoint(Point *point)
Checks if a Point is within the bounds of a Lattice.
Definition: Universe.cpp:1737
double getMinY()
Returns the minimum reachable y-coordinate in the Universe.
Definition: Universe.cpp:175
void updateUniverse(int lat_x, int lat_y, int lat_z, Universe *universe)
Update the Universe in a particular Lattice cell.
Definition: Universe.cpp:1620
double getMinY()
Returns the minimum reachable y-coordinate in the Lattice.
Definition: Universe.cpp:1259
const std::vector< double > & getWidthsX() const
Return the widths of non-uniform Lattice in x direction.
Definition: Universe.cpp:1187
void setType(universeType type)
Sets the Universe type to SIMPLE or LATTICE.
Definition: Universe.cpp:484
int getNumX() const
Return the number of Lattice cells along the x-axis.
Definition: Universe.cpp:1124
Universe(const int id=-1, const char *name="")
Constructor assigns a unique and user-specified ID for the Universe.
Definition: Universe.cpp:58
void addCell(Cell *cell)
Adds a Cell to this Universe.
Definition: Universe.cpp:508
void setOffset(double x, double y, double z=0.0)
Set the offset in global coordinates for this Lattice.
Definition: Universe.cpp:1104
double getWidthZ() const
Return the width of the Lattice along the z-axis.
Definition: Universe.cpp:1169
int getNumZ() const
Return the number of Lattice cells along the z-axis.
Definition: Universe.cpp:1142
Lattice(const int id=-1, const char *name="")
Constructor sets the user-specified and unique IDs for this Lattice.
Definition: Universe.cpp:1059
boundaryType getMinXBoundaryType()
Returns the boundary conditions (VACUUM or REFLECTIVE) at the minimum reachable x-coordinate in the U...
Definition: Universe.cpp:228
bool _boundaries_inspected
Definition: Universe.h:93
Represents a repeating 3D Lattice of Universes.
Definition: Universe.h:156
universeType getType()
Return the Universe type (SIMPLE or LATTICE).
Definition: Universe.cpp:131
void setWidths(std::vector< double > widths_x, std::vector< double > widths_y, std::vector< double > widths_z)
Set widths of non-uniform meshes in x y z directions.
Definition: Universe.cpp:2324
virtual ~Lattice()
Destructor clears memory for all of Universes pointers.
Definition: Universe.cpp:1079
boundaryType getMaxZBoundaryType()
Returns the boundary conditions (VACUUM or REFLECTIVE) at the maximum reachable z-coordinate in the U...
Definition: Universe.cpp:333
static int _n
Definition: Universe.h:63
Definition: Universe.h:43
std::map< int, Universe * > getAllUniverses()
Returns the std::map of all nested Universe IDs and Universe pointers filling this Universe...
Definition: Universe.cpp:428
void subdivideCells(double max_radius=INFINITY)
Subdivides all of the Material-filled Cells within this Universe into rings and angular sectors align...
Definition: Universe.cpp:617
void setNumZ(int num_z)
Set the number of Lattice cells along the z-axis.
Definition: Universe.cpp:1452
universeType
The type of universe.
Definition: Universe.h:40
char * _name
Definition: Universe.h:72
void resetBoundaries()
Sets _boundaries_not_updated to true so boundaries will be recalculated if needed.
Definition: Universe.cpp:1049
std::map< int, double > getUniqueRadius(std::map< int, Universe *> unique_universes)
Get the maximum equivalent radius of each unique universes. Equivalent radius are computed as the dia...
Definition: Universe.cpp:1353
int getLatY(Point *point)
Finds the Lattice cell y index that a point lies in.
Definition: Universe.cpp:1932
std::vector< std::vector< std::vector< std::pair< int, Universe * > > > > * getUniverses()
Return a 3D vector of the Universes in the Lattice.
Definition: Universe.cpp:1316
void maximize_universe_id(int universe_id)
Maximize the auto-generated unique Universe ID counter.
Definition: Universe.cpp:47
Definition: Universe.h:46
double _min_x
Definition: Universe.h:85
bool isFissionable()
Returns true if the Universe contains a Cell filled by a fissionable Material and false otherwise...
Definition: Universe.cpp:456
std::map< int, Universe * > getAllUniverses()
Returns the std::map of all nested Universe IDs and Universe pointers filling this Lattice...
Definition: Universe.cpp:1405
boundaryType _min_x_bound
Definition: Universe.h:96