Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-01-07 10:01:43

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/optical/model/WavelengthShiftModel.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include "corecel/Types.hh"
0010 #include "corecel/data/CollectionMirror.hh"
0011 #include "celeritas/io/ImportOpticalMaterial.hh"
0012 #include "celeritas/optical/ImportedModelAdapter.hh"
0013 #include "celeritas/optical/Model.hh"
0014 
0015 #include "../WavelengthShiftData.hh"
0016 
0017 namespace celeritas
0018 {
0019 struct ImportData;
0020 
0021 namespace optical
0022 {
0023 //---------------------------------------------------------------------------//
0024 /*!
0025  * Set up and launch the optical WLS model interaction.
0026  */
0027 class WavelengthShiftModel : public Model
0028 {
0029   public:
0030     //!@{
0031     //! \name Type aliases
0032     using SPConstImported = std::shared_ptr<ImportedModels const>;
0033     using HostRef = HostCRef<WavelengthShiftData>;
0034     using DeviceRef = DeviceCRef<WavelengthShiftData>;
0035     //!@}
0036 
0037     //! Material-dependent WLS data, indexed by \c OptMatId
0038     struct Input
0039     {
0040         ImportModelClass model{ImportModelClass::size_};
0041         std::vector<ImportWavelengthShift> data;
0042         WlsTimeProfile time_profile{WlsTimeProfile::size_};
0043     };
0044 
0045   public:
0046     // Create a model builder from imported data
0047     static ModelBuilder make_builder(SPConstImported, Input);
0048 
0049     // Construct with WLS input data
0050     WavelengthShiftModel(ActionId, SPConstImported, Input);
0051 
0052     // Build the mean free paths for this model
0053     void build_mfps(OptMatId, MfpBuilder&) const final;
0054 
0055     // Execute the model with host data
0056     void step(CoreParams const&, CoreStateHost&) const final;
0057 
0058     // Execute the model with device data
0059     void step(CoreParams const&, CoreStateDevice&) const final;
0060 
0061     //! Access data on the host
0062     HostRef const& host_ref() const { return data_.host_ref(); }
0063 
0064     //! Access data on the device
0065     DeviceRef const& device_ref() const { return data_.device_ref(); }
0066 
0067   private:
0068     ImportedModelAdapter imported_;
0069     CollectionMirror<WavelengthShiftData> data_;
0070 };
0071 
0072 //---------------------------------------------------------------------------//
0073 }  // namespace optical
0074 }  // namespace celeritas