Back to home page

EIC code displayed by LXR

 
 

    


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

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/CombinedBremModel.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include <functional>
0010 #include <memory>
0011 
0012 #include "corecel/data/CollectionMirror.hh"
0013 #include "celeritas/em/data/CombinedBremData.hh"
0014 #include "celeritas/io/ImportSBTable.hh"
0015 #include "celeritas/phys/AtomicNumber.hh"
0016 #include "celeritas/phys/ImportedProcessAdapter.hh"
0017 #include "celeritas/phys/Model.hh"
0018 
0019 #include "RelativisticBremModel.hh"
0020 #include "SeltzerBergerModel.hh"
0021 
0022 namespace celeritas
0023 {
0024 class MaterialParams;
0025 class ParticleParams;
0026 
0027 //---------------------------------------------------------------------------//
0028 /*!
0029  * Set up and launch a combined model of SeltzerBergerModel at the low energy
0030  * and RelativisticBremModel at the high energy for e+/e- Bremsstrahlung.
0031  *
0032  * \deprecated Delete in v1.0: only implemented for one element
0033  */
0034 class CombinedBremModel final : public Model, public StaticConcreteAction
0035 {
0036   public:
0037     //@{
0038     //! Type aliases
0039     using ReadData = std::function<ImportSBTable(AtomicNumber)>;
0040     using HostRef = HostCRef<CombinedBremData>;
0041     using DeviceRef = DeviceCRef<CombinedBremData>;
0042     using SPConstImported = std::shared_ptr<ImportedProcesses const>;
0043     //@}
0044 
0045   public:
0046     // Construct from model ID and other necessary data
0047     CombinedBremModel(ActionId id,
0048                       ParticleParams const& particles,
0049                       MaterialParams const& materials,
0050                       SPConstImported data,
0051                       ReadData load_sb_table,
0052                       bool enable_lpm);
0053 
0054     // Particle types and energy ranges that this model applies to
0055     SetApplicability applicability() const final;
0056 
0057     // Get the microscopic cross sections for the given particle and material
0058     MicroXsBuilders micro_xs(Applicability) const final;
0059 
0060     // Apply the interaction kernel to host data
0061     void step(CoreParams const&, CoreStateHost&) const final;
0062 
0063     // Apply the interaction kernel to device data
0064     void step(CoreParams const&, CoreStateDevice&) const final;
0065 
0066     //! Access data on the host
0067     HostRef const& host_ref() const { return data_.host_ref(); }
0068 
0069     //! Access data on the device
0070     DeviceRef const& device_ref() const { return data_.device_ref(); }
0071 
0072   private:
0073     //// DATA ////
0074 
0075     // Host/device storage and reference
0076     CollectionMirror<CombinedBremData> data_;
0077 
0078     // Associated models
0079     std::shared_ptr<SeltzerBergerModel> sb_model_;
0080     std::shared_ptr<RelativisticBremModel> rb_model_;
0081 };
0082 
0083 //---------------------------------------------------------------------------//
0084 }  // namespace celeritas