Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-14 10:22:22

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/neutron/model/NeutronCaptureModel.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include <functional>
0010 
0011 #include "corecel/data/ParamsDataStore.hh"
0012 #include "corecel/inp/Grid.hh"
0013 #include "celeritas/mat/IsotopeView.hh"
0014 #include "celeritas/mat/MaterialView.hh"
0015 #include "celeritas/neutron/data/NeutronCaptureData.hh"
0016 #include "celeritas/phys/AtomicNumber.hh"
0017 #include "celeritas/phys/Model.hh"
0018 
0019 namespace celeritas
0020 {
0021 class MaterialParams;
0022 class ParticleParams;
0023 
0024 //---------------------------------------------------------------------------//
0025 /*!
0026  * Set up and launch the neutron capture model interaction.
0027  */
0028 class NeutronCaptureModel final : public Model, public StaticConcreteAction
0029 {
0030   public:
0031     //!@{
0032     using ReadData = std::function<inp::Grid(AtomicNumber)>;
0033     using HostRef = HostCRef<NeutronCaptureData>;
0034     using DeviceRef = DeviceCRef<NeutronCaptureData>;
0035     //!@}
0036 
0037   public:
0038     // Construct from model ID and other necessary data
0039     NeutronCaptureModel(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     XsTable micro_xs(Applicability) const final;
0049 
0050     //! Apply the interaction kernel to host data
0051     void step(CoreParams const&, CoreStateHost&) const final;
0052 
0053     // Apply the interaction kernel to device data
0054     void step(CoreParams const&, CoreStateDevice&) const final;
0055 
0056     //!@{
0057     //! Access model data
0058     HostRef const& host_ref() const { return mirror_.host_ref(); }
0059     DeviceRef const& device_ref() const { return mirror_.device_ref(); }
0060     //!@}
0061 
0062   private:
0063     //// DATA ////
0064 
0065     // Host/device storage and reference
0066     ParamsDataStore<NeutronCaptureData> mirror_;
0067 };
0068 
0069 //---------------------------------------------------------------------------//
0070 }  // namespace celeritas