Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
dfb68314
Commit
dfb68314
authored
5 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Added comment about the specific shape of phi(r) for the new MAC
parent
d37c4064
No related branches found
No related tags found
1 merge request
!1077
Improved multipole acceptance criterion (MAC)
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theory/Multipoles/fmm_summary.tex
+42
-35
42 additions, 35 deletions
theory/Multipoles/fmm_summary.tex
with
42 additions
and
35 deletions
theory/Multipoles/fmm_summary.tex
+
42
−
35
View file @
dfb68314
...
@@ -263,22 +263,22 @@ quantity is a simple upper bound for the amplitude of the multipole
...
@@ -263,22 +263,22 @@ quantity is a simple upper bound for the amplitude of the multipole
(
$
\mathsf
{
M
}_{
A,
\mathbf
{
m
}}
<
\mathsf
{
P
}_{
A,|
\mathbf
{
m
}
|
}
/
|
\mathbf
{
m
}
|
!
$
)
(
$
\mathsf
{
M
}_{
A,
\mathbf
{
m
}}
<
\mathsf
{
P
}_{
A,|
\mathbf
{
m
}
|
}
/
|
\mathbf
{
m
}
|
!
$
)
and can hence be used to estimate the importance of the terms of a given
and can hence be used to estimate the importance of the terms of a given
order in the Taylor series of the potential. Following
\cite
{
Dehnen2014
}
we
order in the Taylor series of the potential. Following
\cite
{
Dehnen2014
}
we
then consider a s
ource
cell
$
A
$
and a s
ink
cell
$
B
$
for which we evaluate
then consider a s
ink
cell
$
A
$
and a s
ource
cell
$
B
$
(figure
\ref
{
fig:fmm:cells
}
)
for which we evaluate
at order
$
p
$
the
expression
at order
$
p
$
the
scalar
\begin{equation}
\begin{equation}
E
_{
A
B
}
=
\frac
{
1
}{
M
_
A
|
\mathbf
{
R
}
|
^
p
}
\sum
_{
n=0
}^
p
\binom
{
p
}{
n
}
\mathsf
{
P
}_{
A
,n
}
E
_{
B
A,p
}
=
\frac
{
1
}{
M
_
B
|
\mathbf
{
R
}
|
^
p
}
\sum
_{
n=0
}^
p
\binom
{
p
}{
n
}
\mathsf
{
P
}_{
B
,n
}
\rho
_
B
^{
p-n
}
,
\rho
_
A
^{
p-n
}
,
\label
{
eq:fmm:e
_
ab
}
\label
{
eq:fmm:e
_
ab
}
\end{equation}
\end{equation}
with
$
M
_
A
\equiv
\mathsf
{
M
}_{
A
,
(
0
,
0
,
0
)
}$
, the sum of the mass of the
with
$
M
_
B
\equiv
\mathsf
{
M
}_{
B
,
(
0
,
0
,
0
)
}$
, the sum of the mass of the
particles in
the
cell. Note that since
$
\mathsf
{
P
}_{
A
,n
}
\leq
M
_
A
particles in cell
$
B
$
. Note that since
$
\mathsf
{
P
}_{
B
,n
}
\leq
M
_
B
\rho
_
A
^
n
$
, we have
$
E
_{
A
B
}
\leq
\left
((
\rho
_
A
+
\rho
_
B
^
n
$
, we have
$
E
_{
B
A, p
}
\leq
\left
((
\rho
_
A
+
\rho
_
B
)/
|
\mathbf
{
R
}
|
\right
)
^
p
$
, where the right-hand side is the
expression
\rho
_
B
)/
|
\mathbf
{
R
}
|
\right
)
^
p
$
, where the right-hand side is the
used in the basic opening angle condition
(
\ref
{
eq:fmm:angle
}
). We finally
expression
used in the basic opening angle condition
scale the
$
E
_{
A
B
}$
's by the relative
size of the two cells to define the
(
\ref
{
eq:fmm:angle
}
). We finally
scale the
$
E
_{
B
A,p
}$
's by the relative
error estimator
$
\tilde
{
E
}_{
A
B
}$
:
size of the two cells to define the
error estimator
$
\tilde
{
E
}_{
B
A,p
}$
:
\begin{equation}
\begin{equation}
\tilde
{
E
}_{
A
B
}
= 8
\frac
{
\max
(
\rho
_
A,
\rho
_
B)
}{
\rho
_
A +
\rho
_
B
}
E
_{
A
B
}
.
\tilde
{
E
}_{
B
A,p
}
= 8
\frac
{
\max
(
\rho
_
A,
\rho
_
B)
}{
\rho
_
A +
\rho
_
B
}
E
_{
B
A,p
}
.
\label
{
eq:fmm:e
_
ab
_
tilde
}
\label
{
eq:fmm:e
_
ab
_
tilde
}
\end{equation}
\end{equation}
As shown by
\cite
{
Dehnen2014
}
, these quantities are excellent estimators of
As shown by
\cite
{
Dehnen2014
}
, these quantities are excellent estimators of
...
@@ -286,18 +286,18 @@ the error made in computing the accelerations between two cells using the
...
@@ -286,18 +286,18 @@ the error made in computing the accelerations between two cells using the
M2L and M2P kernels at a given order. We can hence use this property to
M2L and M2P kernels at a given order. We can hence use this property to
design a new MAC by demanding that the estimated acceleration error is no
design a new MAC by demanding that the estimated acceleration error is no
larger than a certain fraction of the smallest acceleration in the sink
larger than a certain fraction of the smallest acceleration in the sink
cell
$
B
$
. This means we can use the FMM approximation between to
cell
$
A
$
. This means we can use the FMM approximation between to
approximate the accelerations in cell
$
A
$
due to the particles in cell
$
B
$
if
approximate the accelerations in cell
$
A
$
due to the particles in cell
$
B
$
if
\begin{equation}
\begin{equation}
\tilde
{
E
}_{
A
B
}
\frac
{
M
_
A
}{
|
\mathbf
{
R
}
|
^
2
}
<
\epsilon
\min
_{
b
\in
\tilde
{
E
}_{
B
A,p
}
\frac
{
M
_
B
}{
|
\mathbf
{
R
}
|
^
2
}
<
\epsilon
\min
_{
a
\in
B
}
\left
(|
\mathbf
{
a
}_
b
|
\right
)
\quad
\rm
{
and
}
\quad
\frac
{
\rho
_
A +
A
}
\left
(|
\mathbf
{
a
}_
a
|
\right
)
\quad
\rm
{
and
}
\quad
\frac
{
\rho
_
A +
\rho
_
B
}
{
|
\mathbf
{
R
}
|
}
< 1,
\rho
_
B
}
{
|
\mathbf
{
R
}
|
}
< 1,
\label
{
eq:fmm:mac
}
\label
{
eq:fmm:mac
}
\end{equation}
\end{equation}
where the
$
\mathbf
{
a
}_
b
$
are the accelerations of the particles in cell
$
B
$
where the
$
\mathbf
{
a
}_
a
$
are the accelerations of the particles in cell
$
A
$
and
$
\epsilon
$
is a tolerance parameter. Since this is self-referencing
and
$
\epsilon
$
is a tolerance parameter. Since this is self-referencing
(i.e. we need the accelerations to decide how to compute the
(i.e. we need the accelerations to decide how to compute the
accelerations), we need to use a an estimator of
$
|
\mathbf
{
a
}_
b
|
$
. In
accelerations), we need to use a an estimator of
$
|
\mathbf
{
a
}_
a
|
$
. In
\swift
, we follow the strategy used by
\gadget
and use the acceleration of
\swift
, we follow the strategy used by
\gadget
and use the acceleration of
the previous time-step
\footnote
{
On the first time-step of a simulation this
the previous time-step
\footnote
{
On the first time-step of a simulation this
value has not been computed yet. We hence run a fake 0th time-step with
value has not been computed yet. We hence run a fake 0th time-step with
...
@@ -307,41 +307,48 @@ acceleration in a given cell can be computed at the same time as the P2M
...
@@ -307,41 +307,48 @@ acceleration in a given cell can be computed at the same time as the P2M
and M2M kernels are evaluated in the tree construction phase. The second
and M2M kernels are evaluated in the tree construction phase. The second
condition in (
\ref
{
eq:fmm:mac
}
) is necessary to ensure the convergence of the
condition in (
\ref
{
eq:fmm:mac
}
) is necessary to ensure the convergence of the
Taylor expansion.
\\
Taylor expansion.
\\
One important difference between this criterion and the purely geometric
One important difference between this criterion and the purely
one (
\ref
{
eq:fmm:angle
}
) is that it is not symmetric in
$
A
\leftrightarrow
geometric one (
\ref
{
eq:fmm:angle
}
) is that it is not symmetric in
$
A
B
$
. This implies that there are cases where a multipole in cell
$
A
$
can be
\leftrightarrow
B
$
(i.e.
$
E
_{
AB,p
}
\neq
E
_{
BA,p
}$
). This implies that
used to compute the field tensors in cell
$
B
$
but the multipole in
$
B
$
there are cases where a multipole in cell
$
A
$
can be used to compute
cannot be used to compute the
$
\mathsf
{
F
}$
values of cell
$
A
$
. This affects
the field tensors in cell
$
B
$
but the multipole in
$
B
$
cannot be used
the tree walk by breaking the symmetry and potentially leading to cells of
to compute the
$
\mathsf
{
F
}$
values of cell
$
A
$
and vice versa. This
different sizes interacting.
\\
affects the tree walk by breaking the symmetry and potentially leading
In the specific case of the M2P kernel, we have
$
\rho
_
B
=
0
$
, which
to cells of different sizes interacting.
\\
In the specific case of the M2P kernel, we have
$
\rho
_
A
=
0
$
, which
simplifies some of the expressions above. In this case, at order
$
p
$
, we get:
simplifies some of the expressions above. In this case, at order
$
p
$
, we get:
\begin{equation}
\begin{equation}
E
_{
A
B
}
=
\frac
{
\mathsf
{
P
}_{
A
,p
}}{
M
_
A
|
\mathbf
{
R
}
|
^
p
}
,
\qquad
E
_{
B
A,p
}
=
\frac
{
\mathsf
{
P
}_{
B
,p
}}{
M
_
B
|
\mathbf
{
R
}
|
^
p
}
,
\qquad
\tilde
{
E
}_{
A
B
}
= 8E
_{
A
B
}
\nonumber
\tilde
{
E
}_{
B
A,p
}
= 8E
_{
B
A,p
}
\nonumber
\end{equation}
\end{equation}
Note that, in this case, only the power term of the order of the
Note that, in this case, only the power term of the order of the
scheme appears; not a sum over the lower-order ones. This leads to the
scheme appears; not a sum over the lower-order ones. This leads to the
following MAC for the M2P kernel:
following MAC for the M2P kernel:
\begin{equation}
\begin{equation}
8
\frac
{
\mathsf
{
P
}_{
A
,p
}}{
|
\mathbf
{
R
}
|
^{
p+2
}}
<
\epsilon
\min
_{
b
\in
8
\frac
{
\mathsf
{
P
}_{
B
,p
}}{
|
\mathbf
{
R
}
|
^{
p+2
}}
<
\epsilon
\min
_{
a
\in
B
}
\left
(|
\mathbf
{
a
}_
b
|
\right
)
\quad
\rm
{
and
}
\quad
\frac
{
\rho
_
A
}
A
}
\left
(|
\mathbf
{
a
}_
a
|
\right
)
\quad
\rm
{
and
}
\quad
\frac
{
\rho
_
B
}
{
|
\mathbf
{
R
}
|
}
< 1.
{
|
\mathbf
{
R
}
|
}
< 1.
\label
{
eq:fmm:mac
_
m2p
}
\label
{
eq:fmm:mac
_
m2p
}
\end{equation}
\end{equation}
The value of
$
\epsilon
$
could in principle be different than the one
The value of
$
\epsilon
$
could in principle be different than the one
used for the M2L MAC. One special case is of particular interest to
used for the M2L MAC. One special case is of particular interest to
link our expression to other results. Using the expression for order
link our expression to other results. Using the expression for order
$
2
$
and the approximation
$
\mathsf
{
P
}_{
A
,p
}
\approx
M
_
A
\rho
_
A
^
p
$
, we
$
2
$
and the approximation
$
\mathsf
{
P
}_{
B
,p
}
\approx
M
_
B
\rho
_
B
^
p
$
, we
get
get
\begin{equation}
\begin{equation}
8
\frac
{
M
_
A
}{
|
\mathbf
{
R
}
|
^
2
}
\left
(
\frac
{
\rho
_
A
}{
|
\mathbf
{
R
}
|
}
\right
)
^
2
8
\frac
{
M
_
B
}{
|
\mathbf
{
R
}
|
^
2
}
\left
(
\frac
{
\rho
_
B
}{
|
\mathbf
{
R
}
|
}
\right
)
^
2
<
\epsilon
\min
_{
b
\in
B
}
\left
(|
\mathbf
{
a
}_
b
|
\right
)
\nonumber
<
\epsilon
\min
_{
a
\in
A
}
\left
(|
\mathbf
{
a
}_
a
|
\right
)
\nonumber
\end{equation}
\end{equation}
for our MAC. This is the same expression as the adaptive opening
for our MAC. This is the same expression as the adaptive opening
angle used by
\gadget
\cite
[see eq.18 of][]
{
Springel2005
}
up to
angle used by
\gadget
\cite
[see eq.18 of][]
{
Springel2005
}
up to
numerical factors and definition of the size of a multipole (
$
\rho
$
numerical factors and definition of the size of a multipole (
$
\rho
$
vs. the cell edge). Note, however, that, in practice, since formally
vs. the cell edge). Note, however, that, in practice, since formally
$
\mathsf
{
P
}_{
A,p
}
\leq
M
_
A
\rho
_
A
^
p
$
, the dependence is slightly
$
\mathsf
{
P
}_{
B,p
}
\leq
M
_
B
\rho
_
B
^
p
$
, the dependence is slightly
different.
different.
\\
We conclude this section by noting that whilst the derivation of the
FMM equations and of the simple geometric MAC (eq.
\ref
{
eq:fmm:angle
}
)
do not make any assumptions about the functional form of
$
\varphi
(
r
)
$
,
the more advanced MAC is valid in the specific case of the
gravitational potential
$
\varphi
(
r
)
=
m
/
r
$
as can be inferred from the
$
m
/
r
^
2
$
term appearing on the LHS of the criteria (
\ref
{
eq:fmm:mac
}
)
and (
\ref
{
eq:fmm:mac
_
m2p
}
).
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment