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