Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-07 10:11:38

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/MieModel.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include <memory>
0010 #include <vector>
0011 
0012 #include "corecel/data/ParamsDataStore.hh"
0013 #include "celeritas/inp/OpticalPhysics.hh"
0014 #include "celeritas/optical/Model.hh"
0015 
0016 #include "../MieData.hh"
0017 
0018 namespace celeritas
0019 {
0020 namespace optical
0021 {
0022 class MaterialParams;
0023 //---------------------------------------------------------------------------//
0024 /*!
0025  * Set up and launch the optical Mie scattering model interaction
0026  */
0027 class MieModel final : public Model
0028 {
0029   public:
0030     //!@{
0031     //! \name Type aliases
0032     using SPConstMaterials = std::shared_ptr<MaterialParams const>;
0033     using HostRef = HostCRef<MieData>;
0034     using DeviceRef = DeviceCRef<MieData>;
0035     //!@}
0036 
0037   public:
0038     // Construct with mie scattering input data
0039     MieModel(ActionId, inp::OpticalBulkMie, SPConstMaterials const&);
0040 
0041     // Build the mean free paths for this model
0042     void build_mfps(OptMatId, MfpBuilder&) const final;
0043 
0044     // Execute the model with host data
0045     void step(CoreParams const&, CoreStateHost&) const final;
0046 
0047     // Execute the model with device data
0048     void step(CoreParams const&, CoreStateDevice&) const final;
0049 
0050     //! Access data on the host
0051     HostRef const& host_ref() const { return data_.host_ref(); }
0052 
0053     //! Access data on the device
0054     DeviceRef const& device_ref() const { return data_.device_ref(); }
0055 
0056   private:
0057     inp::OpticalBulkMie input_;
0058     ParamsDataStore<MieData> data_;
0059 };
0060 
0061 //---------------------------------------------------------------------------//
0062 }  // namespace optical
0063 }  // namespace celeritas