ImpactX
Toggle main menu visibility
Loading...
Searching...
No Matches
src
particles
wakefields
WakeConvolution.H
Go to the documentation of this file.
1
/* Copyright 2022-2026 The Regents of the University of California, through Lawrence
2
* Berkeley National Laboratory (subject to receipt of any required
3
* approvals from the U.S. Dept. of Energy). All rights reserved.
4
*
5
* This file is part of ImpactX.
6
*
7
* Authors: Alex Bojanich, Chad Mitchell, Axel Huebl
8
* License: BSD-3-Clause-LBNL
9
*/
10
#ifndef WAKE_CONVOLUTION_H
11
#define WAKE_CONVOLUTION_H
12
13
#include "
particles/ImpactXParticleContainer.H
"
14
15
#include <
AMReX_GpuContainers.H
>
16
#include <
AMReX_Math.H
>
17
#include <
AMReX_REAL.H
>
18
19
20
namespace
impactx::particles::wakefields
21
{
22
// Constants
23
constexpr
amrex::Real
Z0
= 377;
24
30
constexpr
amrex::Real
alpha_1
=
static_cast<
amrex::Real
>
(0.4648);
31
37
AMREX_GPU_HOST_DEVICE
AMREX_FORCE_INLINE
38
amrex::Real
39
unit_step
(
amrex::Real
s
)
40
{
41
using namespace
amrex::literals
;
42
43
return
s
>= 0_rt ? 1_rt : 0_rt;
44
}
45
54
amrex::Real
alpha
(
amrex::Real
s
);
55
67
amrex::Real
w_t_rf
(
68
amrex::Real
s
,
69
amrex::Real
a,
70
amrex::Real
g,
71
amrex::Real
L
72
);
73
85
amrex::Real
w_l_rf
(
86
amrex::Real
s
,
87
amrex::Real
a,
88
amrex::Real
g,
89
amrex::Real
L
90
);
91
104
AMREX_GPU_HOST_DEVICE
AMREX_FORCE_INLINE
105
amrex::Real
106
w_l_csr
(
107
amrex::Real
s
,
108
amrex::Real
R,
109
amrex::Real
const
bin_size
110
)
111
{
112
using namespace
amrex::literals
;
113
using
amrex::Math::powi
;
114
115
amrex::Real
const
rc = powi<2>(
ablastr::constant::SI::q_e
) / (4_rt *
ablastr::constant::math::pi
*
ablastr::constant::SI::epsilon_0
*
ablastr::constant::SI::m_e
* powi<2>(
ablastr::constant::SI::c
));
116
amrex::Real
const
kappa = (2_rt * rc *
ablastr::constant::SI::m_e
* powi<2>(
ablastr::constant::SI::c
)) / std::pow(3_rt, 1_rt/3_rt) / std::pow(R, 2_rt/3_rt);
117
118
return
-3_rt/2_rt * kappa / bin_size * (
unit_step
(
s
+ bin_size / 2_rt) * std::pow(std::abs(
s
+ bin_size / 2_rt), 2_rt/3_rt) -
unit_step
(
s
- bin_size / 2_rt) * std::pow(std::abs(
s
- bin_size / 2_rt), 2_rt/3_rt));
119
}
120
128
amrex::Gpu::DeviceVector<amrex::Real>
129
convolve_fft
(
130
amrex::Gpu::DeviceVector<amrex::Real>
const
& beam_profile_slope,
131
amrex::Gpu::DeviceVector<amrex::Real>
const
& wake_func,
132
amrex::Real
delta_t
133
);
134
135
}
// namespace impactx::particles::wakefields
136
137
#endif
// WAKE_CONVOLUTION_H
AMREX_FORCE_INLINE
#define AMREX_FORCE_INLINE
AMReX_GpuContainers.H
AMREX_GPU_HOST_DEVICE
#define AMREX_GPU_HOST_DEVICE
AMReX_Math.H
AMReX_REAL.H
ImpactXParticleContainer.H
amrex::Real
amrex_real Real
amrex::Gpu::DeviceVector
PODVector< T, ArenaAllocator< T > > DeviceVector
ablastr::constant::SI::c
constexpr auto c
ablastr::constant::SI::epsilon_0
constexpr auto epsilon_0
ablastr::constant::SI::m_e
constexpr auto m_e
ablastr::constant::SI::q_e
constexpr auto q_e
ablastr::constant::math::pi
constexpr auto pi
amrex::Math::powi
constexpr T powi(T x) noexcept
amrex::literals
impactx::particles::wakefields
Definition
ChargeBinning.cpp:17
impactx::particles::wakefields::alpha_1
constexpr amrex::Real alpha_1
Definition
WakeConvolution.H:30
impactx::particles::wakefields::Z0
constexpr amrex::Real Z0
Free space impedance [Ohm].
Definition
WakeConvolution.H:23
impactx::particles::wakefields::unit_step
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real unit_step(amrex::Real s)
Definition
WakeConvolution.H:39
impactx::particles::wakefields::w_l_csr
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real w_l_csr(amrex::Real s, amrex::Real R, amrex::Real const bin_size)
Definition
WakeConvolution.H:106
impactx::particles::wakefields::convolve_fft
amrex::Gpu::DeviceVector< amrex::Real > convolve_fft(amrex::Gpu::DeviceVector< amrex::Real > const &beam_profile_slope, amrex::Gpu::DeviceVector< amrex::Real > const &wake_func, amrex::Real delta_t)
Definition
WakeConvolution.cpp:66
impactx::particles::wakefields::w_l_rf
amrex::Real w_l_rf(amrex::Real s, amrex::Real a, amrex::Real g, amrex::Real L)
Definition
WakeConvolution.cpp:51
impactx::particles::wakefields::alpha
amrex::Real alpha(amrex::Real s)
Definition
WakeConvolution.cpp:29
impactx::particles::wakefields::w_t_rf
amrex::Real w_t_rf(amrex::Real s, amrex::Real a, amrex::Real g, amrex::Real L)
Definition
WakeConvolution.cpp:36
impactx::CoordSystem::s
@ s
fixed s as the independent variable
Definition
ImpactXParticleContainer.H:37
Generated by
1.17.0