Celeritas 0.7.0-dev.228+develop.9905a715
Loading...
Searching...
No Matches
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<>
 
using VariantLabel = std::variant< Label, VolumeInstanceId >
 
using MaterialInputId = OpaqueId< struct MaterialInput >
 
using LocalParent = std::optional< MaterialInputId >
 
- 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.
 
void output (JsonPimpl *) const final
 Write the proto to a JSON object.
 
Input constinput () const
 Get the input, primarily for unit testing.
 
Unit build (Tol const &tol, BBox const &bbox, bool is_global_universe) const
 Construct a standalone unit for testing or external interface.
 

Additional Inherited Members

- Protected Member Functions inherited from celeritas::orangeinp::ProtoInterface
 CELER_DEFAULT_COPY_MOVE (ProtoInterface)
 

Detailed Description

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

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

Additional metadata about the structure can be provided when converting Geant4 geometry. When building, labels are volume instance IDs: each material and daughter is a volume placement, and the background input uses an empty instance ID as a sentinel indicating a background volume is present. (Note the "background" is structurally a volume, not instance, since it is locally the top level of the geometry.) In addition to the labels, a special local_parent field denotes a structural relationship between one input object and another. These will be always set when building from Geant4 but never set when building from SCALE. The value is a null ID when the parent canonical volume is rendered as the background, or the index in the list of materials when the parent volume is inlined into this unit.

Member Function Documentation

◆ build() [1/2]

void celeritas::orangeinp::UnitProto::build ( ProtoBuilder &  pb) 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,
bool  is_global_universe 
) 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.

◆ daughters()

auto celeritas::orangeinp::UnitProto::daughters ( ) const
finalvirtual

Get a list of all daughter protos.

Implements celeritas::orangeinp::ProtoInterface.

◆ interior()

auto celeritas::orangeinp::UnitProto::interior ( ) const
finalvirtual

Get the boundary of this universe as an object.

Implements celeritas::orangeinp::ProtoInterface.

◆ label()

std::string_view celeritas::orangeinp::UnitProto::label ( ) const
finalvirtual

Short unique name of this object.

Implements celeritas::orangeinp::ProtoInterface.

◆ output()

void celeritas::orangeinp::UnitProto::output ( JsonPimpl ) const
finalvirtual

Write the proto to a JSON object.

Implements celeritas::orangeinp::ProtoInterface.


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