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. More... | |
| CSGCartesianLattice (const std::string &name, const Real pitch, const std::optional< OuterVariant > &outer=std::nullopt) | |
| Construct a new empty CSGCartesianLattice object with specified pitch. More... | |
| virtual | ~CSGCartesianLattice ()=default |
| Destructor. More... | |
| std::unique_ptr< CSGLattice > | clone () const override |
| clone this Cartesian lattice More... | |
| virtual std::unordered_map< std::string, AttributeVariant > | getAttributes () const override |
| Get attributes that define the lattice (excluding the universe map). More... | |
| 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. More... | |
| 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. More... | |
| unsigned int | getNRows () const |
| get the number of rows More... | |
| unsigned int | getNCols () const |
| get number of columns More... | |
| Real | getPitch () const |
| get lattice pitch More... | |
| void | setPitch (Real pitch) |
| set the pitch of the lattice More... | |
| const std::string & | getName () const |
| Get the name of lattice. More... | |
| const std::string & | getType () const |
| Get the lattice type. More... | |
| const std::string | getOuterType () const |
| Get the type of outer that fills the space around the lattice elements. More... | |
| const CSGUniverse & | getOuterUniverse () const |
| Get the outer universe if outer type is UNIVERSE. More... | |
| const std::string & | getOuterMaterial () const |
| Get the outer material name if outer fype is CSG_MATERIAL. More... | |
| std::vector< std::vector< std::reference_wrapper< const CSGUniverse > > > | getUniverses () const |
| Get the arrangement of CSGUniverses in the lattice. More... | |
| const std::vector< std::vector< std::string > > | getUniverseNameMap () const |
| Get the arrangement of CSGUniverses in the lattice as their names. More... | |
| bool | hasUniverse (const std::string &name) const |
| whether or not the universe of the specified name exists in the lattice More... | |
| const CSGUniverse & | getUniverseAtIndex (const std::pair< int, int > index) |
| Get the universe located at the given index. More... | |
| 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 More... | |
| void | resetOuter () |
| reset the outer fill around the lattice elements to be VOID More... | |
| const std::vector< std::reference_wrapper< const CSGUniverse > > | getUniqueUniverses () const |
| Get the list of unique universe objects in the lattice. More... | |
| bool | operator== (const CSGLattice &other) const |
| Operator overload for checking if two CSGLattice objects are equal. More... | |
| bool | operator!= (const CSGLattice &other) const |
| Operator overload for checking if two CSGLattice objects are not equal. More... | |
| const std::vector< std::pair< TransformationType, std::tuple< Real, Real, Real > > > & | getTransformations () const |
| Get the list of transformations. More... | |
| std::vector< std::pair< std::string, std::tuple< Real, Real, Real > > > | getTransformationsAsStrings () const |
| Get the transformations of this object with string representations for types. More... | |
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. More... | |
| static std::string | getTransformationTypeString (TransformationType type) |
| Get the string representation of the transformation type. More... | |
Protected Member Functions | |
| virtual bool | compareAttributes (const CSGLattice &other) const override |
| compare the attributes returned in getAttributes of this lattice to another lattice More... | |
| virtual void | setUniverses (std::vector< std::vector< std::reference_wrapper< const CSGUniverse >>> universes) override |
| set the universes that define the lattice layout More... | |
| 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. More... | |
| void | updateOuter (const std::string &outer_name) |
| Update the outer of the lattice to be the provided material name. More... | |
| void | updateOuter (const CSGUniverse &outer_universe) |
| Update the outer of the lattice to be the provided universe. More... | |
| void | addTransformation (TransformationType type, const std::tuple< Real, Real, Real > &values) |
| Add a transformation to the list of transformations. More... | |
| Point | applyReverseTransformsToPoint (Point p) const |
| update the value of point p by applying the inverse of the list of transformations to the point More... | |
| FRIEND_TEST (CSGLatticeTest, testCartSetUniverses) | |
| Friends for unit testing. More... | |
| FRIEND_TEST (CSGLatticeTest, testCartSetUniverseAtIndex) | |
| FRIEND_TEST (CSGLatticeTest, testEmptyToFilled) | |
| FRIEND_TEST (CSGLatticeTest, testCartLatticeEquality) | |
| FRIEND_TEST (CSGLatticeTest, testSetName) | |
| Friends for unit testing. More... | |
| FRIEND_TEST (CSGLatticeTest, testUpdateOuter) | |
| FRIEND_TEST (CSGBaseTest, testAddLattice) | |
| FRIEND_TEST (CSGSurfaceTest, testHalfspaceWithTransform) | |
| Friends for unit testing. More... | |
| FRIEND_TEST (CSGSurfaceTest, testHalfspaceWithNullTransform) | |
Protected Attributes | |
| Real | _pitch |
| pitch More... | |
| unsigned int | _nrow |
| number of elements in the first dimension (rows) More... | |
| unsigned int | _ncol |
| number of elements in the second direction (columns) More... | |
| std::string | _name |
| Name of lattice. More... | |
| const std::string | _lattice_type |
| Type of lattice. More... | |
| 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. More... | |
| std::string | _outer_type |
| An enum for type of outer fill for lattice. More... | |
| std::string | _outer_material |
| name of the outer material More... | |
| const CSGUniverse * | _outer_universe |
| outer object if fill is CSGUniverse More... | |
| std::vector< std::pair< TransformationType, std::tuple< Real, Real, Real > > > | _transformations |
| List of transformations applied to this object. More... | |
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.
|
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 96 of file CSGCartesianLattice.C.
|
protectedinherited |
Friends for unit testing.
|
protectedinherited |
|
protected |
Friends for unit testing.
|
protected |
|
protected |
|
protected |
|
protectedinherited |
Friends for unit testing.
|
protectedinherited |
|
protectedinherited |
|
overridevirtual |
Get attributes that define the lattice (excluding the universe map).
Implements CSG::CSGLattice.
Definition at line 48 of file CSGCartesianLattice.C.
Referenced by compareAttributes().
|
inlineinherited |
Get the name of lattice.
Definition at line 62 of file CSGLattice.h.
Referenced by CSG::CSGLatticeList::addLattice(), CSG::CSGBase::addLatticeToList(), CSG::CSGBase::addTransformation(), CSG::CSGBase::checkLatticeInBase(), CSGCartesianLattice(), 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::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 |
get the number of rows
Definition at line 103 of file CSGCartesianLattice.h.
|
inherited |
Get the outer material name if outer fype is CSG_MATERIAL.
Definition at line 120 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 76 of file CSGLattice.h.
Referenced by CSG::CSGBase::addLatticeToList(), CSG::CSGLattice::getOuterMaterial(), CSG::CSGLattice::getOuterUniverse(), and CSG::CSGLattice::operator==().
|
inherited |
Get the outer universe if outer type is UNIVERSE.
Definition at line 111 of file CSGLattice.C.
Referenced by CSG::CSGBase::addLatticeToList(), and CSG::CSGLattice::operator==().
|
inline |
|
inlineinherited |
Get the list of transformations.
Definition at line 47 of file CSGTransformationHelper.h.
Referenced by CSG::CSGSurface::getHalfspaceFromPoint(), CSG::CSGUniverse::operator==(), CSG::CSGSurface::operator==(), CSG::CSGCell::operator==(), and CSG::CSGLattice::operator==().
|
inherited |
Get the transformations of this object with string representations for types.
Definition at line 65 of file CSGTransformationHelper.C.
|
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 69 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 93 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 66 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 76 of file CSGLattice.C.
|
inherited |
Get the arrangement of CSGUniverses in the lattice as their names.
Definition at line 52 of file CSGLattice.C.
|
inlineinherited |
Get the arrangement of CSGUniverses in the lattice.
Definition at line 97 of file CSGLattice.h.
Referenced by CSG::CSGBase::addLatticeToList(), CSG::CSGBase::createCell(), CSG::CSGLattice::getUniqueUniverses(), and CSG::CSGLattice::operator==().
|
inherited |
whether or not the universe of the specified name exists in the lattice
| name | of universe to search for |
Definition at line 42 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 88 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 56 of file CSGCartesianLattice.C.
Referenced by setUniverses().
|
inherited |
Operator overload for checking if two CSGLattice objects are not equal.
Definition at line 189 of file CSGLattice.C.
|
inherited |
Operator overload for checking if two CSGLattice objects are equal.
Definition at line 153 of file CSGLattice.C.
|
inherited |
reset the outer fill around the lattice elements to be VOID
Definition at line 145 of file CSGLattice.C.
Referenced by CSG::CSGBase::resetLatticeOuter().
|
inlineprotectedinherited |
Definition at line 183 of file CSGLattice.h.
set the pitch of the lattice
| pitch | new pitch value |
Definition at line 40 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 30 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 74 of file CSGCartesianLattice.C.
Referenced by CSGCartesianLattice().
|
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 137 of file CSGLattice.C.
Referenced by CSG::CSGLattice::CSGLattice(), and CSG::CSGBase::setLatticeOuter().
|
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 129 of file CSGLattice.C.
|
friend |
Definition at line 147 of file CSGCartesianLattice.h.
|
protectedinherited |
Type of lattice.
Definition at line 222 of file CSGLattice.h.
Referenced by CSG::CSGLattice::getType().
|
protectedinherited |
Name of lattice.
Definition at line 219 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 231 of file CSGLattice.h.
Referenced by CSG::CSGLattice::getOuterMaterial(), CSG::CSGLattice::resetOuter(), and CSG::CSGLattice::updateOuter().
|
mutableprotectedinherited |
An enum for type of outer fill for lattice.
Definition at line 228 of file CSGLattice.h.
Referenced by CSG::CSGLattice::getOuterType(), CSG::CSGLattice::resetOuter(), and CSG::CSGLattice::updateOuter().
|
protectedinherited |
outer object if fill is CSGUniverse
Definition at line 234 of file CSGLattice.h.
Referenced by CSG::CSGLattice::getOuterUniverse(), CSG::CSGLattice::resetOuter(), and CSG::CSGLattice::updateOuter().
|
protected |
pitch
Definition at line 139 of file CSGCartesianLattice.h.
Referenced by CSGCartesianLattice(), getAttributes(), getPitch(), and setPitch().
|
protectedinherited |
List of transformations applied to this object.
Definition at line 92 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 225 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().
1.8.14