20 auto name = cell->getName();
21 auto [it, inserted] =
_cells.emplace(
name, std::move(cell));
23 mooseError(
"Cell with name " +
name +
" already exists in geometry.");
31 mooseError(
"No cell by name " +
name +
" exists in the geometry.");
39 return addCell(std::make_unique<CSGCell>(
name, region));
44 const std::string & mat_name,
47 return addCell(std::make_unique<CSGCell>(
name, mat_name, region));
55 return addCell(std::make_unique<CSGCell>(
name, &univ, region));
58 std::vector<std::reference_wrapper<const CSGCell>>
61 std::vector<std::reference_wrapper<const CSGCell>> cells;
63 cells.push_back(*(it->second));
71 auto prev_name = cell.
getName();
72 auto it =
_cells.find(prev_name);
73 if (it ==
_cells.end() || it->second.get() != &cell)
75 " as it does not exist in this CSGBase instance.");
77 auto existing_cell = std::move(
_cells.find(prev_name)->second);
78 existing_cell->setName(
name);
80 addCell(std::move(existing_cell));
std::string name(const ElemQuality q)
CSGCell & addCell(std::unique_ptr< CSGCell > cell)
add a cell to the CellList.
CSGCell & getCell(const std::string &name) const
Get the CSGCell by name.
const std::string & getName() const
Get the cell name.
CSGRegions creates an internal representation of a CSG region, which can refer to an intersection...
CSGCellList()
Default constructor.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
CSGCell & addVoidCell(const std::string &name, const CSGRegion ®ion)
Add a Void Cell object cell list.
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...
CSGCell & addMaterialCell(const std::string &name, const std::string &mat_name, const CSGRegion ®ion)
Add a Material Cell object to cell list.
CSGCell & addUniverseCell(const std::string &name, const CSGUniverse &univ, const CSGRegion ®ion)
Add a Universe Cell object to cell list.
CSGCell creates an internal representation of a Constructive Solid Geometry (CSG) cell...
void renameCell(const CSGCell &cell, const std::string &name)
rename the specified cell
std::unordered_map< std::string, std::unique_ptr< CSGCell > > _cells
Mapping of cell names to pointers of stored cell objects.