Started to shorten init

This commit is contained in:
2019-04-22 08:29:01 +02:00
parent 0dd6a962a2
commit 405c36dfb2
+136 -116
View File
@@ -804,7 +804,9 @@ Additionally this scheme is tedious to extend to shape functions beyond CIC.
\begin{subfigure}{0.4\hsize} \begin{subfigure}{0.4\hsize}
\centering \centering
\includegraphics[width=\textwidth]{currentassignment_umeda.pdf} \includegraphics[width=\textwidth]{currentassignment_umeda.pdf}
\caption{Current deposition using the Zig-Zag algorithm by \cite{Umeda_2003}. As the particle closes from one cell to another (across the solid black line indicating the cell interface), it's trajectory is modified to go via the midpoint.} \caption{Current deposition using the Zig-Zag algorithm by \cite{Umeda_2003}. As the particle closes from one cell to another
%(across the solid black line indicating the cell interface)
, it's trajectory is modified to go via the midpoint.}
\label{fig:num:currentassignment_umeda} \label{fig:num:currentassignment_umeda}
\end{subfigure} \end{subfigure}
\caption{Charge conserving current desposition} \caption{Charge conserving current desposition}
@@ -823,18 +825,22 @@ separate displacements parallel to the grid axis that are weighted
individually. Readers that are interested in implementing this algorithm are individually. Readers that are interested in implementing this algorithm are
refered back to the excellent original paper. refered back to the excellent original paper.
The other widely used scheme in modern codes is the Zig-Zag scheme described in The other widely used scheme
%in modern codes
is the Zig-Zag scheme described in
\cite{Umeda_2003}. In this scheme particles can only cross between cells at the \cite{Umeda_2003}. In this scheme particles can only cross between cells at the
midpoint of the interface. A particle that does not naturally go through that midpoint of the interface. A particle that does not naturally go through that
point has its motion split into a motion from the starting position to the mid point has its motion split into a motion from the starting position to the mid
point, followed by a separate motion from the midpoint to the final location, point, followed by a separate motion from the midpoint to the final location,
resulting in a Zig-Zag trajectory that gave the scheme it's name. resulting in a Zig-Zag trajectory %that gave the scheme it's name.
Fig.~\ref{fig:num:currentassignment_umeda} illustrates this motion and the as illustrated in Fig.~\ref{fig:num:currentassignment_umeda}% illustrates this motion and the
resulting current for the same particle trajectory we have used before. Finding resulting current for the same particle trajectory as used before.
the midpoints for the fraction of particles that does not stay in the same cell %Finding the midpoints for the fraction of particles that does not stay in the same cell
requires some conditional code, but the upside is that the current deposition %requires some conditional code, but the upside is that the current deposition
inside each cell is slightly simpler. Overall the computational cost and %inside each cell is slightly simpler. Overall the computational cost and
noise-properties between the two deposition schemes is similar. %noise-properties between the two deposition schemes is similar.
Although the method requires some conditional code the computational cost and
noise-properties between the two deposition schemes is similar
% \begin{figure}[htbp] % \begin{figure}[htbp]
% \begin{center} % \begin{center}
@@ -859,58 +865,53 @@ better performance.
\label{subsec:num:init} \label{subsec:num:init}
We can now covered how the particle based source terms are incorporated in the %We can now covered how the particle based source terms are incorporated in the
evolution of the gridded electromagnetic quantities, how those act on the %evolution of the gridded electromagnetic quantities, how those act on the
particles and how new source terms are deposited onto the grid based on the %particles and how new source terms are deposited onto the grid based on the
updated particle properties. An important part that is still undescribed is the %updated particle properties. An important part that is still undescribed is the
setup of the initial conditions. For the field quantities on the grid these are %setup of the initial conditions. For the field quantities on the grid these are
usually simply set base on analytic expression for known equalibria. Most of %usually simply set base on analytic expression for known equalibria. Most of
them only require an inital magnetic field and have vanishing electric field. %them only require an inital magnetic field and have vanishing electric field.
Creating the inital particle population is a little bit more complicated and %Creating the inital particle population is a little bit more complicated and
can have an important influence on the noise level in the simulation. %can have an important influence on the noise level in the simulation.
The difficulty is to create a number of particles that represent the desired %The difficulty is to create a number of particles that represent the desired
distribution function $f(\vec{x},\vec{v},t_0)$. We will approach this problem %distribution function $f(\vec{x},\vec{v},t_0)$. We will approach this problem
step by step. %step by step.
The easiest case (and not actually uncommon) is constant spatial density and So far we have described how the temporal evolution of particles and fields and
and a velocity distribution that follows a non-relativistic Maxwellian. In this their interaction are done in PiC codes. Yet the initial conditions have to be
prescribed. For field quantities this is a straight forward procedure: Analytic
expressions for equilibria are used (typically the magnetic field is given and the
electric is assumed to be zero). Reproducing the desired
distribution function $f(\vec{x},\vec{v},t_0)$ is more complicated and the method
used may have a measurable impact on the noise level.
The easiest and not uncommon case is a constant spatial density and
and a non-relativistic Maxwellian velocity distribution. In this
case we can pick the initial position of the particle at random using case we can pick the initial position of the particle at random using
\begin{equation} \begin{equation}
\vec{x} = \left(L_x\cdot \mathcal{U}(0,1), L_y \cdot \mathcal{U}(0,1), L_z \cdot \mathcal{U}(0,1)\right) \quad, \vec{x} = \left(L_x\cdot \mathcal{U}(0,1), L_y \cdot \mathcal{U}(0,1), L_z \cdot \mathcal{U}(0,1)\right) \quad,
\end{equation} \end{equation}
where the three calls to the random generator using where the random generator function $\mathcal{U}$ produces three independent (pseudo-)random numbers, uniformly distributed between zero and one. The expected number of \textit{particles per cell} (\textit{ppc}) is Poisson distributed. Since the number of macroparticles is significantly smaller than the number of real particles, the statistical density fluctuations are higher in the simulation than in the reality. One easy step to remedy this to some extent is to create exactly the expected number of macro particles per cell and only choose
the function $\mathcal{U}$ produce three independent (pseudo-)random numbers,
uniformly distributed between zero and one. Some cells might receive more then
the expected number of \textit{particles per cell} -- often denoted as
\textit{ppc} --, while others receive slightly more. Given that our system has
much fewer macro particles then there are physcial particles in the scenario we
aim to simulate and each macro particles carries the charge of many physical
particles, this can lead to fluctuations in the charge density that are larger
than in the physical system. One easy step to remidy this to some extend is to
create exactly the expected number of macro particles per cell and only choose
the position inside the cell at random. This also makes it easy to represent the position inside the cell at random. This also makes it easy to represent
spatially changing densities, be computing the number of particles in each cell spatially changing densities, by computing the number of particles in each cell
from a known analytic function $n(\vec{x})$. This works well as long as the from a known analytic function $n(\vec{x})$. This works well as long as the
scale length $l_n = n / \frac{\partial\, n}{\partial{x}}$ is large compared to scale length $l_n = n / \frac{\partial\, n}{\partial{x}}$ is large compared to
the cell size $\Delta{x}$. the cell size $\Delta{x}$.
Fpr uniform densities there is also the possibility to use \textit{low For uniform densities there is also the possibility to use \textit{low
discrepancy series} such as the Halton sequence \cite{Halton_1964}, a straight discrepancy series} such as the Halton sequence \cite{Halton_1964}. This
forward extension of the van der Corput sequence to multiple dimensions. This sequence distributes particles more uniformly in the
sequence distributes particles less randomly, but more uniformly in the simulation domain. This reduces the noise level as
simulation domain. This leads to a reduced noise level that scales as $\mathcal{O}(1/N)$ with the particle number. Adding more particles would reduce the noise level only like $\mathcal{O}(1/\sqrt{N})$ . This \textit{quiet start} has been successfully used e.g. in the study of instabilities. %(see \cite{Byers_1970} for an example).
$\mathcal{O}(1/N)$ with the particle number. This is much cheaper than reducing
the noise using the $\mathcal{O}(1/\sqrt{N})$ scaling of adding more particles
randomly. This \textit{quiet start} has successfully used e.g. in the study of
instabilities (see \cite{Byers_1970} for an example).
The non-relativistic Maxwellian distribution is simply the composition of three The non-relativistic Maxwellian distribution is simply the composition of three
velocity components that individually follow a normal distribution. We can velocity components that individually follow a normal distribution:
therefore simply pick random velocities
\begin{equation} \begin{equation}
\vec{v} = \left(\mathcal{N}(u_x, v_{th}), \mathcal{N}(u_y, v_{th}), \mathcal{N}(u_z,v_{th})\right) \quad. \vec{v} = \left(\mathcal{N}(u_x, v_{th}), \mathcal{N}(u_y, v_{th}), \mathcal{N}(u_z,v_{th})\right) \quad.
\end{equation} \end{equation}
The call to $\mathcal{N}(\mu,\sigma)$ produced a random number from a normal $\mathcal{N}(\mu,\sigma)$ produces a random number from a normal
distribution with mean $\mu$ and standard deviation $\sigma$. The mean can be distribution with mean $\mu$ and standard deviation $\sigma$. The mean can be
the average drift velocity of that species (and can depend on position and the average drift velocity of that species (and can depend on position and
particle species, e.g. in the setup of a current sheet) and the standard particle species, e.g. in the setup of a current sheet) and the standard
@@ -921,16 +922,17 @@ deviation is set by the thermal speed
Note that there is a second popular definition of the thermal speed that Note that there is a second popular definition of the thermal speed that
includes a factor of two. When comparing with other codes and results this is a includes a factor of two. When comparing with other codes and results this is a
point worth double-checking. Different species of different masses will have point worth double-checking. Different species of different masses will have
different thermal speeds at the same temperature. The extension of this method different thermal speeds at the same temperature.
to include species of different temperatures for different species or spatial %The extension of this method
directions is straight forward. %to include species of different temperatures for different species or spatial
%directions is straight forward.
Some early simulations used other methods to approximate a Maxwellian %Some early simulations used other methods to approximate a Maxwellian
distribution, but on modern machines the generation of $\mathcal{N}$ using the %distribution, but on modern machines the generation of $\mathcal{N}$ using the
Box-Muller method or the ziggurat algorithm is sufficiently fast that a %Box-Muller method or the ziggurat algorithm is sufficiently fast that a
straight-forward approach performs well. This is both thanks to the fast %straight-forward approach performs well. This is both thanks to the fast
evaluation of $\log$ and trigonometric functions and to the increased %evaluation of $\log$ and trigonometric functions and to the increased
performance of the underlying generators producing pseudo-random integers. %performance of the underlying generators producing pseudo-random integers.
If the drift speed $\vec{u}$ approaches relativistic speeds, but the thermal If the drift speed $\vec{u}$ approaches relativistic speeds, but the thermal
speeds are still sufficiently low, some accuracy can be gained by generating a speeds are still sufficiently low, some accuracy can be gained by generating a
@@ -941,10 +943,10 @@ however this leads to problematic deviations from the correct distribution as
demonstrated in \cite{Melzani_2013}. Fortunately an efficient algorithm is demonstrated in \cite{Melzani_2013}. Fortunately an efficient algorithm is
described in \cite{Zenitani_2015}. described in \cite{Zenitani_2015}.
Sometimes it is desired to generate new particles from a given distribition Sometimes it is desired to generate new particles from a given distribution
during initalization, but also later in the simulation, e.g. to fill a portion during initialization, but also later in the simulation, e.g. to fill a portion
of newly expanded simulation space or to inject plasma through an inflow of newly expanded simulation space or to inject plasma through an inflow
boundary. This is possibly, but some subtelies need to be considered due to the boundary. This is possible, but some subtleties need to be considered due to the
interaction with existing fields in the domain \cite{Cartwright_2000}. interaction with existing fields in the domain \cite{Cartwright_2000}.
% particle splitting and merging % particle splitting and merging
@@ -953,77 +955,93 @@ never changes. It can however be useful to split particles in regions of
(phase-)space, where there is a low number of particles, to get better (phase-)space, where there is a low number of particles, to get better
statistics and reduce noise. Many of those particles however leave the statistics and reduce noise. Many of those particles however leave the
interesting region again and need to be merged together again to avoid a interesting region again and need to be merged together again to avoid a
balloning of the computational cost. ballooning of the computational cost.
Splitting particles in a way that conserved mass, momentum and energy is Splitting particles in a way that conserves mass, momentum and energy is
straight forward, as we can simply pick a source particle, split it into two straight forward, as we can simply pick a source particle, split it into two
equal parts of half the statistical weigth and displace them slightly from the equal parts of half the statistical weight and displace them slightly from the
centre mass to ensure that the following plasma dynamics will transport them center mass to ensure that the following plasma dynamics will transport them
separately. Some care can be taken that the displacement does not change the separately. Some care can be taken that the displacement does not change the
energy in the electromagnetic fields, but even without that the naive algorithm energy in the electromagnetic fields.
works well. The main problem is particle merging, as we will never find two %, but even without that the naive algorithm works well.
The main problem is particle merging, as we will never find two
particles of exactly equal velocities close to each other. Combining two particles of exactly equal velocities close to each other. Combining two
particles of unequal speeds however can not conserve both momentum and energy particles of unequal speeds however can not conserve both momentum and energy
at the same time \cite{Lapenta_1994}. at the same time.
%A first solution was offered by \cite{Shon_2001}, combining several particles
A first solution was offered by \cite{Shon_2001}, combining several particles %into several new particles to conserve charge density, momentum and energy.
into several new particles to conserve charge density, momentum and energy. In In simulations where many new particles are created the algorithm by
simulations where many new particles are created the algorithm by \cite{Welch_2007} that estimates the distribution function from $N \gg 2$
\cite{Welch_2007} that estimates the distribution function from $N >> 2$ particles and replaces them with $M$ ($2 \ll M < N$) new particles can be
particles and replaces them with $M$ ($2 << M < N$) new particles can be
useful. The method of \cite{Faghihi_2017} extends this to include also the useful. The method of \cite{Faghihi_2017} extends this to include also the
stress tensor. If we do not want to redraw the complete particle population, stress tensor. If we do not want to redraw the complete particle population,
e.g. because we want to preserve features in phase space that are not well e.g. because we want to preserve features in phase space that are not well
described by the first few fluid moments, it is necessary to find particles of described by the first few fluid moments, it is necessary to find particles of
similar speeds. The method by \cite{Martin_2012} to find such particle pairs or similar speeds. The method by \cite{Martin_2012} to find such particle pairs or
groups can be useful for this task. The method by \cite{Vranic_2015} aims to groups can be useful for this task. The method by \cite{Vranic_2015} aims to
merge $N$ exisiting particles into two new particles while conserving charge, merge $N$ existing particles into two new particles while conserving charge,
momentum and energy. If the reason for splitting particles is mesh-refinement momentum and energy.
in one of the rate AMR codes, the method by \cite{Drouin_2018} can help with %If the reason for splitting particles is mesh-refinement
splitting, but merging remains a problem. %in one of the rare AMR codes, the method by \cite{Drouin_2018} can help with
%splitting, but merging remains a problem.
Handling of dynamic particle numbers in a way that covers phase space well, is %Handling of dynamic particle numbers in a way that covers phase space well, is
numerically efficient and conserves all global quantities remains a problem, %numerically efficient and conserves all global quantities remains a problem,
despite all the described attempts and many others in recent year. %despite all the described attempts and many others in recent year.
\subsection*{Boundary Conditions} \subsection{Boundary Conditions}
As mentioned before it might be desireable to create new particles at the \label{subsec:num:boundary}
As mentioned before it might be desirable to create new particles at the
boundary and proper care has to be taken for to match the existing fields boundary and proper care has to be taken for to match the existing fields
there. This is a generell problem with boundary conditions in Particle-in-cell there. This is a general problem with boundary conditions in Particle-in-cell
codes. One has to handle both the fields and the particles there and should do codes. One has to handle both the fields and the particles there and should do
so in a consistent way to avoid problems. so in a consistent way to avoid problems.
Nummerically easiest are periodic boundary conditions where the cell at the Numerically easiest are periodic boundary conditions where the cell at the
upper end of a coordinate is logically wrapped around to be just below the upper end of a coordinate is logically wrapped around to be just below the
lower end of the coordinate. Particles that leave through one side are lower end of the coordinate. Particles that leave through one side are
reinjected unmodified at the other end. Periodic boundary conditions mimic reinjected unmodified at the other end. Periodic boundary conditions mimic
infinite space resomably well, as there are no fixed walls or ends to the infinite space reasonably well, as there are no fixed walls or ends to the
simulations. The periodic nature of the simulation does however select a finite simulations. The periodic nature of the simulation does however select a finite
number of modes -- out of the inifinite possibilities that exist in free space number of modes %-- out of the infinite possibilities that exist in free space --
-- that have an integer number of wavelength in the simulation box. If the that have an integer number of wavelengths in the simulation box. The number of grid
number of grid cells is small, so is the number of allowed wave modes and the limits the mode number and the spectrum.
quantization of the spectrum can have visible, undesirable effects.
Another set of boundary conditions that are resonably popular is a version of %If the number of grid cells is small, so is the number of allowed wave modes and the
Dirichlet boundary conditions for some field components. More specifically the %quantization of the spectrum can have visible, undesirable effects.
%Another set of boundary conditions that are reasonably popular is a version of
%Dirichlet boundary conditions for some field components. More specifically the
%normal component of the magnetic field is held fixed in time and the two
%tangential components of the electric field are set to zero. Geometrically this
%affects the three field components that are located at that face of the unit
%cell. The two magnetic field components on the perpendicular faces and the
%electric field on the edge normal to the boundary are not needed at the
%boundary and are not modified by evolved freely, same as in the interior of the
%domain. Vanishing electric field, even in the presence of an electric current
%is typical for a \textit{perfect electric conductor} (PEC). This boundary
%therefore mimics a metal wall with vanishing resistivity. If a realistic metal
%boundary is required, much more effort is needed. This boundary condition does
%reflect impinging electromagnetic waves.
Also popular are Dirichlet boundary conditions for some field components: The
normal component of the magnetic field is held fixed in time and the two normal component of the magnetic field is held fixed in time and the two
tangential components of the electric field are set to zero. Geometrically this tangential components of the electric field are set to zero. Geometrically this
affects the three field components that are located at that face of the unit affects the three field components that are located at that face of the unit
cell. The two magnetic field components on the perpendicular faces and the cell. The two magnetic field components on the perpendicular faces and the
electric field on the edge normal to the boundary are not needed at the electric field on the edge normal to the boundary are not needed at the
boundary and are not modified by evolved freely, same as in the interior of the boundary and are evolved freely, same as in the interior of the
domain. Vanishing electric field, even in the presence of an electric current domain. Vanishing electric field, even in the presence of an electric current
is typical for a \textit{perfect electric conductor} (PEC). This boundary is typical for a \textit{perfect electric conductor} (PEC). This boundary
therefore mimics a metal wall with vanishing conductivity. If a realistic metal therefore mimics a metal wall with vanishing resistivity. If a realistic metal
boundary is required, much more effort is needed. This boundary condition does boundary is required, much more effort is needed. This boundary condition does
reflect impinging electromagnetic waves. reflect impinging electromagnetic waves. The PEC boundary is therefore often
coupled with a reflecting boundary condition for particles. When a particle
The PEC boundary is therefore often coupled with a reflecting boundary ends outside the boundary at the end
condition for particles. When a particle ends outside the boundary at the end
of the timestep, both the component of the position normal to the wall, as well of the timestep, both the component of the position normal to the wall, as well
as the normal component of the velocity are flipped. This results in a particle as the normal component of the velocity are flipped. This process is identical to specular
that is at the same position and velocity as if it had undergone specular
reflection when reaching the boundary. reflection when reaching the boundary.
More complicated boundary conditions for particles might absorb the particle or More complicated boundary conditions for particles might absorb the particle or
@@ -1032,28 +1050,29 @@ depending on the energy of the incoming particle. This can simulate more or
less realistic metal wall including effects such as wall charging or secondary less realistic metal wall including effects such as wall charging or secondary
electron emission. electron emission.
While physcially not a boundary condition, moving simulation domains are often While physically not a boundary condition, moving simulation domains are often
implemented in terms of boundary conditions. One example is the moving window implemented in terms of boundary conditions. One example is the moving window
in the XOOPIC code \cite{Bruhwiler_2001}. Here the Eulerian mesh it not moving, in the XOOPIC code \cite{Bruhwiler_2001}. Here the Eulerian mesh it not moving,
but instead new grid cells are created on one side and populated with but instead new grid cells are created on one side and populated with
background magnetic field and fresh thermal particles. On the other side the background magnetic field and fresh thermal particles. On the other side the
grid is truncated and particles removed. If the window happens to move at the grid is truncated and particles are removed. If the window happens to move at the
speed of light -- common in simulation that follow the path of a laser pulse speed of light -- common in simulation that follow the path of a laser pulse
through a plasma (see e.g. \cite{Yu_2016}) -- no perturbation caused by the through a plasma (see e.g. \cite{Yu_2016}) -- no perturbation caused by the
downstream boundary can reach the interior of the simulation domain, greatly downstream boundary can reach the interior of the simulation domain, greatly
simplying the implementation. If the window is moving slower, a boundary that simplifying the implementation. If the window is moving slower, a boundary that
absorbes waves and does not reflect them back into the interior is needed at absorbs waves and does not reflect them back into the interior is needed at
the lower end of the moving window. the lower end of the moving window.
This brings us to the topic of absorbing boundary conditions. These have been a This brings us to the topic of absorbing boundary conditions. These have been a
problem for a long time. Initially Liao boundary conditions \cite{Liao_1984} problem for a long time. Initially Liao boundary conditions \cite{Liao_1984}
and Mur \cite{Mur_1981} have been used. These boundary condition (and others) and Mur \cite{Mur_1981} have been used. These boundary condition are described
are described in detail in the great book on FDTD methods by in detail in the great book on FDTD methods by \cite{Taflove_2000}. The problem
\cite{Taflove_2000}. The problem with these boundary conditions is that they with these boundary conditions is that they
rely on fixed waves speeds. The presence of the plasma changes the wave speed rely on fixed waves speeds. The presence of the plasma changes the wave speed.
from the speed of light to a lower speed that might depend on wavelength, %from the speed of light to a lower speed that might depend on wavelength,
incident angle and plasma parameters such as the magnetizations. This makes is %incident angle and plasma parameters such as the magnetizations
This makes is
very hard to absorb all wave modes that reach the boundary sufficiently well. very hard to absorb all wave modes that reach the boundary sufficiently well.
A great step forward was the development of the \textit{Perfectly Matched A great step forward was the development of the \textit{Perfectly Matched
@@ -1064,7 +1083,7 @@ the material is identical to the adject free space. Therefore the refractive
index does not change from free space to the material layer and now waves are index does not change from free space to the material layer and now waves are
reflected. Inside the material the wave is however damped, attenuating before reflected. Inside the material the wave is however damped, attenuating before
it reaches the actual boundary. There a simple boundary condition such as PEC it reaches the actual boundary. There a simple boundary condition such as PEC
can be choosen. And wave that does reach the boundary and gets reflected is can be chosen. And wave that does reach the boundary and gets reflected is
attenuated a second time on the way out, greatly improving performance of this attenuated a second time on the way out, greatly improving performance of this
scheme. Several different formulations of PML have been developed such as scheme. Several different formulations of PML have been developed such as
split-PML (where each electric and magnetic field component inside the boundary split-PML (where each electric and magnetic field component inside the boundary
@@ -1077,7 +1096,7 @@ different methods and their connections.
Even before the development of these methods was completed, PML conditions were Even before the development of these methods was completed, PML conditions were
used in Particle-in-Cell simulations, see e.g. \cite{Pasik_1999, Pukhov_1999}. used in Particle-in-Cell simulations, see e.g. \cite{Pasik_1999, Pukhov_1999}.
PML boundary conditions are often combined with particle boundaries that absorb PML boundary conditions are often combined with particle boundaries that absorb
outgoing particles and replace them in some scheme to simuate the presence of a outgoing particles and replace them in some scheme to simulate the presence of a
thermal plasma bath outside the simulation domain that can act as the source of thermal plasma bath outside the simulation domain that can act as the source of
unperturbed upstream. This has been used in particular in the simulation of unperturbed upstream. This has been used in particular in the simulation of
magnetic reconnection, where the removal of plasma in the outflow regions and magnetic reconnection, where the removal of plasma in the outflow regions and
@@ -1087,16 +1106,17 @@ Klimas_2008, Ohtani_2009}).
Besides the injection of thermal plasma on the boundary it is also possible to Besides the injection of thermal plasma on the boundary it is also possible to
inject electromagnetic waves to study their propagation. This can either be inject electromagnetic waves to study their propagation. This can either be
achieved by the means of an artifical current, acting as an antenna or by achieved by the means of an artificial current, acting as an antenna or by
manipulating the electromagnetic field directly. More complicated inject manipulating the electromagnetic field directly. More complicated inject
schemes that allow for the injection of realistic laser pulses schemes that allow for the injection of realistic laser pulses
(\cite{Thiele_2016}), of oblique waves with arbitray envelops (\cite{Thiele_2016}), of oblique waves with arbitrary envelops
(\cite{Perez_2018}) or of magnetized plasma without unwanted numerical noise (\cite{Perez_2018}) or of magnetized plasma without unwanted numerical noise
(\cite{Kilian_2018}) are possible as well, but require a bit of care. (\cite{Kilian_2018}) are possible as well, but require a bit of care.
% Eliasson_2002.pdf outflow condition for fourier transformed vlasov-poison system % Eliasson_2002.pdf outflow condition for fourier transformed vlasov-poison system
\subsection*{Diagnostics} \subsection{Diagnostics}
\label{subsec:num:diag}
As much fun as it can be to write and run a Particle-in-Cell code, the ultimate As much fun as it can be to write and run a Particle-in-Cell code, the ultimate
goal is to produce output that can be used to gain understanding of the goal is to produce output that can be used to gain understanding of the
@@ -1147,7 +1167,7 @@ Averaging over one or two dimensions to obtain line profiles or two-dimensional
selections is an option. Alternatively lineouts or two-dimensional cuts can be selections is an option. Alternatively lineouts or two-dimensional cuts can be
useful. If points of interest are known beforehand or can easily be computed on useful. If points of interest are known beforehand or can easily be computed on
the fly it is interesting to output time histories of those points at high the fly it is interesting to output time histories of those points at high
cadance. If a global overview is needed, but not the full resolutions, it is cadence. If a global overview is needed, but not the full resolutions, it is
possible to output a downsampled grid. Care should be taken to apply a digital possible to output a downsampled grid. Care should be taken to apply a digital
low-pass filter -- such as a Kaiser window \cite{Kaiser_1980} -- before the low-pass filter -- such as a Kaiser window \cite{Kaiser_1980} -- before the
decimation to avoid aliasing. decimation to avoid aliasing.
@@ -1155,11 +1175,11 @@ decimation to avoid aliasing.
In some cases it is necessary to restart the code, either due to reaching a In some cases it is necessary to restart the code, either due to reaching a
wallclock limit, or due to a compute node crashing (this is actually an wallclock limit, or due to a compute node crashing (this is actually an
increasing problems with supercomputers pushing the 10000 limit and increasing problems with supercomputers pushing the 10000 limit and
mean-time-between-failures meassured in days at best). Also some analysis can mean-time-between-failures measured in days at best). Also some analysis can
only be performed as post-processing, either due to poor scalability or because only be performed as post-processing, either due to poor scalability or because
it is actively being developed based on the simulation results. In this case, it is actively being developed based on the simulation results. In this case,
the pull particle information needs to be stored. Again direct binary dumps or the pull particle information needs to be stored. Again direct binary dumps or
higher-level self-desribing formats are the two main possibilities. Some codes higher-level self-describing formats are the two main possibilities. Some codes
even implement both, the high-level format for scientific analysis and binary even implement both, the high-level format for scientific analysis and binary
dumps that are overwritten periodically as faster checkpoints that are only dumps that are overwritten periodically as faster checkpoints that are only
used for restarts. used for restarts.
@@ -1182,7 +1202,7 @@ calculation of radiation spectra. This is different from the spectrum of the
field inside the simulation domain that is limited to frequencies that are field inside the simulation domain that is limited to frequencies that are
explicitly resolved. Often there is synchrotron or inverse-Compton radiation at explicitly resolved. Often there is synchrotron or inverse-Compton radiation at
much higher frequenies that can be calculated separately. See much higher frequenies that can be calculated separately. See
\cite{Pausch_2014,Pausch_2018} on how to implement and properly test such \cite{Pausch_2018} on how to implement and properly test such
radiation diagnostics. Some recent codes include the production of gamma rays radiation diagnostics. Some recent codes include the production of gamma rays
and electron-positron pairs \cite{Nerush_2017}. This is especially relevant for and electron-positron pairs \cite{Nerush_2017}. This is especially relevant for
the nascent field of pulsar magnetosphere simulations, where the back reaction the nascent field of pulsar magnetosphere simulations, where the back reaction