Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-16 08:52:20

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