Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:53:43

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/optical/model/RayleighModel.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include "celeritas/optical/ImportedModelAdapter.hh"
0010 #include "celeritas/optical/Model.hh"
0011 #include "celeritas/optical/Types.hh"
0012 
0013 namespace celeritas
0014 {
0015 class MaterialParams;
0016 struct ImportOpticalRayleigh;
0017 
0018 namespace optical
0019 {
0020 class ImportedMaterials;
0021 class MaterialParams;
0022 //---------------------------------------------------------------------------//
0023 /*!
0024  * Set up and launch the optical Rayleigh scattering model interaction.
0025  */
0026 class RayleighModel : public Model
0027 {
0028   public:
0029     //!@{
0030     //! \name Type aliases
0031     using SPConstImported = std::shared_ptr<ImportedModels const>;
0032     using SPConstImportedMaterials = std::shared_ptr<ImportedMaterials const>;
0033     using SPConstMaterials = std::shared_ptr<MaterialParams const>;
0034     using SPConstCoreMaterials
0035         = std::shared_ptr<::celeritas::MaterialParams const>;
0036     //!@}
0037 
0038     //! Optional input for calculating MFP tables from material parameters
0039     struct Input
0040     {
0041         SPConstMaterials materials;
0042         SPConstCoreMaterials core_materials;
0043         SPConstImportedMaterials imported_materials;
0044 
0045         //! Whether data is available to calculate material MFP tables
0046         explicit operator bool() const
0047         {
0048             return materials && core_materials && imported_materials;
0049         }
0050     };
0051 
0052   public:
0053     // Create a model builder from imported data and material parameters
0054     static ModelBuilder make_builder(SPConstImported, Input);
0055 
0056     // Construct with imported data and imported material parameters
0057     RayleighModel(ActionId id, SPConstImported imported, Input input);
0058 
0059     // Build the mean free paths for this model
0060     void build_mfps(OptMatId, MfpBuilder&) const final;
0061 
0062     // Execute the model with host data
0063     void step(CoreParams const&, CoreStateHost&) const final;
0064 
0065     // Execute the model with device data
0066     void step(CoreParams const&, CoreStateDevice&) const final;
0067 
0068   private:
0069     ImportedModelAdapter imported_;
0070     Input input_;
0071 };
0072 
0073 //---------------------------------------------------------------------------//
0074 }  // namespace optical
0075 }  // namespace celeritas