Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-18 09:09:00

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