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/RelativisticBremModel.hh
0007 //---------------------------------------------------------------------------//
0008 #pragma once
0009 
0010 #include <memory>
0011 
0012 #include "corecel/data/CollectionMirror.hh"
0013 #include "celeritas/em/data/RelativisticBremData.hh"
0014 #include "celeritas/mat/ElementView.hh"
0015 #include "celeritas/phys/AtomicNumber.hh"
0016 #include "celeritas/phys/ImportedModelAdapter.hh"
0017 #include "celeritas/phys/ImportedProcessAdapter.hh"
0018 #include "celeritas/phys/Model.hh"
0019 
0020 namespace celeritas
0021 {
0022 class MaterialParams;
0023 class ParticleParams;
0024 
0025 //---------------------------------------------------------------------------//
0026 /*!
0027  * Set up and launch the relativistic Bremsstrahlung model for high-energy
0028  * electrons and positrons with the Landau-Pomeranchuk-Migdal (LPM) effect
0029  */
0030 class RelativisticBremModel final : public Model, public StaticConcreteAction
0031 {
0032   public:
0033     //@{
0034     //! Type aliases
0035     using HostRef = HostCRef<RelativisticBremData>;
0036     using DeviceRef = DeviceCRef<RelativisticBremData>;
0037     using SPConstImported = std::shared_ptr<ImportedProcesses const>;
0038     //@}
0039 
0040   public:
0041     // Construct from model ID and other necessary data
0042     RelativisticBremModel(ActionId id,
0043                           ParticleParams const& particles,
0044                           MaterialParams const& materials,
0045                           SPConstImported data,
0046                           bool enable_lpm);
0047 
0048     // Particle types and energy ranges that this model applies to
0049     SetApplicability applicability() const final;
0050 
0051     // Get the microscopic cross sections for the given particle and material
0052     MicroXsBuilders micro_xs(Applicability) const final;
0053 
0054     // Apply the interaction kernel to host data
0055     void step(CoreParams const&, CoreStateHost&) const final;
0056 
0057     // Apply the interaction kernel to device data
0058     void step(CoreParams const&, CoreStateDevice&) const final;
0059 
0060     //! Access data on the host
0061     HostRef const& host_ref() const { return data_.host_ref(); }
0062 
0063     //! Access data on the device
0064     DeviceRef const& device_ref() const { return data_.device_ref(); }
0065 
0066   private:
0067     //// DATA ////
0068 
0069     // Host/device storage and reference
0070     CollectionMirror<RelativisticBremData> data_;
0071 
0072     ImportedModelAdapter imported_;
0073 
0074     //// TYPES ////
0075 
0076     using HostValue = HostVal<RelativisticBremData>;
0077 
0078     using FormFactor = RelBremFormFactor;
0079     using ElementData = RelBremElementData;
0080 
0081     //// HELPER FUNCTIONS ////
0082 
0083     void build_data(HostValue* host_data,
0084                     MaterialParams const& materials,
0085                     real_type particle_mass);
0086 
0087     static FormFactor const& get_form_factor(AtomicNumber index);
0088     ElementData
0089     compute_element_data(ElementView const& elem, real_type particle_mass);
0090 };
0091 
0092 //---------------------------------------------------------------------------//
0093 }  // namespace celeritas