https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
13namespace CSG
14{
15
16CSGUniverseEngUnit::CSGUniverseEngUnit(const std::string & name, bool is_root)
17 : CSGUniverse(name, is_root), CSGEngUnit("UNIVERSE")
18{
19}
20
21const 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 '",
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
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
CSGEngUnit is the abstract base class for all "engineering unit" types in the CSG system.
Definition CSGEngUnit.h:33
std::unique_ptr< CSGBase > _internal_base
CSGBase populated by expandUnit(); joined into the parent CSGBase by expandEngUnit()
Definition CSGEngUnit.h:130
const std::string getUnitType() const
Get the type name of this engineering unit.
Definition CSGEngUnit.h:63
const CSGUniverse & getExpandedUniverse() const
Return the root universe of _internal_base, which IS the expanded universe.
CSGUniverseEngUnit(const std::string &name, bool is_root=false)
Constructor for derived classes.
const std::string & getName() const override
Satisfy CSGEngUnit::getName() (resolved via CSGUniverse::getName())
CSGUniverse creates an internal representation of a Constructive Solid Geometry (CSG) universe,...
Definition CSGUniverse.h:28