18 #ifdef MOOSE_UNIT_TEST 19 #include "gtest/gtest.h" 29 typedef std::variant<std::reference_wrapper<const CSGUniverse>, std::string>
OuterVariant;
46 const std::string & lattice_type,
47 const std::optional<OuterVariant> & outer = std::nullopt);
55 virtual std::unique_ptr<CSGLattice>
clone()
const = 0;
97 std::vector<std::vector<std::reference_wrapper<const CSGUniverse>>>
getUniverses()
const 123 virtual std::unordered_map<std::string, AttributeVariant>
132 virtual bool isValidIndex(
const std::pair<int, int> index)
const = 0;
148 const std::vector<std::pair<unsigned int, unsigned int>>
159 isValidUniverseMap(std::vector<std::vector<std::reference_wrapper<const CSGUniverse>>> universes)
172 const std::vector<std::reference_wrapper<const CSGUniverse>>
getUniqueUniverses()
const;
188 setUniverses(std::vector<std::vector<std::reference_wrapper<const CSGUniverse>>> universes) = 0;
225 std::vector<std::vector<std::reference_wrapper<const CSGUniverse>>>
_universe_map;
241 #ifdef MOOSE_UNIT_TEST 247 FRIEND_TEST(CSGLatticeTest, testCartLatticeEquality);
std::string name(const ElemQuality q)
std::variant< std::reference_wrapper< const CSGUniverse >, std::string > OuterVariant
Type definition for a variant that can hold either a CSGUniverse reference or a string for use as the...
std::string _outer_material
name of the outer material
std::string _outer_type
An enum for type of outer fill for lattice.
virtual ~CSGLattice()=default
Destructor.
std::string _name
Name of lattice.
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
bool operator!=(const CSGLattice &other) const
Operator overload for checking if two CSGLattice objects are not equal.
CSGLattice(const std::string &name, const std::string &lattice_type, const std::optional< OuterVariant > &outer=std::nullopt)
Construct a new CSGLattice of specific type.
virtual bool isValidIndex(const std::pair< int, int > index) const =0
Checks if the given index location is a valid index for the lattice.
const CSGUniverse & getOuterUniverse() const
Get the outer universe if outer type is UNIVERSE.
void setUniverseAtIndex(const CSGUniverse &universe, const std::pair< int, int > index)
replace the element at specified index in the lattice with the provided CSGUniverse.
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 latti...
CSGUniverse creates an internal representation of a Constructive Solid Geometry (CSG) universe...
const std::string & getType() const
Get the lattice type.
const std::string & getName() const
Get the name of lattice.
CSGLatticeList creates a container for CSGLattice objects to pass to CSGBase.
const std::vector< std::reference_wrapper< const CSGUniverse > > getUniqueUniverses() const
Get the list of unique universe objects in the lattice.
CSGLattice is the abstract class for defining lattices.
void resetOuter()
reset the outer fill around the lattice elements to be VOID
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...
const std::string & getOuterMaterial() const
Get the outer material name if outer fype is CSG_MATERIAL.
virtual std::unordered_map< std::string, AttributeVariant > getAttributes() const =0
Get attributes that define the lattice (excluding the universe map).
const CSGUniverse & getUniverseAtIndex(const std::pair< int, int > index)
Get the universe located at the given index.
void updateOuter(const std::string &outer_name)
Update the outer of the lattice to be the provided material name.
const std::vector< std::vector< std::string > > getUniverseNameMap() const
Get the arrangement of CSGUniverses in the lattice as their names.
FRIEND_TEST(CSGLatticeTest, testSetName)
Friends for unit testing.
const CSGUniverse * _outer_universe
outer object if fill is CSGUniverse
virtual bool compareAttributes(const CSGLattice &other) const =0
helper function to compare the attributes of the lattice type
std::vector< std::vector< std::reference_wrapper< const CSGUniverse > > > getUniverses() const
Get the arrangement of CSGUniverses in the lattice.
bool hasUniverse(const std::string &name) const
whether or not the universe of the specified name exists in the lattice
const std::string _lattice_type
Type of lattice.
virtual void setUniverses(std::vector< std::vector< std::reference_wrapper< const CSGUniverse >>> universes)=0
assign the vectors of universes as the lattice elements
const std::string getOuterType() const
Get the type of outer that fills the space around the lattice elements.
void setName(const std::string &name)
CSGBase creates an internal representation of a Constructive Solid Geometry (CSG) model...
virtual std::unique_ptr< CSGLattice > clone() const =0
bool operator==(const CSGLattice &other) const
Operator overload for checking if two CSGLattice objects are equal.