22 mooseError(
"An engineering unit with name '",
name,
"' already exists in geometry.");
31 if (ptr->getName() ==
name)
33 mooseError(
"Engineering unit with name '",
name,
"' does not exist in this CSGBase.");
44 std::vector<std::reference_wrapper<const CSGEngUnit>>
47 std::vector<std::reference_wrapper<const CSGEngUnit>> result;
49 result.push_back(*ptr);
53 std::vector<std::reference_wrapper<const CSGSurfaceEngUnit>>
56 std::vector<std::reference_wrapper<const CSGSurfaceEngUnit>> result;
58 if (
const auto * surf = dynamic_cast<const CSGSurfaceEngUnit *>(ptr))
59 result.push_back(*surf);
63 std::vector<std::reference_wrapper<const CSGCellEngUnit>>
66 std::vector<std::reference_wrapper<const CSGCellEngUnit>> result;
68 if (
const auto * cell = dynamic_cast<const CSGCellEngUnit *>(ptr))
69 result.push_back(*cell);
73 std::vector<std::reference_wrapper<const CSGUniverseEngUnit>>
76 std::vector<std::reference_wrapper<const CSGUniverseEngUnit>> result;
78 if (
const auto * univ = dynamic_cast<const CSGUniverseEngUnit *>(ptr))
79 result.push_back(*univ);
89 if (all_units.size() != other_units.size())
92 for (
const auto & unit : all_units)
94 const std::string & unit_name = unit.get().getName();
95 const auto & other_unit = other.
getEngUnit(unit_name);
96 if (unit.get() != other_unit)
105 return !(*
this == other);
std::string name(const ElemQuality q)
CSGEngUnitList is a non-owning index of CSGEngUnit objects stored in the type lists (CSGSurfaceList...
KOKKOS_INLINE_FUNCTION const T * find(const T &target, const T *const begin, const T *const end)
Find a value in an array.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
void removeEngUnit(const CSGEngUnit &unit)
Remove an engineering unit from this index by address.
bool operator!=(const CSGEngUnitList &other) const
Operator overload for checking if two CSGEngUnitList objects are not equal.
std::vector< std::reference_wrapper< const CSGUniverseEngUnit > > getAllUniverseEngUnits() const
Get all universe-like engineering units.
bool hasEngUnit(const std::string &name) const
Return whether an engineering unit with the given name exists in this list.
CSGEngUnitList()
Default constructor.
std::vector< std::reference_wrapper< const CSGCellEngUnit > > getAllCellEngUnits() const
Get all cell-like engineering units.
std::vector< std::reference_wrapper< const CSGSurfaceEngUnit > > getAllSurfaceEngUnits() const
Get all surface-like engineering units.
bool operator==(const CSGEngUnitList &other) const
Operator overload for checking if two CSGEngUnitList objects are equal.
CSGEngUnit & getEngUnit(const std::string &name) const
Get an engineering unit by name.
CSGEngUnit & addEngUnit(CSGEngUnit &unit)
Register an engineering unit in this index.
virtual const std::string & getName() const =0
Get the unique instance name of this engineering unit.
std::vector< std::reference_wrapper< const CSGEngUnit > > getAllEngUnits() const
Get all engineering units of all types in the list.
std::vector< CSGEngUnit * > _eng_units
Non-owning index: raw pointers into the type lists.
CSGEngUnit is the abstract base class for all "engineering unit" types in the CSG system...