Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 10:31:21

0001 //----------------------------------*-C++-*----------------------------------//
0002 // Copyright 2020-2024 UT-Battelle, LLC, and other Celeritas developers.
0003 // See the top-level COPYRIGHT file for details.
0004 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
0005 //---------------------------------------------------------------------------//
0006 //! \file celeritas/field/RZMapFieldParams.hh
0007 //---------------------------------------------------------------------------//
0008 #pragma once
0009 
0010 #include <functional>
0011 
0012 #include "corecel/data/CollectionMirror.hh"
0013 #include "corecel/data/ParamsDataInterface.hh"
0014 
0015 #include "RZMapFieldData.hh"
0016 
0017 namespace celeritas
0018 {
0019 //---------------------------------------------------------------------------//
0020 struct RZMapFieldInput;
0021 
0022 //---------------------------------------------------------------------------//
0023 /*!
0024  * Set up a 2D RZMapFieldParams.
0025  *
0026  * The input values should be converted to the native unit system.
0027  */
0028 class RZMapFieldParams final : public ParamsDataInterface<RZMapFieldParamsData>
0029 {
0030   public:
0031     //@{
0032     //! \name Type aliases
0033     using Input = RZMapFieldInput;
0034     //@}
0035 
0036   public:
0037     // Construct with a magnetic field map
0038     explicit RZMapFieldParams(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<RZMapFieldParamsData> mirror_;
0049 };
0050 
0051 //---------------------------------------------------------------------------//
0052 }  // namespace celeritas