Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/celeritas/io/ImportMaterial.hh was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 //------------------------------- -*- C++ -*- -------------------------------//
0002 // Copyright Celeritas contributors: see top-level COPYRIGHT file for details
0003 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
0004 //---------------------------------------------------------------------------//
0005 //! \file celeritas/io/ImportMaterial.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include <map>
0010 #include <string>
0011 #include <vector>
0012 
0013 namespace celeritas
0014 {
0015 //---------------------------------------------------------------------------//
0016 /*!
0017  * Enum for storing G4State enumerators.
0018  */
0019 enum class ImportMaterialState
0020 {
0021     other,
0022     solid,
0023     liquid,
0024     gas,
0025     size_
0026 };
0027 
0028 //---------------------------------------------------------------------------//
0029 /*!
0030  * Particle production cutoff values: range and approximate energy.
0031  */
0032 struct ImportProductionCut
0033 {
0034     double energy{};  //!< [MeV]
0035     double range{};  //!< [length]
0036 };
0037 
0038 //---------------------------------------------------------------------------//
0039 /*!
0040  * Fractional elemental composition of a given material.
0041  */
0042 struct ImportMatElemComponent
0043 {
0044     //!@{
0045     //! \name Type aliases
0046     using ElIndex = unsigned int;
0047     //!@}
0048 
0049     ElIndex element_id{};  //!< Index of element in ImportElement
0050     double number_fraction{};  //!< [unitless]
0051 };
0052 
0053 //---------------------------------------------------------------------------//
0054 /*!
0055  * Material data as specified by a geometry model.
0056  *
0057  * These are the "real life properties" unaffected by changes to the user's
0058  * physics selection.
0059  */
0060 struct ImportGeoMaterial
0061 {
0062     //!@{
0063     //! \name Type aliases
0064     using VecComponent = std::vector<ImportMatElemComponent>;
0065     //!@}
0066 
0067     std::string name{};
0068     ImportMaterialState state{ImportMaterialState::other};
0069     double temperature{};  //!< [K]
0070     double number_density{};  //!< [1/length^3]
0071     VecComponent elements;
0072 };
0073 
0074 //---------------------------------------------------------------------------//
0075 /*!
0076  * Distinct materials as modified by physics.
0077  *
0078  * User-selected regions can alter physics properties so that the same
0079  * "geometry material" can correspond to multiple "physics materials". These
0080  * include the behavior of the material as an optical region.
0081  *
0082  * - \c geo_material_id is a geometry material corresponding to the index in
0083  *   the \c ImportData.geo_materials
0084  * - \c optical_material_id is an \em optional optical material corresponding
0085  *   to the index in the \c ImportData.optical_materials
0086  *
0087  * Geant4 requires an optical material to correspond to a single geo material,
0088  * but we may relax this restriction in the future.
0089  */
0090 struct ImportPhysMaterial
0091 {
0092     //!@{
0093     //! \name Type aliases
0094     using Index = unsigned int;
0095     using PdgInt = int;
0096     using MapIntCutoff = std::map<PdgInt, ImportProductionCut>;
0097     //!@}
0098 
0099     static constexpr Index unspecified = -1;
0100 
0101     Index geo_material_id{};  //!< Index in geo_materials list
0102     Index optical_material_id{unspecified};  //!< Optional index in optical mat
0103     MapIntCutoff pdg_cutoffs;  //!< Cutoff per PDG
0104 };
0105 
0106 //---------------------------------------------------------------------------//
0107 // FREE FUNCTIONS
0108 //---------------------------------------------------------------------------//
0109 
0110 // Get the string label for material state
0111 char const* to_cstring(ImportMaterialState s);
0112 
0113 //---------------------------------------------------------------------------//
0114 }  // namespace celeritas