File indexing completed on 2025-09-18 09:09:04
0001
0002
0003
0004
0005
0006
0007 #pragma once
0008
0009 #include "corecel/Assert.hh"
0010 #include "corecel/Macros.hh"
0011 #include "corecel/math/Algorithms.hh"
0012 #include "celeritas/Quantities.hh"
0013 #include "celeritas/geo/GeoTrackView.hh"
0014 #include "celeritas/phys/ParticleTrackView.hh"
0015
0016 #include "FieldDriverOptions.hh"
0017 #include "FieldPropagator.hh"
0018 #include "FieldSubstepper.hh"
0019 #include "MagFieldEquation.hh"
0020
0021 namespace celeritas
0022 {
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 template<template<class EquationT> class IntegratorT, class FieldT>
0035 CELER_FUNCTION decltype(auto)
0036 make_mag_field_integrator(FieldT&& field, units::ElementaryCharge charge)
0037 {
0038 using Equation_t = MagFieldEquation<FieldT>;
0039 return IntegratorT<Equation_t>{
0040 Equation_t{::celeritas::forward<FieldT>(field), charge}};
0041 }
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058 template<class IntegratorT, class GTV>
0059 CELER_FUNCTION decltype(auto)
0060 make_field_propagator(IntegratorT&& integrate,
0061 FieldDriverOptions const& options,
0062 ParticleTrackView const& particle,
0063 GTV&& geometry)
0064 {
0065 return FieldPropagator{
0066 FieldSubstepper{options, ::celeritas::forward<IntegratorT>(integrate)},
0067 particle,
0068 ::celeritas::forward<GTV>(geometry)};
0069 }
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086 template<template<class EquationT> class IntegratorT, class FieldT, class GTV>
0087 CELER_FUNCTION decltype(auto)
0088 make_mag_field_propagator(FieldT&& field,
0089 FieldDriverOptions const& options,
0090 ParticleTrackView const& particle,
0091 GTV&& geometry)
0092 {
0093 return make_field_propagator(
0094 make_mag_field_integrator<IntegratorT>(
0095 ::celeritas::forward<FieldT>(field), particle.charge()),
0096 options,
0097 particle,
0098 ::celeritas::forward<GTV>(geometry));
0099 }
0100
0101
0102 }