CSGCartesianLattice is the class for constructing regular Cartesian lattices of CSGUniverses. More...
#include <CSGCartesianLattice.h>
Public Member Functions | |
| CSGCartesianLattice (const std::string &name, const Real pitch, std::vector< std::vector< std::reference_wrapper< const CSGUniverse > > > universes, const std::optional< OuterVariant > &outer=std::nullopt) | |
| Construct a new CSGCartesianLattice object from the map of universes provided. | |
| CSGCartesianLattice (const std::string &name, const Real pitch, const std::optional< OuterVariant > &outer=std::nullopt) | |
| Construct a new empty CSGCartesianLattice object with specified pitch. | |
| virtual | ~CSGCartesianLattice ()=default |
| Destructor. | |
| std::unique_ptr< CSGLattice > | clone () const override |
| clone this Cartesian lattice | |
| virtual std::unordered_map< std::string, AttributeVariant > | getAttributes () const override |
| Get attributes that define the lattice (excluding the universe map). | |
| virtual bool | isValidIndex (const std::pair< int, int > index) const override |
| Checks if the given index location (row, column) is a valid index for the lattice. | |
| virtual bool | isValidUniverseMap (std::vector< std::vector< std::reference_wrapper< const CSGUniverse > > > universes) const override |
| check that any provided list of list of CSGUniverses are the correct dimensions. | |
| unsigned int | getNRows () const |
| get the number of rows | |
| unsigned int | getNCols () const |
| get number of columns | |
| Real | getPitch () const |
| get lattice pitch | |
| void | setPitch (Real pitch) |
| set the pitch of the lattice | |
| const std::string & | getName () const |
| Get the name of lattice. | |
| const std::string | getType () const |
| Get the lattice type. | |
| const std::string | getOuterType () const |
| Get the type of outer that fills the space around the lattice elements. | |
| const CSGUniverse & | getOuterUniverse () const |
| Get the outer universe if outer type is UNIVERSE. | |
| const std::string & | getOuterMaterial () const |
| Get the outer material name if outer fype is CSG_MATERIAL. | |
| std::vector< std::vector< std::reference_wrapper< const CSGUniverse > > > | getUniverses () const |
| Get the arrangement of CSGUniverses in the lattice. | |
| const std::vector< std::vector< std::string > > | getUniverseNameMap () const |
| Get the arrangement of CSGUniverses in the lattice as their names. | |
| bool | hasUniverse (const std::string &name) const |
| whether or not the universe of the specified name exists in the lattice | |
| const CSGUniverse & | getUniverseAtIndex (const std::pair< int, int > index) |
| Get the universe located at the given index. | |
| const std::vector< std::pair< unsigned int, unsigned int > > | getUniverseIndices (const std::string &univ_name) const |
| get all locations in lattice where universe of the specified name exists | |
| void | resetOuter () |
| reset the outer fill around the lattice elements to be VOID | |
| const std::vector< std::reference_wrapper< const CSGUniverse > > | getUniqueUniverses () const |
| Get the list of unique universe objects in the lattice. | |
| bool | operator== (const CSGLattice &other) const |
| Operator overload for checking if two CSGLattice objects are equal. | |
| bool | operator!= (const CSGLattice &other) const |
| Operator overload for checking if two CSGLattice objects are not equal. | |
| const std::vector< std::pair< TransformationType, std::tuple< Real, Real, Real > > > & | getTransformations () const |
| Get the list of transformations. | |
| std::vector< std::pair< std::string, std::tuple< Real, Real, Real > > > | getTransformationsAsStrings () const |
| Get the transformations of this object with string representations for types. | |
Static Public Member Functions | |
| static bool | isValidTransformationValue (TransformationType type, const std::tuple< Real, Real, Real > &values) |
| Check if the transformation value is valid for the given type. | |
| static std::string | getTransformationTypeString (TransformationType type) |
| Get the string representation of the transformation type. | |
Protected Member Functions | |
| virtual bool | compareAttributes (const CSGLattice &other) const override |
| compare the attributes returned in getAttributes of this lattice to another lattice | |
| virtual void | setUniverses (std::vector< std::vector< std::reference_wrapper< const CSGUniverse > > > universes) override |
| set the universes that define the lattice layout | |
| void | setName (const std::string &name) |
| void | setUniverseAtIndex (const CSGUniverse &universe, const std::pair< int, int > index) |
| replace the element at specified index in the lattice with the provided CSGUniverse. | |
| void | updateOuter (const std::string &outer_name) |
| Update the outer of the lattice to be the provided material name. | |
| void | updateOuter (const CSGUniverse &outer_universe) |
| Update the outer of the lattice to be the provided universe. | |
| void | addTransformation (TransformationType type, const std::tuple< Real, Real, Real > &values) |
| Add a transformation to the list of transformations. | |
| Point | applyReverseTransformsToPoint (Point p) const |
| update the value of point p by applying the inverse of the list of transformations to the point | |
| FRIEND_TEST (CSGLatticeTest, testCartSetUniverses) | |
| Friends for unit testing. | |
| FRIEND_TEST (CSGLatticeTest, testCartSetUniverseAtIndex) | |
| FRIEND_TEST (CSGLatticeTest, testEmptyToFilled) | |
| FRIEND_TEST (CSGLatticeTest, testCartLatticeEquality) | |
| FRIEND_TEST (CSGLatticeTest, testSetName) | |
| Friends for unit testing. | |
| FRIEND_TEST (CSGLatticeTest, testUpdateOuter) | |
| FRIEND_TEST (CSGBaseTest, testAddLattice) | |
| FRIEND_TEST (CSGSurfaceTest, testHalfspaceWithTransform) | |
| Friends for unit testing. | |
| FRIEND_TEST (CSGSurfaceTest, testHalfspaceWithNullTransform) | |
| FRIEND_TEST (CSGEngUnitTest, testEngUnitEqual) | |
Protected Attributes | |
| Real | _pitch |
| pitch | |
| unsigned int | _nrow |
| number of elements in the first dimension (rows) | |
| unsigned int | _ncol |
| number of elements in the second direction (columns) | |
| std::string | _name |
| Name of lattice. | |
| std::vector< std::vector< std::reference_wrapper< const CSGUniverse > > > | _universe_map |
| Universes in the arrangement of how they appear in the lattice; dimensions depends on lattice type. | |
| std::string | _outer_type |
| An enum for type of outer fill for lattice. | |
| std::string | _outer_material |
| name of the outer material | |
| const CSGUniverse * | _outer_universe |
| outer object if fill is CSGUniverse | |
| std::vector< std::pair< TransformationType, std::tuple< Real, Real, Real > > > | _transformations |
| List of transformations applied to this object. | |
Friends | |
| class | CSGBase |
CSGCartesianLattice is the class for constructing regular Cartesian lattices of CSGUniverses.
Definition at line 24 of file CSGCartesianLattice.h.
| CSG::CSGCartesianLattice::CSGCartesianLattice | ( | const std::string & | name, |
| const Real | pitch, | ||
| std::vector< std::vector< std::reference_wrapper< const CSGUniverse > > > | universes, | ||
| const std::optional< OuterVariant > & | outer = std::nullopt |
||
| ) |
Construct a new CSGCartesianLattice object from the map of universes provided.
| name | unique identifying name of lattice |
| pitch | pitch of lattice elements |
| universes | list of list of universes to set as the lattice map |
| outer | optional outer universe or material name that fills space around lattice elements. If not provided, outer is assumed to be VOID. |
Definition at line 15 of file CSGCartesianLattice.C.
| CSG::CSGCartesianLattice::CSGCartesianLattice | ( | const std::string & | name, |
| const Real | pitch, | ||
| const std::optional< OuterVariant > & | outer = std::nullopt |
||
| ) |
Construct a new empty CSGCartesianLattice object with specified pitch.
NOTE: must call setLatticeUniverses to populate the universe map.
| name | unique identifying name of lattice |
| pitch | pitch of lattice elements |
| outer | optional outer universe or material name that fills space around lattice elements. If not provided, outer is assumed to be VOID. |
Definition at line 27 of file CSGCartesianLattice.C.
|
virtualdefault |
Destructor.
|
protectedinherited |
Add a transformation to the list of transformations.
| type | The type of transformation |
| values | The values for the transformation |
Definition at line 16 of file CSGTransformationHelper.C.
Referenced by CSG::CSGBase::addTransformation(), CSG::CSGBase::expandEngUnit(), CSG::CSGBase::expandEngUnit(), and CSG::CSGBase::expandEngUnit().
|
protectedinherited |
update the value of point p by applying the inverse of the list of transformations to the point
| p | point to transform |
Definition at line 74 of file CSGTransformationHelper.C.
Referenced by CSG::CSGSurface::getHalfspaceFromPoint().
|
inlineoverridevirtual |
clone this Cartesian lattice
Implements CSG::CSGLattice.
Definition at line 64 of file CSGCartesianLattice.h.
|
overrideprotectedvirtual |
compare the attributes returned in getAttributes of this lattice to another lattice
Implements CSG::CSGLattice.
Definition at line 93 of file CSGCartesianLattice.C.
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protected |
|
protected |
Friends for unit testing.
|
protected |
|
protectedinherited |
Friends for unit testing.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
Friends for unit testing.
|
overridevirtual |
Get attributes that define the lattice (excluding the universe map).
Implements CSG::CSGLattice.
Definition at line 45 of file CSGCartesianLattice.C.
Referenced by compareAttributes().
|
inlineinherited |
Get the name of lattice.
Definition at line 60 of file CSGLattice.h.
Referenced by CSG::CSGLatticeList::addLattice(), CSG::CSGBase::addLatticeToList(), CSG::CSGBase::addTransformation(), CSG::CSGBase::checkLatticeInBase(), CSGCartesianLattice(), CSGCartesianLattice(), CSG::CSGHexagonalLattice::CSGHexagonalLattice(), CSG::CSGHexagonalLattice::CSGHexagonalLattice(), CSG::CSGBase::deleteLattice(), CSG::CSGCell::getFillName(), CSG::CSGLattice::getOuterMaterial(), CSG::CSGLattice::getOuterUniverse(), CSG::CSGHexagonalLattice::getRingIndexFromRowIndex(), CSG::CSGHexagonalLattice::getRowIndexFromRingIndex(), CSG::CSGLattice::getUniverseAtIndex(), CSG::CSGLattice::getUniverseIndices(), CSG::CSGLattice::operator==(), CSG::CSGLatticeList::renameLattice(), CSG::CSGBase::resetLatticeOuter(), CSG::CSGBase::setLatticeOuter(), CSG::CSGBase::setLatticeOuter(), CSG::CSGBase::setLatticeUniverses(), setPitch(), CSG::CSGHexagonalLattice::setPitch(), CSG::CSGLattice::setUniverseAtIndex(), CSG::CSGBase::setUniverseAtLatticeIndex(), setUniverses(), CSG::CSGHexagonalLattice::setUniverses(), and CSG::CSGBase::updateCellFill().
|
inline |
get number of columns
Definition at line 110 of file CSGCartesianLattice.h.
|
inline |
|
inherited |
Get the outer material name if outer fype is CSG_MATERIAL.
Definition at line 118 of file CSGLattice.C.
Referenced by CSG::CSGLattice::operator==().
|
inlineinherited |
Get the type of outer that fills the space around the lattice elements.
Definition at line 77 of file CSGLattice.h.
Referenced by CSG::CSGBase::addLatticeToList(), CSG::CSGLattice::getOuterMaterial(), CSG::CSGLattice::getOuterUniverse(), CSG::CSGLattice::operator==(), and CSG::CSGBase::replaceUniverseRefs().
|
inherited |
Get the outer universe if outer type is UNIVERSE.
Definition at line 109 of file CSGLattice.C.
Referenced by CSG::CSGBase::addLatticeToList(), CSG::CSGLattice::operator==(), and CSG::CSGBase::replaceUniverseRefs().
|
inline |
|
inlineinherited |
Get the list of transformations.
Definition at line 51 of file CSGTransformationHelper.h.
Referenced by CSG::CSGSurface::getHalfspaceFromPoint(), CSG::CSGCellEngUnit::getTransformations(), CSG::CSGSurfaceEngUnit::getTransformations(), CSG::CSGUniverseEngUnit::getTransformations(), CSG::CSGCell::operator==(), CSG::CSGLattice::operator==(), CSG::CSGSurface::operator==(), and CSG::CSGUniverse::operator==().
|
inherited |
Get the transformations of this object with string representations for types.
Definition at line 65 of file CSGTransformationHelper.C.
Referenced by CSG::CSGCellEngUnit::getTransformationsAsStrings(), CSG::CSGSurfaceEngUnit::getTransformationsAsStrings(), and CSG::CSGUniverseEngUnit::getTransformationsAsStrings().
|
staticinherited |
Get the string representation of the transformation type.
| type | The transformation type |
Definition at line 56 of file CSGTransformationHelper.C.
Referenced by CSG::CSGTransformationHelper::addTransformation(), and CSG::CSGTransformationHelper::getTransformationsAsStrings().
|
inlineinherited |
Get the lattice type.
Definition at line 67 of file CSGLattice.h.
Referenced by compareAttributes(), CSG::CSGHexagonalLattice::compareAttributes(), CSG::CSGLattice::operator==(), setUniverses(), and CSG::CSGHexagonalLattice::setUniverses().
|
inherited |
Get the list of unique universe objects in the lattice.
Definition at line 91 of file CSGLattice.C.
|
inherited |
Get the universe located at the given index.
| index | pair of ints that specify the location in lattice |
Definition at line 64 of file CSGLattice.C.
|
inherited |
get all locations in lattice where universe of the specified name exists
| univ_name | name of universe |
Definition at line 74 of file CSGLattice.C.
|
inherited |
Get the arrangement of CSGUniverses in the lattice as their names.
Definition at line 50 of file CSGLattice.C.
|
inlineinherited |
Get the arrangement of CSGUniverses in the lattice.
Definition at line 98 of file CSGLattice.h.
Referenced by CSG::CSGBase::addLatticeToList(), CSG::CSGBase::createCell(), CSG::CSGLattice::getUniqueUniverses(), CSG::CSGLattice::operator==(), and CSG::CSGBase::replaceUniverseRefs().
|
inherited |
whether or not the universe of the specified name exists in the lattice
| name | of universe to search for |
Definition at line 40 of file CSGLattice.C.
Referenced by CSG::CSGLattice::getUniverseIndices().
|
overridevirtual |
Checks if the given index location (row, column) is a valid index for the lattice.
Allowable indices are: 0 <= row < _nrow and 0 <= column < _ncol.
| index | location in (row, column) form |
Implements CSG::CSGLattice.
Definition at line 85 of file CSGCartesianLattice.C.
|
staticinherited |
Check if the transformation value is valid for the given type.
| type | The type of transformation |
| values | The values for the transformation |
Definition at line 26 of file CSGTransformationHelper.C.
Referenced by CSG::CSGTransformationHelper::addTransformation().
|
overridevirtual |
check that any provided list of list of CSGUniverses are the correct dimensions.
Must have number of lists within universes equal to _nrow. And each sublist must be size _ncol.
| universes | list of list of universes to be used to define the lattice structure |
Implements CSG::CSGLattice.
Definition at line 53 of file CSGCartesianLattice.C.
Referenced by setUniverses().
|
inherited |
Operator overload for checking if two CSGLattice objects are not equal.
Definition at line 187 of file CSGLattice.C.
|
inherited |
Operator overload for checking if two CSGLattice objects are equal.
Definition at line 151 of file CSGLattice.C.
|
inherited |
reset the outer fill around the lattice elements to be VOID
Definition at line 143 of file CSGLattice.C.
Referenced by CSG::CSGBase::resetLatticeOuter().
|
inlineprotectedinherited |
Definition at line 184 of file CSGLattice.h.
| void CSG::CSGCartesianLattice::setPitch | ( | Real | pitch | ) |
set the pitch of the lattice
| pitch | new pitch value |
Definition at line 37 of file CSGCartesianLattice.C.
|
protectedinherited |
replace the element at specified index in the lattice with the provided CSGUniverse.
This will check that the _universe_map has been initialized and that the index is valid.
| universe | universe to add to the lattice at the location index |
| index | location in lattice replace with provided universe |
Definition at line 28 of file CSGLattice.C.
Referenced by CSG::CSGBase::setUniverseAtLatticeIndex().
|
overrideprotectedvirtual |
set the universes that define the lattice layout
| universes | list of list of universes to set as the lattice map |
Implements CSG::CSGLattice.
Definition at line 71 of file CSGCartesianLattice.C.
Referenced by CSGCartesianLattice().
|
protectedinherited |
Update the outer of the lattice to be the provided universe.
This will change outer type to UNIVERSE even if it was a different type previously.
| outer_universe | pointer to outer universe that will fill space around lattice elements |
Definition at line 127 of file CSGLattice.C.
|
protectedinherited |
Update the outer of the lattice to be the provided material name.
This will change outer type to CSG_MATERIAL even if it was a different type previously.
| outer_name | name of CSG material that will fill space around lattice elements |
Definition at line 135 of file CSGLattice.C.
Referenced by CSG::CSGLattice::CSGLattice(), CSG::CSGBase::setLatticeOuter(), and CSG::CSGBase::setLatticeOuter().
|
friend |
Definition at line 147 of file CSGCartesianLattice.h.
|
protectedinherited |
Name of lattice.
Definition at line 220 of file CSGLattice.h.
Referenced by CSG::CSGLattice::getName(), and CSG::CSGLattice::setName().
|
protected |
number of elements in the second direction (columns)
Definition at line 145 of file CSGCartesianLattice.h.
Referenced by getAttributes(), getNCols(), isValidIndex(), and setUniverses().
|
protected |
number of elements in the first dimension (rows)
Definition at line 142 of file CSGCartesianLattice.h.
Referenced by getAttributes(), getNRows(), isValidIndex(), and setUniverses().
|
mutableprotectedinherited |
name of the outer material
Definition at line 229 of file CSGLattice.h.
Referenced by CSG::CSGLattice::getOuterMaterial(), CSG::CSGLattice::resetOuter(), CSG::CSGLattice::updateOuter(), and CSG::CSGLattice::updateOuter().
|
mutableprotectedinherited |
An enum for type of outer fill for lattice.
Definition at line 226 of file CSGLattice.h.
Referenced by CSG::CSGLattice::getOuterType(), CSG::CSGLattice::resetOuter(), CSG::CSGLattice::updateOuter(), and CSG::CSGLattice::updateOuter().
|
protectedinherited |
outer object if fill is CSGUniverse
Definition at line 232 of file CSGLattice.h.
Referenced by CSG::CSGLattice::getOuterUniverse(), CSG::CSGLattice::resetOuter(), CSG::CSGLattice::updateOuter(), and CSG::CSGLattice::updateOuter().
|
protected |
pitch
Definition at line 139 of file CSGCartesianLattice.h.
Referenced by CSGCartesianLattice(), CSGCartesianLattice(), getAttributes(), getPitch(), and setPitch().
|
protectedinherited |
List of transformations applied to this object.
Definition at line 96 of file CSGTransformationHelper.h.
Referenced by CSG::CSGTransformationHelper::addTransformation(), CSG::CSGTransformationHelper::applyReverseTransformsToPoint(), CSG::CSGTransformationHelper::getTransformations(), and CSG::CSGTransformationHelper::getTransformationsAsStrings().
|
protectedinherited |
Universes in the arrangement of how they appear in the lattice; dimensions depends on lattice type.
Definition at line 223 of file CSGLattice.h.
Referenced by CSG::CSGLattice::getUniverseAtIndex(), CSG::CSGLattice::getUniverseIndices(), CSG::CSGLattice::getUniverseNameMap(), CSG::CSGLattice::getUniverses(), CSG::CSGLattice::hasUniverse(), CSG::CSGLattice::setUniverseAtIndex(), setUniverses(), and CSG::CSGHexagonalLattice::setUniverses().