![]() |
|
|||
File indexing completed on 2025-02-22 10:31:22
0001 //----------------------------------*-C++-*----------------------------------// 0002 // Copyright 2022-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/AlongStepNeutralImpl.hh 0007 //---------------------------------------------------------------------------// 0008 #pragma once 0009 0010 #include "corecel/Assert.hh" 0011 #include "corecel/Macros.hh" 0012 #include "corecel/Types.hh" 0013 #include "corecel/math/Quantity.hh" 0014 0015 #include "../AlongStep.hh" 0016 0017 namespace celeritas 0018 { 0019 //---------------------------------------------------------------------------// 0020 class CoreTrackView; 0021 0022 namespace detail 0023 { 0024 //---------------------------------------------------------------------------// 0025 /*! 0026 * Helper class for along-step kernel when no MSC is in use. 0027 */ 0028 struct NoMsc 0029 { 0030 //! MSC never applies to the current track 0031 CELER_FUNCTION bool 0032 is_applicable(CoreTrackView const&, real_type step) const 0033 { 0034 CELER_ASSERT(step > 0); 0035 return false; 0036 } 0037 0038 //! No updates needed to the physical and geometric step lengths 0039 CELER_FUNCTION void limit_step(CoreTrackView const&) const {} 0040 0041 //! MSC is never applied 0042 CELER_FUNCTION void apply_step(CoreTrackView const&) const {} 0043 }; 0044 0045 //---------------------------------------------------------------------------// 0046 /*! 0047 * Class that returns zero energy loss. 0048 */ 0049 struct NoELoss 0050 { 0051 //! This calculator never returns energy loss 0052 CELER_CONSTEXPR_FUNCTION bool is_applicable(CoreTrackView const&) 0053 { 0054 return false; 0055 } 0056 0057 //! No energy loss 0058 CELER_FUNCTION auto 0059 calc_eloss(CoreTrackView const&, real_type, bool) const -> decltype(auto) 0060 { 0061 return zero_quantity(); 0062 } 0063 0064 //! No slowing down 0065 static CELER_CONSTEXPR_FUNCTION bool imprecise_range() { return false; } 0066 }; 0067 0068 //---------------------------------------------------------------------------// 0069 } // namespace detail 0070 } // namespace celeritas
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |