CSGLattice is the abstract class for defining lattices. More...
#include <CSGLattice.h>
Public Member Functions | |
| CSGLattice (const std::string &name, const std::string &lattice_type, const std::optional< OuterVariant > &outer=std::nullopt) | |
| Construct a new CSGLattice of specific type. More... | |
| virtual | ~CSGLattice ()=default |
| Destructor. More... | |
| virtual std::unique_ptr< CSGLattice > | clone () const =0 |
| 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... | |
| virtual std::unordered_map< std::string, AttributeVariant > | getAttributes () const =0 |
| Get attributes that define the lattice (excluding the universe map). More... | |
| virtual bool | isValidIndex (const std::pair< int, int > index) const =0 |
| Checks if the given index location is a valid index for 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... | |
| virtual bool | isValidUniverseMap (std::vector< std::vector< std::reference_wrapper< const CSGUniverse >>> universes) const =0 |
| check that any provided list of list of CSGUniverses are the correct dimensions for the type of lattice 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 | |
| void | setName (const std::string &name) |
| virtual void | setUniverses (std::vector< std::vector< std::reference_wrapper< const CSGUniverse >>> universes)=0 |
| assign the vectors of universes as the lattice elements More... | |
| 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... | |
| virtual bool | compareAttributes (const CSGLattice &other) const =0 |
| helper function to compare the attributes of the lattice type 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, testSetName) | |
| Friends for unit testing. More... | |
| FRIEND_TEST (CSGLatticeTest, testUpdateOuter) | |
| FRIEND_TEST (CSGBaseTest, testAddLattice) | |
| FRIEND_TEST (CSGLatticeTest, testCartLatticeEquality) | |
| FRIEND_TEST (CSGSurfaceTest, testHalfspaceWithTransform) | |
| Friends for unit testing. More... | |
| FRIEND_TEST (CSGSurfaceTest, testHalfspaceWithNullTransform) | |
Protected Attributes | |
| 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 | CSGLatticeList |
| class | CSGBase |
CSGLattice is the abstract class for defining lattices.
Definition at line 34 of file CSGLattice.h.
| CSG::CSGLattice::CSGLattice | ( | const std::string & | name, |
| const std::string & | lattice_type, | ||
| const std::optional< OuterVariant > & | outer = std::nullopt |
||
| ) |
Construct a new CSGLattice of specific type.
| name | unique name of lattice |
| lattice_type | type of lattice |
| 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 16 of file CSGLattice.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().
|
pure virtual |
Implemented in CSG::CSGHexagonalLattice, and CSG::CSGCartesianLattice.
Referenced by CSG::CSGBase::addLatticeToList().
|
protectedpure virtual |
helper function to compare the attributes of the lattice type
Implemented in CSG::CSGHexagonalLattice, and CSG::CSGCartesianLattice.
Referenced by operator==().
|
protectedinherited |
Friends for unit testing.
|
protectedinherited |
|
protected |
Friends for unit testing.
|
protected |
|
protected |
|
protected |
|
pure virtual |
Get attributes that define the lattice (excluding the universe map).
Implemented in CSG::CSGHexagonalLattice, and CSG::CSGCartesianLattice.
Referenced by CSG::CSGCartesianLattice::compareAttributes(), and CSG::CSGHexagonalLattice::compareAttributes().
|
inline |
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(), CSG::CSGCartesianLattice::CSGCartesianLattice(), CSG::CSGHexagonalLattice::CSGHexagonalLattice(), CSG::CSGBase::deleteLattice(), CSG::CSGCell::getFillName(), getOuterMaterial(), getOuterUniverse(), CSG::CSGHexagonalLattice::getRingIndexFromRowIndex(), CSG::CSGHexagonalLattice::getRowIndexFromRingIndex(), getUniverseAtIndex(), getUniverseIndices(), operator==(), CSG::CSGLatticeList::renameLattice(), CSG::CSGBase::resetLatticeOuter(), CSG::CSGBase::setLatticeOuter(), CSG::CSGBase::setLatticeUniverses(), CSG::CSGCartesianLattice::setPitch(), CSG::CSGHexagonalLattice::setPitch(), setUniverseAtIndex(), CSG::CSGBase::setUniverseAtLatticeIndex(), CSG::CSGCartesianLattice::setUniverses(), CSG::CSGHexagonalLattice::setUniverses(), and CSG::CSGBase::updateCellFill().
| const std::string & CSG::CSGLattice::getOuterMaterial | ( | ) | const |
Get the outer material name if outer fype is CSG_MATERIAL.
Definition at line 120 of file CSGLattice.C.
Referenced by operator==().
|
inline |
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(), getOuterMaterial(), getOuterUniverse(), and operator==().
| const CSGUniverse & CSG::CSGLattice::getOuterUniverse | ( | ) | const |
Get the outer universe if outer type is UNIVERSE.
Definition at line 111 of file CSGLattice.C.
Referenced by CSG::CSGBase::addLatticeToList(), and operator==().
|
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 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().
|
inline |
Get the lattice type.
Definition at line 69 of file CSGLattice.h.
Referenced by CSG::CSGCartesianLattice::compareAttributes(), CSG::CSGHexagonalLattice::compareAttributes(), operator==(), CSG::CSGCartesianLattice::setUniverses(), and CSG::CSGHexagonalLattice::setUniverses().
| const std::vector< std::reference_wrapper< const CSGUniverse > > CSG::CSGLattice::getUniqueUniverses | ( | ) | const |
Get the list of unique universe objects in the lattice.
Definition at line 93 of file CSGLattice.C.
| const CSGUniverse & CSG::CSGLattice::getUniverseAtIndex | ( | const std::pair< int, int > | index | ) |
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.
| const std::vector< std::pair< unsigned int, unsigned int > > CSG::CSGLattice::getUniverseIndices | ( | const std::string & | univ_name | ) | const |
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.
| const std::vector< std::vector< std::string > > CSG::CSGLattice::getUniverseNameMap | ( | ) | const |
Get the arrangement of CSGUniverses in the lattice as their names.
Definition at line 52 of file CSGLattice.C.
|
inline |
Get the arrangement of CSGUniverses in the lattice.
Definition at line 97 of file CSGLattice.h.
Referenced by CSG::CSGBase::addLatticeToList(), CSG::CSGBase::createCell(), getUniqueUniverses(), and operator==().
| bool CSG::CSGLattice::hasUniverse | ( | const std::string & | name | ) | const |
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 getUniverseIndices().
Checks if the given index location is a valid index for the lattice.
| index | location |
Implemented in CSG::CSGCartesianLattice, and CSG::CSGHexagonalLattice.
Referenced by getUniverseAtIndex(), and setUniverseAtIndex().
|
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().
|
pure virtual |
check that any provided list of list of CSGUniverses are the correct dimensions for the type of lattice
| universes | list of list of universes to be used to define the lattice structure |
Implemented in CSG::CSGHexagonalLattice, and CSG::CSGCartesianLattice.
| bool CSG::CSGLattice::operator!= | ( | const CSGLattice & | other | ) | const |
Operator overload for checking if two CSGLattice objects are not equal.
Definition at line 189 of file CSGLattice.C.
| bool CSG::CSGLattice::operator== | ( | const CSGLattice & | other | ) | const |
Operator overload for checking if two CSGLattice objects are equal.
Definition at line 153 of file CSGLattice.C.
| void CSG::CSGLattice::resetOuter | ( | ) |
reset the outer fill around the lattice elements to be VOID
Definition at line 145 of file CSGLattice.C.
Referenced by CSG::CSGBase::resetLatticeOuter().
|
inlineprotected |
Definition at line 183 of file CSGLattice.h.
|
protected |
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().
|
protectedpure virtual |
assign the vectors of universes as the lattice elements
| universes | vector of vectors of universes to be set as lattice elements, ordering depends on derived class |
Implemented in CSG::CSGHexagonalLattice, and CSG::CSGCartesianLattice.
Referenced by CSG::CSGBase::setLatticeUniverses().
|
protected |
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 CSGLattice(), and CSG::CSGBase::setLatticeOuter().
|
protected |
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 239 of file CSGLattice.h.
|
friend |
Definition at line 237 of file CSGLattice.h.
|
protected |
|
protected |
Name of lattice.
Definition at line 219 of file CSGLattice.h.
|
mutableprotected |
name of the outer material
Definition at line 231 of file CSGLattice.h.
Referenced by getOuterMaterial(), resetOuter(), and updateOuter().
|
mutableprotected |
An enum for type of outer fill for lattice.
Definition at line 228 of file CSGLattice.h.
Referenced by getOuterType(), resetOuter(), and updateOuter().
|
protected |
outer object if fill is CSGUniverse
Definition at line 234 of file CSGLattice.h.
Referenced by getOuterUniverse(), resetOuter(), and updateOuter().
|
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().
|
protected |
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 getUniverseAtIndex(), getUniverseIndices(), getUniverseNameMap(), getUniverses(), hasUniverse(), setUniverseAtIndex(), CSG::CSGCartesianLattice::setUniverses(), and CSG::CSGHexagonalLattice::setUniverses().
1.8.14