Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 10:31:24

0001 //----------------------------------*-C++-*----------------------------------//
0002 // Copyright 2020-2024 UT-Battelle, LLC, and other Celeritas developers.
0003 // See the top-level COPYRIGHT file for details.
0004 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
0005 //---------------------------------------------------------------------------//
0006 //! \file celeritas/io/ImportVolume.hh
0007 //---------------------------------------------------------------------------//
0008 #pragma once
0009 
0010 #include <string>
0011 
0012 namespace celeritas
0013 {
0014 //---------------------------------------------------------------------------//
0015 /*!
0016  * Store region description and attributes.
0017  */
0018 struct ImportRegion
0019 {
0020     std::string name;
0021     bool field_manager{false};
0022     bool production_cuts{false};
0023     bool user_limits{false};
0024 };
0025 
0026 //---------------------------------------------------------------------------//
0027 /*!
0028  * Store logical volume properties.
0029  *
0030  * \note The "phys material ID" is the index of the MaterialCutsCouple, and the
0031  * "geo material ID" is the index of the Material (physical properties).
0032  *
0033  * \note The index of this volume in the \c volumes vector is the "instance ID"
0034  * which is not necessarily reproducible.
0035  */
0036 struct ImportVolume
0037 {
0038     //!@{
0039     //! \name Type aliases
0040     using Index = unsigned int;
0041     //!@}
0042 
0043 #ifndef SWIG
0044     static inline constexpr Index unspecified = -1;
0045 #endif
0046 
0047     Index geo_material_id{unspecified};  //!< Material defined by geometry
0048     Index region_id{unspecified};  //!< Optional region associated
0049     Index phys_material_id{unspecified};  //!< Material modified by physics
0050     std::string name;
0051     std::string solid_name;
0052 
0053     //! Whether this represents a physical volume or is just a placeholder
0054     explicit operator bool() const { return geo_material_id != unspecified; }
0055 };
0056 
0057 //---------------------------------------------------------------------------//
0058 }  // namespace celeritas