16 #include "nlohmann/json.h" 18 #ifdef MOOSE_UNIT_TEST 19 #include "gtest/gtest.h" 48 std::unique_ptr<CSGBase>
clone()
const {
return std::make_unique<CSGBase>(*this); }
105 const std::string & mat_name,
142 std::vector<std::reference_wrapper<const CSGCell>>
getAllCells()
const 221 std::vector<std::reference_wrapper<const CSGCell>> & cells);
238 std::vector<std::reference_wrapper<const CSGCell>> & cells);
255 std::vector<std::reference_wrapper<const CSGCell>> & cells);
297 void joinOtherBase(std::unique_ptr<CSGBase> base, std::string & new_root_name_join);
312 const std::string & new_root_name_base,
313 const std::string & new_root_name_join);
349 std::vector<std::string> & linked_universe_names)
const;
438 const std::string & new_root_name_base,
439 const std::string & new_root_name_incoming);
475 #ifdef MOOSE_UNIT_TEST std::string name(const ElemQuality q)
void joinCellList(CSGCellList &cell_list)
join a separate CSGCellList object to this one
void renameUniverse(const CSGUniverse &universe, const std::string &name)
rename the specified universe
CSGCell & getCell(const std::string &name) const
Get the CSGCell by name.
std::vector< std::reference_wrapper< const CSGUniverse > > getAllUniverses() const
Get all the universes in CSGBase instance.
std::vector< std::reference_wrapper< const CSGUniverse > > getAllUniverses() const
Get all universe objects.
CSGUniverseList _universe_list
List of universes associated with CSG object.
CSGRegions creates an internal representation of a CSG region, which can refer to an intersection...
CSGCellList creates a container for CSGCell objects to pass to CSGBase object.
std::unique_ptr< CSGBase > clone() const
Create a deep copy of this CSGBase instance.
const CSGCell & createCell(const std::string &name, const std::string &mat_name, const CSGRegion ®ion, const CSGUniverse *add_to_univ=nullptr)
Create a Material Cell object.
void joinUniverseList(CSGUniverseList &univ_list)
join a separate CSGUniverseList object to this one; root universes from univ_list will be combined in...
void joinOtherBase(std::unique_ptr< CSGBase > base)
Join another CSGBase object to this one.
const CSGSurface & getSurfaceByName(const std::string &name) const
Get a Surface object by name.
std::vector< std::reference_wrapper< const CSGCell > > getAllCells() const
Get all the cells in CSGBase instance.
CSGUniverse creates an internal representation of a Constructive Solid Geometry (CSG) universe...
bool operator==(const CSGBase &other) const
Operator overload for checking if two CSGBase objects are equal.
CSGSurface & getSurface(const std::string &name) const
Get a surface by name.
CSGSurfaceList _surface_list
List of surfaces associated with CSG object.
void getLinkedUniverses(const CSGUniverse &univ, std::vector< std::string > &linked_universe_names) const
Recursive method to retrieve all universes linked to current universe.
nlohmann::json generateOutput() const
generate the JSON representation output for the CSG object
std::vector< std::reference_wrapper< const CSGSurface > > getAllSurfaces() const
Get list of references to all surfaces in surface list.
CSGUniverse & getUniverse(const std::string &name) const
Get a Universe from the list by its name.
void addCellsToUniverse(const CSGUniverse &universe, std::vector< std::reference_wrapper< const CSGCell >> &cells)
Add a list of cells to an existing universe.
const CSGUniverse & getRootUniverse() const
Get the Root Universe object.
void updateCellRegion(const CSGCell &cell, const CSGRegion ®ion)
change the region of the specified cell
CSGUniverseList creates a container for CSGUniverse objects to pass to CSGBase.
void renameSurface(const CSGSurface &surface, const std::string &name)
rename the specified surface
FRIEND_TEST(CSGBaseTest, testCheckRegionSurfaces)
Friends for unit testing.
void renameCell(const CSGCell &cell, const std::string &name)
rename the specified cell
const CSGUniverse & getRoot() const
Get the root universe.
const CSGUniverse & addUniverseToList(const CSGUniverse &univ)
Add a new universe to the universe list based on a universe reference.
void renameRootUniverse(const std::string &name)
rename the root universe for this instance (default is ROOT_UNIVERSE)
void joinSurfaceList(CSGSurfaceList &surf_list)
join a separate CSGSurfaceList object to this one
const CSGSurface & addSurface(std::unique_ptr< CSGSurface > surf)
add a unique surface pointer to this base instance
void removeCellsFromUniverse(const CSGUniverse &universe, std::vector< std::reference_wrapper< const CSGCell >> &cells)
Remove a list of cells from an existing universe.
CSGSurface & getSurface(const std::string &name)
Get a Surface object by name.
CSGUniverse & addUniverse(const std::string &name)
create an empty universe
bool checkUniverseInBase(const CSGUniverse &universe) const
CSGCell creates an internal representation of a Constructive Solid Geometry (CSG) cell...
bool operator!=(const CSGBase &other) const
Operator overload for checking if two CSGBase objects are not equal.
void checkRegionSurfaces(const CSGRegion ®ion) const
CSGCellList _cell_list
List of cells associated with CSG object.
CSGCellList & getCellList()
Get a non-const reference to the CSGCellList object.
const CSGCell & getCellByName(const std::string &name) const
Get a Cell object by name.
void renameUniverse(const CSGUniverse &universe, const std::string &name)
rename the specified universe
CSGUniverseList & getUniverseList()
Get a non-const reference to the CSGUniverseList object.
const CSGSurfaceList & getSurfaceList() const
Get a const reference to the CSGSurfaceList object.
void renameCell(const CSGCell &cell, const std::string &name)
rename the specified cell
bool checkCellInBase(const CSGCell &cell) const
CSGSurfaceList is a container for storing CSGSurface objects in the CSGBase object.
CSGSurface creates an internal representation of a Constructive Solid Geometry (CSG) surface...
CSGBase()
Default constructor.
CSGSurface & addSurface(std::unique_ptr< CSGSurface > surf)
add a surface object to existing SurfaceList.
const CSGCell & addCellToList(const CSGCell &cell)
Add a new cell to the cell list based on a cell reference.
const CSGUniverse & createUniverse(const std::string &name)
Create an empty Universe object.
const CSGCellList & getCellList() const
Get a const reference to the CSGCellList object.
void addCellToUniverse(const CSGUniverse &universe, const CSGCell &cell)
Add a cell to an existing universe.
CSGSurfaceList & getSurfaceList()
Get a non-const reference to the CSGSurfaceList object.
void checkUniverseLinking() const
Check universes linked to root universe match universes defined in _universe_list.
std::vector< std::reference_wrapper< const CSGCell > > getAllCells() const
Get all cell objects.
void renameSurface(const CSGSurface &surface, const std::string &name)
rename the specified surface
CSGBase creates an internal representation of a Constructive Solid Geometry (CSG) model...
const CSGUniverseList & getUniverseList() const
Get a const reference to the CSGUniverseList object.
const CSGUniverse & getUniverseByName(const std::string &name)
Get a universe object by name.
void removeCellFromUniverse(const CSGUniverse &universe, const CSGCell &cell)
Remove a cell from an existing universe.
std::vector< std::reference_wrapper< const CSGSurface > > getAllSurfaces() const
Get all surface objects.