Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //----------------------------------*-C++-*----------------------------------//
0002 // Copyright 2023-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/global/alongstep/detail/UniformFieldPropagatorFactory.hh
0007 //---------------------------------------------------------------------------//
0008 #pragma once
0009 
0010 #include "corecel/Macros.hh"
0011 #include "celeritas/field/DormandPrinceStepper.hh"  // IWYU pragma: associated
0012 #include "celeritas/field/MakeMagFieldPropagator.hh"  // IWYU pragma: associated
0013 #include "celeritas/field/UniformField.hh"  // IWYU pragma: associated
0014 #include "celeritas/field/UniformFieldData.hh"  // IWYU pragma: associated
0015 
0016 namespace celeritas
0017 {
0018 namespace detail
0019 {
0020 //---------------------------------------------------------------------------//
0021 /*!
0022  * Propagate a track in a uniform magnetic field.
0023  */
0024 struct UniformFieldPropagatorFactory
0025 {
0026 #if CELER_USE_DEVICE
0027     inline static constexpr int max_block_size = 256;
0028 #endif
0029 
0030     CELER_FUNCTION decltype(auto) operator()(CoreTrackView const& track) const
0031     {
0032         return make_mag_field_propagator<DormandPrinceStepper>(
0033             UniformField(field.field),
0034             field.options,
0035             track.make_particle_view(),
0036             track.make_geo_view());
0037     }
0038 
0039     static CELER_CONSTEXPR_FUNCTION bool tracks_can_loop() { return true; }
0040 
0041     //// DATA ////
0042 
0043     UniformFieldParams field;
0044 };
0045 
0046 //---------------------------------------------------------------------------//
0047 }  // namespace detail
0048 }  // namespace celeritas