Back to home page

EIC code displayed by LXR

 
 

    


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

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/em/model/LivermorePEModel.hh
0007 //---------------------------------------------------------------------------//
0008 #pragma once
0009 
0010 #include <functional>
0011 
0012 #include "corecel/data/CollectionMirror.hh"
0013 #include "celeritas/Quantities.hh"
0014 #include "celeritas/em/data/LivermorePEData.hh"
0015 #include "celeritas/phys/AtomicNumber.hh"
0016 #include "celeritas/phys/Model.hh"
0017 
0018 namespace celeritas
0019 {
0020 struct ImportLivermorePE;
0021 class MaterialParams;
0022 class ParticleParams;
0023 
0024 //---------------------------------------------------------------------------//
0025 /*!
0026  * Set up and launch the Livermore photoelectric model interaction.
0027  */
0028 class LivermorePEModel final : public Model, public StaticConcreteAction
0029 {
0030   public:
0031     //!@{
0032     using ReadData = std::function<ImportLivermorePE(AtomicNumber)>;
0033     using HostRef = LivermorePEHostRef;
0034     using DeviceRef = LivermorePEDeviceRef;
0035     //!@}
0036 
0037   public:
0038     // Construct from model ID and other necessary data
0039     LivermorePEModel(ActionId id,
0040                      ParticleParams const& particles,
0041                      MaterialParams const& materials,
0042                      ReadData load_data);
0043 
0044     // Particle types and energy ranges that this model applies to
0045     SetApplicability applicability() const final;
0046 
0047     // Get the microscopic cross sections for the given particle and material
0048     MicroXsBuilders micro_xs(Applicability) const final;
0049 
0050     // Apply the interaction kernel on host
0051     void step(CoreParams const&, CoreStateHost&) const final;
0052 
0053     // Apply the interaction kernel on device
0054     void step(CoreParams const&, CoreStateDevice&) const final;
0055 
0056     //! Access data on the host
0057     HostRef const& host_ref() const { return data_.host_ref(); }
0058 
0059     //! Access data on the device
0060     DeviceRef const& device_ref() const { return data_.device_ref(); }
0061 
0062   private:
0063     // Host/device storage and reference
0064     CollectionMirror<LivermorePEData> data_;
0065 };
0066 
0067 //---------------------------------------------------------------------------//
0068 }  // namespace celeritas