Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:53: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/field/CartMapFieldParams.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include <memory>
0010 
0011 #include "corecel/Config.hh"
0012 
0013 #include "corecel/Assert.hh"
0014 #include "corecel/data/ParamsDataInterface.hh"
0015 
0016 namespace celeritas
0017 {
0018 //---------------------------------------------------------------------------//
0019 struct CartMapFieldInput;
0020 template<Ownership W, MemSpace M>
0021 struct CartMapFieldParamsData;
0022 
0023 //---------------------------------------------------------------------------//
0024 /*!
0025  * Set up a 3D CartMapFieldParams.
0026  *
0027  * The input values are in the native unit system.
0028  */
0029 class CartMapFieldParams final
0030     : public ParamsDataInterface<CartMapFieldParamsData>
0031 {
0032   public:
0033     //@{
0034     //! \name Type aliases
0035     using Input = CartMapFieldInput;
0036     //@}
0037 
0038   public:
0039     // Construct with a magnetic field map
0040     explicit CartMapFieldParams(Input const& inp);
0041 
0042     //! Access field map data on the host
0043     HostRef const& host_ref() const final;
0044 
0045     //! Access field map data on the device
0046     DeviceRef const& device_ref() const final;
0047 
0048   private:
0049     struct Impl;
0050     struct ImplDeleter
0051     {
0052         void operator()(Impl*) noexcept;
0053     };
0054     std::unique_ptr<Impl, ImplDeleter> impl_;
0055 };
0056 
0057 #if !(CELERITAS_USE_COVFIE || __DOXYGEN__)
0058 
0059 struct CartMapFieldParams::Impl
0060 {
0061 };
0062 
0063 inline void CartMapFieldParams::ImplDeleter::operator()(Impl*) noexcept
0064 {
0065     CELER_UNREACHABLE;
0066 }
0067 
0068 inline CartMapFieldParams::CartMapFieldParams(Input const&)
0069 {
0070     CELER_NOT_CONFIGURED("covfie");
0071 }
0072 
0073 //! Access field map data on the host
0074 inline auto CartMapFieldParams::host_ref() const -> HostRef const&
0075 {
0076     CELER_NOT_CONFIGURED("covfie");
0077 }
0078 
0079 //! Access field map data on the device
0080 inline auto CartMapFieldParams::device_ref() const -> DeviceRef const&
0081 {
0082     CELER_NOT_CONFIGURED("covfie");
0083 }
0084 #endif
0085 
0086 //---------------------------------------------------------------------------//
0087 }  // namespace celeritas