14 #ifdef MOOSE_UNIT_TEST 15 #include "gtest/gtest.h" 40 std::vector<std::vector<std::reference_wrapper<const CSGUniverse>>> universes,
41 const std::optional<OuterVariant> & outer = std::nullopt);
54 const std::optional<OuterVariant> & outer = std::nullopt);
66 std::unique_ptr<CSGLattice>
clone()
const override 68 return std::make_unique<CSGHexagonalLattice>(*this);
78 virtual std::unordered_map<std::string, AttributeVariant>
getAttributes()
const override;
86 virtual bool isValidIndex(
const std::pair<int, int> index)
const override;
97 std::vector<std::vector<std::reference_wrapper<const CSGUniverse>>> universes)
const override;
197 std::vector<std::vector<std::reference_wrapper<const CSGUniverse>>> universes)
override;
209 std::map<std::pair<unsigned int, unsigned int>, std::pair<unsigned int, unsigned int>>
212 #ifdef MOOSE_UNIT_TEST std::string name(const ElemQuality q)
void setPitch(Real pitch)
set the pitch of the lattice
unsigned int _nring
number of rings in the hexagonal lattice, should be consistent with the number of rows ...
virtual bool compareAttributes(const CSGLattice &other) const override
compare the attributes returned in getAttributes of this lattice to another lattice ...
Real getPitch() const
get the pitch of the lattice
std::unique_ptr< CSGLattice > clone() const override
clone this hexagonal lattice
CSGLattice is the abstract class for defining lattices.
virtual ~CSGHexagonalLattice()=default
Destructor.
std::map< std::pair< unsigned int, unsigned int >, std::pair< unsigned int, unsigned int > > _row_to_ring_map
map of row-column indices to ring-position indices for quick conversion and look-up ...
unsigned int getNRings() const
get number of rings in the lattice
std::pair< int, int > getRingIndexFromRowIndex(const std::pair< int, int > &row_col_index) const
Given an index in row-column form, get the corresponding ring-position index.
CSGHexagonalLattice is the class for constructing hexagonal lattices of CSGUniverses arranged in conc...
virtual bool isValidUniverseMap(std::vector< std::vector< std::reference_wrapper< const CSGUniverse >>> universes) const override
check if the arrangement of the provided universes is valid for the hexagonal lattice given the numbe...
unsigned int nRowToRing(int nrow)
methods to help convert between number of rows and rings get the total number of rings from the numbe...
Real _pitch
lattice pitch (flat-to-flat distance between adjacent hex elements)
virtual std::unordered_map< std::string, AttributeVariant > getAttributes() const override
Get attributes that define the lattice (excluding the universe map).
void buildIndexMap()
build a mapping of row-column indices to ring-position indices for quick conversion and look-up...
unsigned int nRingToRow(int nring)
get the total number of rows from the number of rings
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual bool isValidIndex(const std::pair< int, int > index) const override
check if provided index in row-column form is valid for the given hexagonal lattice ...
unsigned int getNRows() const
get number of rows in the lattices
unsigned int _nrow
number of rows in the hexagonal lattice (must be odd), should be consistent with the number of rings ...
virtual void setUniverses(std::vector< std::vector< std::reference_wrapper< const CSGUniverse >>> universes) override
set the universes that define the lattice layout
std::pair< int, int > getRowIndexFromRingIndex(const std::pair< int, int > &row_col_index) const
Given an index in ring-position form, get the corresponding row-column index.
CSGHexagonalLattice(const std::string &name, Real pitch, std::vector< std::vector< std::reference_wrapper< const CSGUniverse >>> universes, const std::optional< OuterVariant > &outer=std::nullopt)
Construct a new CSGHexagonalLattice from a map of universes.
FRIEND_TEST(CSGLatticeTest, testHexSetUniverses)
Friends for unit testing.