... | ... | @@ -32,7 +32,7 @@ The Particle-Mesh (PM) solver is one of the oldest improvements over the |
|
|
PP solver. Still one of the best references is the book by R.W. Hockney
|
|
|
& J.W. Eastwood [hockney]. The PM solver introduces a discretization of
|
|
|
space. The rectangular computation domain
|
|
|
latexmath:[\Omega:=[-L_x,L_x]\times[-L_y,L_y]\times[-L_t,L_t]], just
|
|
|
latexmath:[\Omega:=[-L_x,L_x\]\times[-L_y,L_y\]\times[-L_t,L_t\]], just
|
|
|
big enough to include all particles, is segmented into a regular mesh of
|
|
|
latexmath:[M=M_x\times M_y\times M_t] grid points. For the discussion
|
|
|
below we assume latexmath:[N=M_x=M_y=M_t].
|
... | ... | @@ -62,14 +62,19 @@ open-ended pipe with various geometries |
|
|
|
|
|
The solution of the Poisson equation,
|
|
|
|
|
|
latexmath:[\[%\label{ }
|
|
|
\nabla^2\phi=-\rho/\epsilon_0,\]]
|
|
|
[latexmath]
|
|
|
++++
|
|
|
\nabla^2\phi=-\rho/\epsilon_0,
|
|
|
++++
|
|
|
|
|
|
for the scalar potential, latexmath:[\phi], due to a charge density,
|
|
|
latexmath:[\rho], and appropriate boundary conditions, can be
|
|
|
expressed as,
|
|
|
|
|
|
latexmath:[\[\phi(x,y,z)=\int\int\int{\mathrm{d}x' \,\mathrm{d}y' \,\mathrm{d}z'}\rho(x',y',z') G(x,x',y,y',z,z'),\]]
|
|
|
[latexmath]
|
|
|
++++
|
|
|
\phi(x,y,z)=\int\int\int{\mathrm{d}x' \,\mathrm{d}y' \,\mathrm{d}z'}\rho(x',y',z') G(x,x',y,y',z,z'),
|
|
|
++++
|
|
|
|
|
|
where latexmath:[G(x,x',y,y',z,z')] is the Green function, subject to
|
|
|
the appropriate boundary conditions, describing the contribution of a
|
... | ... | @@ -78,19 +83,28 @@ an observation location latexmath:[(x,y,z)]. |
|
|
|
|
|
For an isolated distribution of charge this reduces to
|
|
|
|
|
|
latexmath:[\[\phi(x,y,z)=\int\int\int{\mathrm{d}x' \,\mathrm{d}y' \,\mathrm{d}z'}\rho(x',y',z') G(x-x',y-y',z-z'),
|
|
|
\label{eq:convolutionsolution}\]]
|
|
|
[latexmath]
|
|
|
++++
|
|
|
\phi(x,y,z)=\int\int\int{\mathrm{d}x' \,\mathrm{d}y' \,\mathrm{d}z'}\rho(x',y',z') G(x-x',y-y',z-z'),
|
|
|
\label{eq:convolutionsolution}
|
|
|
++++
|
|
|
|
|
|
where
|
|
|
|
|
|
latexmath:[\[G(u,v,w)={\frac{1}{\sqrt{u^2+v^2+w^2}}}.
|
|
|
\label{eq:isolatedgreenfunction}\]]
|
|
|
[latexmath]
|
|
|
++++
|
|
|
G(u,v,w)={\frac{1}{\sqrt{u^2+v^2+w^2}}}.
|
|
|
\label{eq:isolatedgreenfunction}
|
|
|
++++
|
|
|
|
|
|
A simple discretization of Equation [convolutionsolution] on a Cartesian
|
|
|
grid with cell size latexmath:[(h_x,h_y,h_z)] leads to,
|
|
|
|
|
|
latexmath:[\[\phi_{i,j,k}=h_x h_y h_z \sum_{i'=1}^{M_x}\sum_{j'=1}^{M_y}\sum_{k'=1}^{M_t} \rho_{i',j',k'}G_{i-i',j-j',k-k'},
|
|
|
\label{eq:openbruteforceconvolution}\]]
|
|
|
[latexmath]
|
|
|
++++
|
|
|
\phi_{i,j,k}=h_x h_y h_z \sum_{i'=1}^{M_x}\sum_{j'=1}^{M_y}\sum_{k'=1}^{M_t} \rho_{i',j',k'}G_{i-i',j-j',k-k'},
|
|
|
\label{eq:openbruteforceconvolution}
|
|
|
++++
|
|
|
|
|
|
where latexmath:[\rho_{i,j,k}] and latexmath:[G_{i-i',j-j',k-k'}]
|
|
|
denote the values of the charge density and the Green function,
|
... | ... | @@ -104,13 +118,16 @@ FFTs can be used to compute convolutions by appropriate zero-padding of |
|
|
the sequences. Discrete convolutions arise in solving the Poisson
|
|
|
equation, and one is typically interested in the following,
|
|
|
|
|
|
latexmath:[\[\bar{\phi}_j=\sum_{k=0}^{K-1}\bar{\rho}_k \bar{G}_{j-k}\quad,
|
|
|
[latexmath]
|
|
|
++++
|
|
|
\bar{\phi}_j=\sum_{k=0}^{K-1}\bar{\rho}_k \bar{G}_{j-k}\quad,
|
|
|
\begin{array}{l}
|
|
|
j=0,\ldots,J-1 \\
|
|
|
k=0,\ldots,K-1 \\
|
|
|
j-k=-(K-1),\ldots,J-1 \\
|
|
|
\end{array}
|
|
|
\label{eq:bruteforceconvolution}\]]
|
|
|
\label{eq:bruteforceconvolution}
|
|
|
++++
|
|
|
|
|
|
where latexmath:[\bar{G}] corresponds to the free space Green
|
|
|
function, latexmath:[\bar{\rho}] corresponds to the charge density,
|
... | ... | @@ -122,39 +139,82 @@ latexmath:[\{\bar{G}_m\}] has latexmath:[M=J+K-1] elements. |
|
|
One can zero-pad the sequences to a length latexmath:[N\ge M] and use
|
|
|
FFT’s to efficiently obtain the latexmath:[\{\bar{\phi}_j\}] in the
|
|
|
unpadded region. This defines a zero-padded charge density,
|
|
|
latexmath:[\rho], latexmath:[\[\rho_k=\left\{
|
|
|
latexmath:[\rho],
|
|
|
|
|
|
[latexmath]
|
|
|
++++
|
|
|
\rho_k=\left\{
|
|
|
\begin{array}{l l}
|
|
|
\bar{\rho}_k & \quad \text{if }k=0,\ldots,K-1 \\
|
|
|
0 & \quad \text{if }k=K,\ldots,N-1. \\
|
|
|
\end{array}\right.\]] Define a periodic Green function,
|
|
|
latexmath:[G_m], as follows, latexmath:[\[G_m=\left\{
|
|
|
\end{array}\right.
|
|
|
++++
|
|
|
|
|
|
Define a periodic Green function,
|
|
|
latexmath:[G_m], as follows,
|
|
|
|
|
|
[latexmath]
|
|
|
++++
|
|
|
G_m=\left\{
|
|
|
\begin{array}{l l}
|
|
|
\bar{G}_m & \quad \text{if }m=-(K-1),\ldots,J-1 \\
|
|
|
0 & \quad \text{if }m=J,\ldots,N-K, \\
|
|
|
G_{m+iN}=G_{m} & \quad \text{for } i \text{ integer }.
|
|
|
\end{array}\right.
|
|
|
\label{eq:periodicgreenfunction}G\]] Now consider the sum
|
|
|
latexmath:[\[{\phi}_j=\frac{1}{N}\sum_{k=0}^{N-1} W^{-jk}
|
|
|
\label{eq:periodicgreenfunction}G
|
|
|
++++
|
|
|
|
|
|
Now consider the sum
|
|
|
|
|
|
[latexmath]
|
|
|
++++
|
|
|
{\phi}_j=\frac{1}{N}\sum_{k=0}^{N-1} W^{-jk}
|
|
|
\left(\sum_{n=0}^{N-1} \rho_n W^{nk}\right)
|
|
|
\left(\sum_{m=0}^{N-1} G_m W^{mk}\right),
|
|
|
~~~~~~0 \le j \le N-1,
|
|
|
\label{eq:fftconvolution}\]] where latexmath:[W=e^{-2\pi i/N}]. This
|
|
|
\label{eq:fftconvolution}
|
|
|
++++
|
|
|
|
|
|
where latexmath:[W=e^{-2\pi i/N}]. This
|
|
|
is just the FFT-based convolution of latexmath:[\{\rho_k\}] with
|
|
|
latexmath:[\{G_m\}]. Then, latexmath:[\[{\phi}_j=
|
|
|
latexmath:[\{G_m\}]. Then,
|
|
|
|
|
|
[latexmath]
|
|
|
++++
|
|
|
{\phi}_j=
|
|
|
\sum_{n=0}^{K-1}~
|
|
|
\sum_{m=0}^{N-1} \bar{\rho}_n G_m
|
|
|
\frac{1}{N}\sum_{k=0}^{N-1} W^{(m+n-j)k}
|
|
|
~~~~~~0 \le j \le N-1.\]] Now use the relation
|
|
|
latexmath:[\[\sum_{k=0}^{N-1} W^{(m+n-j)k}= N \delta_{m+n-j,iN}~~~~~(i~\rm an~integer).\]]
|
|
|
~~~~~~0 \le j \le N-1.
|
|
|
++++
|
|
|
|
|
|
Now use the relation
|
|
|
|
|
|
[latexmath]
|
|
|
++++
|
|
|
\sum_{k=0}^{N-1} W^{(m+n-j)k}= N \delta_{m+n-j,iN}~~~~~(i~\rm an~integer).
|
|
|
++++
|
|
|
|
|
|
It follows that
|
|
|
latexmath:[\[{\phi}_j=\sum_{n=0}^{K-1}~\bar{\rho}_n G_{j-n+iN}
|
|
|
~~~~~~0 \le j \le N-1.\]] But latexmath:[G] is periodic with period
|
|
|
|
|
|
[latexmath]
|
|
|
++++
|
|
|
{\phi}_j=\sum_{n=0}^{K-1}~\bar{\rho}_n G_{j-n+iN}
|
|
|
~~~~~~0 \le j \le N-1.
|
|
|
++++
|
|
|
|
|
|
But latexmath:[G] is periodic with period
|
|
|
latexmath:[N]. Hence,
|
|
|
latexmath:[\[{\phi}_j=\sum_{n=0}^{K-1}~\bar{\rho}_n G_{j-n}
|
|
|
|
|
|
[latexmath]
|
|
|
++++
|
|
|
{\phi}_j=\sum_{n=0}^{K-1}~\bar{\rho}_n G_{j-n}
|
|
|
~~~~~~0 \le j \le N-1.
|
|
|
\label{eq:finaleqn}\]] In the physical (unpadded) region,
|
|
|
latexmath:[j\in \left[0,J-1\right]], so the quantity latexmath:[j-n]
|
|
|
\label{eq:finaleqn}
|
|
|
++++
|
|
|
|
|
|
In the physical (unpadded) region,
|
|
|
latexmath:[j\in \left[0,J-1\right\]], so the quantity latexmath:[j-n]
|
|
|
in Equation [finaleqn] satisfies latexmath:[-(K-1)\le j-n \le J-1]. In
|
|
|
other words the values of latexmath:[G_{j-n}] are identical to
|
|
|
latexmath:[\bar{G}_{j-n}]. Hence, in the physical region the FFT-based
|
... | ... | @@ -185,13 +245,19 @@ latexmath:[W^{-j k}] and latexmath:[W^{m k}] are replaced by |
|
|
latexmath:[W^{j k}] and latexmath:[W^{-m k}], respectively, in
|
|
|
Equation [fftconvolution]. In other words, the FFT-based approach can be
|
|
|
used to compute
|
|
|
latexmath:[\[\bar{\phi}_j=\sum_{k=0}^{K-1}\bar{\rho}_k \bar{G}_{j+k}\quad,
|
|
|
|
|
|
[latexmath]
|
|
|
++++
|
|
|
\bar{\phi}_j=\sum_{k=0}^{K-1}\bar{\rho}_k \bar{G}_{j+k}\quad,
|
|
|
\begin{array}{l}
|
|
|
j=0,\ldots,J-1 \\
|
|
|
k=0,\ldots,K-1 \\
|
|
|
j-k=-(K-1),\ldots,J-1 \\
|
|
|
\end{array}
|
|
|
\label{eq:bruteforcecorrelation}\]] simply by changing the direction of
|
|
|
\label{eq:bruteforcecorrelation}
|
|
|
++++
|
|
|
|
|
|
simply by changing the direction of
|
|
|
the Fourier transform of the Green function and changing the direction
|
|
|
of the final Fourier transform.
|
|
|
|
... | ... | @@ -202,8 +268,11 @@ Algorithm used in _OPAL_ |
|
|
As a result, the solution of Equation [openbruteforceconvolution] is
|
|
|
then given by
|
|
|
|
|
|
latexmath:[\[\phi_{i,j,k}=h_x h_y h_z \text{FFT}^{-1} \{ ( \text{FFT}\{\rho_{i,j,k}\}) ( \text{FFT}\{G_{i,j,k}\}) \}
|
|
|
\label{eq:oneterm}\]]
|
|
|
[latexmath]
|
|
|
++++
|
|
|
\phi_{i,j,k}=h_x h_y h_z \text{FFT}^{-1} \{ ( \text{FFT}\{\rho_{i,j,k}\}) ( \text{FFT}\{G_{i,j,k}\}) \}
|
|
|
\label{eq:oneterm}
|
|
|
++++
|
|
|
|
|
|
where the notation has been introduced that
|
|
|
latexmath:[\text{FFT}\{ . \}] denotes a forward FFT in all 3
|
... | ... | @@ -248,7 +317,7 @@ The `FIELDSOLVER` Command |
|
|
See Table [fieldsolvercmd] for a summary of the Fieldsolver command.
|
|
|
|
|
|
.Fieldsolver command summary
|
|
|
[cols="<,<",options="header",]
|
|
|
[cols="<1,<4",options="header",]
|
|
|
|=======================================================================
|
|
|
|Command |Purpose
|
|
|
|`FIELDSOLVER` |Specify a fieldsolver
|
... | ... | @@ -394,11 +463,11 @@ Define Preconditioner Behavior |
|
|
The behavior of the preconditioner can be: `STD`, `HIERARCHY` or
|
|
|
`REUSE`. This argument is only relevant when using the `MG` solver and
|
|
|
should *only be set if the consequences to simulation and solver are
|
|
|
evident*. A short description is given in
|
|
|
Table [preconditioner_behaviour].
|
|
|
evident*. A short description is given in the
|
|
|
Table below.
|
|
|
|
|
|
.Preconditioner behavior command summary
|
|
|
[cols="<,<",options="header",]
|
|
|
[cols="1<,4<",options="header",]
|
|
|
|=======================================================================
|
|
|
|Value |Behavior
|
|
|
|`STD` |The preconditioner is rebuilt in every time step (enabled by
|
... | ... | @@ -421,7 +490,7 @@ latexmath:[\mathrm{d} E] is again small and hence the electrostatic |
|
|
approximation valid. In case of a cyclotron see Section [cyclotron] the
|
|
|
number of energy bins must be at minimum the number of neighboring
|
|
|
bunches (`NNEIGHBB`) i.e.
|
|
|
latexmath:[\mathrm{ENBINS} \le mathrm{NNEIGHBB}].
|
|
|
latexmath:[\mathrm{ENBINS} \le \mathrm{NNEIGHBB}].
|
|
|
|
|
|
The variable `MINSTEPFORREBIN` defines the number of integration step
|
|
|
that have to pass until all energy bins are merged into one.
|
... | ... | @@ -439,7 +508,7 @@ requires following ingredients: |
|
|
holds for all levels in all directions.
|
|
|
* Mesh refinement strategy, specified by `AMR_TAGGING`. Depending on the
|
|
|
tagging scheme, further keywords can be used. A summary is given in
|
|
|
Table [tagging_strategies].
|
|
|
the Table below.
|
|
|
|
|
|
.Mesh refinement strategies
|
|
|
[cols="<,<",options="header",]
|
... | ... | @@ -458,8 +527,8 @@ factor `AMR_SCALING` |
|
|
|`MOMENTA` |It performs a loop over all particles of a level and
|
|
|
computes the dot product of the momenta. Every cell that contains a
|
|
|
particle with
|
|
|
latexmath:[||\mathbf{p}|| \ge \alpha \max_{level} ||\mathbf{p}||] is
|
|
|
refined. The scalar latexmath:[\alpha\in[0, 1]] is a user-defined
|
|
|
latexmath:[\|\|\mathbf{p}\|\| \ge \alpha \max_{level} \|\|\mathbf{p}\|\|] is
|
|
|
refined. The scalar latexmath:[\alpha\in[0, 1\]] is a user-defined
|
|
|
value `AMR_SCALING`.
|
|
|
|
|
|
|`CHARGE_DENSITY` |If the charge density of a cell is greater or equal
|
... | ... | |