18 : _name(
name), _is_root(is_root)
20 for (
auto cell : cells)
27 auto cell_name = cell.
getName();
31 mooseWarning(
"Universe " +
getName() +
" already contains a cell by name " + cell_name +
". " +
32 "Skipping cell insertion for cell with duplicate name.");
41 if (cell.getName() ==
name)
50 if (cell.getName() ==
name)
59 mooseError(
"Cannot remove cell. Cell with name " +
name +
" does not exist in universe " +
62 if (it->get().getName() ==
name)
77 const bool num_cells_eq = all_cells.size() == other_cells.size();
80 for (
unsigned int i = 0; i < all_cells.size(); ++i)
81 if (all_cells[i].
get() != other_cells[i].get())
95 return !(*
this == other);
std::string name(const ElemQuality q)
const std::string & getName() const
Get the cell name.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
std::string _name
Name of universe.
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args.
bool hasCell(const std::string &name) const
check if cell of provided name is present in universe
CSGUniverse creates an internal representation of a Constructive Solid Geometry (CSG) universe...
const std::vector< std::reference_wrapper< const CSGCell > > & getAllCells() const
Get list of the all cells in the universe.
const CSGCell & getCell(const std::string &name)
Get the CSGCell object by name.
void removeCell(const std::string &name)
remove a cell of the specified name from the universe
bool operator==(const CSGUniverse &other) const
Operator overload for checking if two CSGUniverse objects are equal.
const std::string & getName() const
Get the name of the universe.
std::vector< std::reference_wrapper< const CSGCell > > _cells
list of references to cells in universe
CSGCell creates an internal representation of a Constructive Solid Geometry (CSG) cell...
CSGUniverse(const std::string &name, bool is_root=false)
Construct a new CSGUniverse object.
bool operator!=(const CSGUniverse &other) const
Operator overload for checking if two CSGUniverse objects are not equal.
void addCell(const CSGCell &cell)
add cell to universe