https://mooseframework.inl.gov
CSGCellList.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 #include "CSGCell.h"
13 
14 namespace CSG
15 {
16 
21 {
22 protected:
26  CSGCellList();
27 
31  virtual ~CSGCellList() = default;
32 
42  CSGCell &
43  addMaterialCell(const std::string & name, const std::string & mat_name, const CSGRegion & region);
44 
53  CSGCell & addVoidCell(const std::string & name, const CSGRegion & region);
54 
64  CSGCell &
65  addUniverseCell(const std::string & name, const CSGUniverse & univ, const CSGRegion & region);
66 
72  std::unordered_map<std::string, std::unique_ptr<CSGCell>> & getCellListMap() { return _cells; }
73 
79  std::vector<std::reference_wrapper<const CSGCell>> getAllCells() const;
80 
87  CSGCell & getCell(const std::string & name) const;
88 
96  CSGCell & addCell(std::unique_ptr<CSGCell> cell);
97 
104  void renameCell(const CSGCell & cell, const std::string & name);
105 
107  std::unordered_map<std::string, std::unique_ptr<CSGCell>> _cells;
108 
109  // Only CSGBase should be calling the methods in CSGCellList
110  friend class CSGBase;
111 };
112 } // namespace CSG
std::string name(const ElemQuality q)
CSGCell & addCell(std::unique_ptr< CSGCell > cell)
add a cell to the CellList.
Definition: CSGCellList.C:18
CSGCell & getCell(const std::string &name) const
Get the CSGCell by name.
Definition: CSGCellList.C:28
CSGRegions creates an internal representation of a CSG region, which can refer to an intersection...
Definition: CSGRegion.h:21
CSGCellList creates a container for CSGCell objects to pass to CSGBase object.
Definition: CSGCellList.h:20
CSGCellList()
Default constructor.
Definition: CSGCellList.C:15
std::unordered_map< std::string, std::unique_ptr< CSGCell > > & getCellListMap()
Get map of all names to cells in cell list.
Definition: CSGCellList.h:72
CSGCell & addVoidCell(const std::string &name, const CSGRegion &region)
Add a Void Cell object cell list.
Definition: CSGCellList.C:37
std::vector< std::reference_wrapper< const CSGCell > > getAllCells() const
Get all the cells in CSGBase instance.
Definition: CSGCellList.C:59
CSGUniverse creates an internal representation of a Constructive Solid Geometry (CSG) universe...
Definition: CSGUniverse.h:26
CSGCell & addMaterialCell(const std::string &name, const std::string &mat_name, const CSGRegion &region)
Add a Material Cell object to cell list.
Definition: CSGCellList.C:43
CSGCell & addUniverseCell(const std::string &name, const CSGUniverse &univ, const CSGRegion &region)
Add a Universe Cell object to cell list.
Definition: CSGCellList.C:51
virtual ~CSGCellList()=default
Destructor.
CSGCell creates an internal representation of a Constructive Solid Geometry (CSG) cell...
Definition: CSGCell.h:27
void renameCell(const CSGCell &cell, const std::string &name)
rename the specified cell
Definition: CSGCellList.C:68
std::unordered_map< std::string, std::unique_ptr< CSGCell > > _cells
Mapping of cell names to pointers of stored cell objects.
Definition: CSGCellList.h:107
CSGBase creates an internal representation of a Constructive Solid Geometry (CSG) model...
Definition: CSGBase.h:29