21 : _name(name), _is_root(is_root)
24 for (
auto cell : cells)
31 auto cell_name = cell.
getName();
35 mooseWarning(
"Universe " +
getName() +
" already contains a cell by name " + cell_name +
". " +
36 "Skipping cell insertion for cell with duplicate name.");
43 mooseError(
"Cell with name " + name +
" does not exist in universe " +
_name +
".");
45 if (cell.getName() == name)
54 if (cell.getName() == name)
63 mooseError(
"Cannot remove cell. Cell with name " + name +
" does not exist in universe " +
66 if (it->get().getName() == name)
91 const bool num_cells_eq = all_cells.size() == other_cells.size();
94 for (
unsigned int i = 0; i < all_cells.size(); ++i)
95 if (all_cells[i].get() != other_cells[i].get())
106 return !(*
this == other);
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
CSGCell creates an internal representation of a Constructive Solid Geometry (CSG) cell,...
const std::string & getName() const
Get the cell name.
CSGEngUnit is the abstract base class for all "engineering unit" types in the CSG system.
CSGUniverse creates an internal representation of a Constructive Solid Geometry (CSG) universe,...
CSGUniverse(const std::string &name, bool is_root=false)
Construct a new CSGUniverse object.
virtual bool isEngUnit() const
Whether this universe is an engineering unit.
const std::string & getName() const
Get the name of the universe.
void addCell(const CSGCell &cell)
add cell to universe
bool operator!=(const CSGUniverse &other) const
Operator overload for checking if two CSGUniverse objects are not equal.
const CSGCell & getCell(const std::string &name)
Get the CSGCell object by name.
std::vector< std::reference_wrapper< const CSGCell > > _cells
list of references to cells in universe
void removeCell(const std::string &name)
remove a cell of the specified name from the universe
const std::vector< std::reference_wrapper< const CSGCell > > & getAllCells() const
Get list of the all cells in the universe.
std::string _name
Name of universe.
bool hasCell(const std::string &name) const
check if cell of provided name is present in universe
bool operator==(const CSGUniverse &other) const
Operator overload for checking if two CSGUniverse objects are equal.
void checkValidCSGName(const std::string &name)
Check name of CSG component for disallowed characters and symbols.