Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 10:10:55

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/field/RZMapFieldParams.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include <functional>
0010 
0011 #include "corecel/data/CollectionMirror.hh"
0012 #include "corecel/data/ParamsDataInterface.hh"
0013 
0014 #include "RZMapFieldData.hh"
0015 
0016 namespace celeritas
0017 {
0018 //---------------------------------------------------------------------------//
0019 struct RZMapFieldInput;
0020 
0021 //---------------------------------------------------------------------------//
0022 /*!
0023  * Set up a 2D RZMapFieldParams.
0024  *
0025  * The input values should be converted to the native unit system.
0026  */
0027 class RZMapFieldParams final : public ParamsDataInterface<RZMapFieldParamsData>
0028 {
0029   public:
0030     //@{
0031     //! \name Type aliases
0032     using Input = RZMapFieldInput;
0033     //@}
0034 
0035   public:
0036     // Construct with a magnetic field map
0037     explicit RZMapFieldParams(Input const& inp);
0038 
0039     //! Access field map data on the host
0040     HostRef const& host_ref() const final { return mirror_.host_ref(); }
0041 
0042     //! Access field map data on the device
0043     DeviceRef const& device_ref() const final { return mirror_.device_ref(); }
0044 
0045   private:
0046     // Host/device storage and reference
0047     CollectionMirror<RZMapFieldParamsData> mirror_;
0048 };
0049 
0050 //---------------------------------------------------------------------------//
0051 }  // namespace celeritas