https://mooseframework.inl.gov
CSGUniverseEngUnit.C
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 #include "CSGUniverseEngUnit.h"
11 #include "CSGBase.h"
12 
13 namespace CSG
14 {
15 
16 CSGUniverseEngUnit::CSGUniverseEngUnit(const std::string & name, bool is_root)
17  : CSGUniverse(name, is_root), CSGEngUnit("UNIVERSE")
18 {
19 }
20 
21 const CSGUniverse &
23 {
24  // if root universe contains no cells, then it has not be expanded (or not implemented correctly)
25  if (_internal_base->getRootUniverse().getAllCells().empty())
26  mooseError("Root universe of ",
27  getName(),
28  " contains no cells. ",
29  "Either getExpandedUniverse() has been called before expandUnit() or expandUnit() ",
30  "is not implemented correctly.");
31 
32  // Check that all universes and cells created in _internal_base are reachable from the root.
33  if (!_internal_base->areUniversesLinked())
34  mooseError("CSGUniverseEngUnit '",
35  getName(),
36  "' of type '",
37  getUnitType(),
38  "' contains unlinked universes or cells. All objects created in expandUnit() must be"
39  " reachable from the expanded root universe. Check implementation of expandUnit().");
40 
41  return _internal_base->getRootUniverse();
42 }
43 
44 } // namespace CSG
std::string name(const ElemQuality q)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
std::unique_ptr< CSGBase > _internal_base
CSGBase populated by expandUnit(); joined into the parent CSGBase by expandEngUnit() ...
Definition: CSGEngUnit.h:130
CSGUniverse creates an internal representation of a Constructive Solid Geometry (CSG) universe...
Definition: CSGUniverse.h:27
const std::string & getName() const override
Satisfy CSGEngUnit::getName() (resolved via CSGUniverse::getName())
const CSGUniverse & getExpandedUniverse() const
Return the root universe of _internal_base, which IS the expanded universe.
const std::string getUnitType() const
Get the type name of this engineering unit.
Definition: CSGEngUnit.h:63
CSGUniverseEngUnit(const std::string &name, bool is_root=false)
Constructor for derived classes.
CSGEngUnit is the abstract base class for all "engineering unit" types in the CSG system...
Definition: CSGEngUnit.h:32