Celeritas  0.5.0-56+6b053cd
Classes | Public Member Functions | List of all members
celeritas::orangeinp::UnitProto Class Reference

Construct a general CSG universe, aka a "unit". More...

#include <UnitProto.hh>

Inheritance diagram for celeritas::orangeinp::UnitProto:
Inheritance graph
[legend]

Classes

struct  BackgroundInput
 Optional "background" inside of exterior, outside of all mat/daughter. More...
 
struct  BoundaryInput
 Boundary conditions for the unit. More...
 
struct  DaughterInput
 Another universe embedded within this one. More...
 
struct  Input
 Required input data to create a unit proto. More...
 
struct  MaterialInput
 A homogeneous physical material. More...
 

Public Types

Types
using Unit = detail::CsgUnit
 
using Tol = Tolerance<>
 
- Public Types inherited from celeritas::orangeinp::ProtoInterface
using SPConstObject = std::shared_ptr< ObjectInterface const >
 
using SPConstProto = std::shared_ptr< ProtoInterface const >
 
using VecProto = std::vector< ProtoInterface const * >
 
using ProtoBuilder = detail::ProtoBuilder
 

Public Member Functions

 UnitProto (Input &&inp)
 Construct with required input data.
 
std::string_view label () const final
 Short unique name of this object.
 
SPConstObject interior () const final
 Get the boundary of this universe as an object.
 
VecProto daughters () const final
 Get a list of all daughter protos.
 
void build (ProtoBuilder &) const final
 Construct a universe input from this object. More...
 
void output (JsonPimpl *) const final
 Write the proto to a JSON object.
 
Unit build (Tol const &tol, BBox const &bbox) const
 Construct a standalone unit for testing or external interface. More...
 

Additional Inherited Members

- Protected Member Functions inherited from celeritas::orangeinp::ProtoInterface
 ProtoInterface ()=default
 
virtual ~ProtoInterface ()=default
 
 CELER_DEFAULT_COPY_MOVE (ProtoInterface)
 

Detailed Description

Construct a general CSG universe, aka a "unit".

A "unit" is a region of space (specified by the "boundary" object) that is divided up into multiple smaller regions:

Regarding boundary conditions: "Input" is for how the unit is defined:

========== ========================================================== Input Description ========== ========================================================== Implicit Boundary implicitly truncates interior (KENO) Explicit Interior CSG definition includes boundary (RTK) ========== ==========================================================

Additionally, whether the universe is the top-level global universe (see the ExteriorBoundary type) affects the construction.

========== ========================================================== ExtBound Description ========== ========================================================== Daughter Boundary is already truncated by higher-level unit Global Boundary must explicitly be represented as a volume ========== ==========================================================

These result in different z ordering for the exterior:

===== ===== ================== ======================================== Inp ExB Resulting zorder Description ===== ===== ================== ======================================== I N implicit_exterior Higher-level universe truncates X N implicit_exterior Higher-level universe truncates I Y exterior Global unit that truncates other regions X Y media Global unit with well-connected exterior ===== ===== ================== ========================================

Member Function Documentation

◆ build() [1/2]

void celeritas::orangeinp::UnitProto::build ( ProtoBuilder &  input) const
finalvirtual

Construct a universe input from this object.

Construction is done from highest masking precedence to lowest (reverse zorder): exterior, then holes, then arrays, then media.

Todo:
"simple safety" flag is set inside "unit inserter": move here once we stop importing from SCALE via OrangeInput.
Todo:
The nearest internal surface is probably not the safety distance, but it's better than nothing
Todo:
Save material IDs as well

Implements celeritas::orangeinp::ProtoInterface.

◆ build() [2/2]

auto celeritas::orangeinp::UnitProto::build ( Tol const &  tol,
BBox const &  bbox 
) const

Construct a standalone unit for testing or external interface.

The universe ID in the resulting "fill" is the index into the input daughters list, which is the same ordering as the array of this->daughters().

The "exterior boundary" argument determines whether the outer boundary needs to be deleted (assumed inside, implicit from the parent universe's boundary) or preserved.

Todo:
We can sometimes eliminate CSG surfaces and nodes that aren't used by the actual volumes>

The documentation for this class was generated from the following files: