Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
QuickSched
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
QuickSched
Commits
6e5380ba
Commit
6e5380ba
authored
10 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Corrected acceleration equations in the BH case.
parent
be7a8787
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/theory/multipoles.tex
+76
-15
76 additions, 15 deletions
examples/theory/multipoles.tex
with
76 additions
and
15 deletions
examples/theory/multipoles.tex
+
76
−
15
View file @
6e5380ba
...
@@ -106,9 +106,9 @@ notation.\\
...
@@ -106,9 +106,9 @@ notation.\\
1-st order:
1-st order:
\begin{eqnarray}
\begin{eqnarray}
D
_{
(1,0,0)
}
(
\rr
)
&
=
&
\partial
_
x
\phi
(
\rr
)~=
\frac
{
G
}{
|
\rr
|
^
3
}
r
_
x
\\
D
_{
(1,0,0)
}
(
\rr
)
&
=
&
\partial
_
x
\phi
(
\rr
)~=
-
\frac
{
G
}{
|
\rr
|
^
3
}
r
_
x
\\
D
_{
(0,1,0)
}
(
\rr
)
&
=
&
\partial
_
y
\phi
(
\rr
)~=
\frac
{
G
}{
|
\rr
|
^
3
}
r
_
y
\\
D
_{
(0,1,0)
}
(
\rr
)
&
=
&
\partial
_
y
\phi
(
\rr
)~=
-
\frac
{
G
}{
|
\rr
|
^
3
}
r
_
y
\\
D
_{
(0,0,1)
}
(
\rr
)
&
=
&
\partial
_
z
\phi
(
\rr
)~=
\frac
{
G
}{
|
\rr
|
^
3
}
r
_
z
D
_{
(0,0,1)
}
(
\rr
)
&
=
&
\partial
_
z
\phi
(
\rr
)~=
-
\frac
{
G
}{
|
\rr
|
^
3
}
r
_
z
\end{eqnarray}
\end{eqnarray}
2-nd order:
2-nd order:
...
@@ -124,6 +124,23 @@ D_{(0,1,1)} &=& \partial_{yz} \phi(\rr)~= \frac{3Gr_yr_z}{|\rr|^5}\\
...
@@ -124,6 +124,23 @@ D_{(0,1,1)} &=& \partial_{yz} \phi(\rr)~= \frac{3Gr_yr_z}{|\rr|^5}\\
D
_{
(1,0,1)
}
&
=
&
\partial
_{
xz
}
\phi
(
\rr
)~=
\frac
{
3Gr
_
xr
_
z
}{
|
\rr
|
^
5
}
D
_{
(1,0,1)
}
&
=
&
\partial
_{
xz
}
\phi
(
\rr
)~=
\frac
{
3Gr
_
xr
_
z
}{
|
\rr
|
^
5
}
\end{eqnarray}
\end{eqnarray}
3-rd order:
\begin{eqnarray}
D
_{
(3,0,0)
}
&
=
&
\partial
_{
xxx
}
\phi
(
\rr
)~= -
\frac
{
15Gr
_
x
^
3
}{
|
\rr
|
^
7
}
+
\frac
{
9Gr
_
x
}{
|
\rr
|
^
5
}
\\
D
_{
(1,2,0)
}
&
=
&
\partial
_{
xyy
}
\phi
(
\rr
)~= -
\frac
{
15Gr
_
xr
_
y
^
2
}{
|
\rr
|
^
7
}
+
\frac
{
3Gr
_
x
}{
|
\rr
|
^
5
}
\\
D
_{
(1,0,2)
}
&
=
&
\partial
_{
xzz
}
\phi
(
\rr
)~= -
\frac
{
15Gr
_
xr
_
z
^
2
}{
|
\rr
|
^
7
}
+
\frac
{
3Gr
_
x
}{
|
\rr
|
^
5
}
\\
D
_{
(2,1,0)
}
&
=
&
\partial
_{
xxy
}
\phi
(
\rr
)~= -
\frac
{
15Gr
_
x
^
2r
_
y
}{
|
\rr
|
^
7
}
+
\frac
{
3Gr
_
y
}{
|
\rr
|
^
5
}
\\
D
_{
(2,0,1)
}
&
=
&
\partial
_{
xxz
}
\phi
(
\rr
)~= -
\frac
{
15Gr
_
x
^
2r
_
z
}{
|
\rr
|
^
7
}
+
\frac
{
3Gr
_
z
}{
|
\rr
|
^
5
}
\\
D
_{
(1,1,1)
}
&
=
&
\partial
_{
xyz
}
\phi
(
\rr
)~= -
\frac
{
15Gr
_
xr
_
yr
_
z
}{
|
\rr
|
^
7
}
\end{eqnarray}
\section
{
B-H potential and accelerations
}
\section
{
B-H potential and accelerations
}
...
@@ -168,9 +185,21 @@ The last two expressions are used in the Quickshed example code as well as in
...
@@ -168,9 +185,21 @@ The last two expressions are used in the Quickshed example code as well as in
Bonsai. Gadget only uses the first term in each expression, avoiding the
Bonsai. Gadget only uses the first term in each expression, avoiding the
construction of the matrices
$
\ii
{
A
}$
. In practice, the 2-nd order
construction of the matrices
$
\ii
{
A
}$
. In practice, the 2-nd order
accurate B-H method requires the storage of 10 variables per cell (
$
M
_{{
\rm
accurate B-H method requires the storage of 10 variables per cell (
$
M
_{{
\rm
tot
}
,A
}
,
\muu
_
A,
\ii
{
A
}$
).
tot
}
,A
}
,
\muu
_
A,
\ii
{
A
}$
).
\\
\section
{
FMM Field tensors
}
The accelerations can also written using Dehnen's short notation:
\begin{eqnarray}
a
_{
i,x
}
&
=
&
\sum
_{
\bf
n
}
M
_{
\bf
n
}
(
\muu
_
A) D
_{{
\bf
n
}
+(1,0,0)
}
(
\muu
_
A -
\p
{
i
}
)
\\
a
_{
i,y
}
&
=
&
\sum
_{
\bf
n
}
M
_{
\bf
n
}
(
\muu
_
A) D
_{{
\bf
n
}
+(0,1,0)
}
(
\muu
_
A -
\p
{
i
}
)
\\
a
_{
i,z
}
&
=
&
\sum
_{
\bf
n
}
M
_{
\bf
n
}
(
\muu
_
A) D
_{{
\bf
n
}
+(0,0,1)
}
(
\muu
_
A -
\p
{
i
}
)
\end{eqnarray}
\section
{
FMM Field tensors for potential
}
Instead of computing the potential and accelerations of each particle, field
Instead of computing the potential and accelerations of each particle, field
tensors (generated by the set of particles A) at position
$
\muu
_
B
$
can
tensors (generated by the set of particles A) at position
$
\muu
_
B
$
can
...
@@ -187,7 +216,7 @@ following set of expressions.\\
...
@@ -187,7 +216,7 @@ following set of expressions.\\
Monopole:
Monopole:
\begin{eqnarray}
\begin{eqnarray}
F
_{
(0,0,0)
}
(
\muu
_
B) ~=~ N
_
B
&
=
&
\sum
_{
|
{
\bf
m
}
|
\leq
2
}
M
_{
\bf
F
_{
(0,0,0)
}
(
\muu
_
B) ~=~ N
_
{
BA
}
&
=
&
\sum
_{
|
{
\bf
m
}
|
\leq
2
}
M
_{
\bf
m
}
(
\muu
_
A)D
_{{
\bf
m
}}
(
\rr
_{
BA
}
)
\\
m
}
(
\muu
_
A)D
_{{
\bf
m
}}
(
\rr
_{
BA
}
)
\\
&
=
&
M
_{
(0,0,0)
}
(
\muu
_
A)D
_{
(0,0,0)
}
(
\rr
_{
BA
}
)
\\
&
=
&
M
_{
(0,0,0)
}
(
\muu
_
A)D
_{
(0,0,0)
}
(
\rr
_{
BA
}
)
\\
&
&
+M
_{
(2,0,0)
}
(
\muu
_
A)D
_{
(2,0,0)
}
(
\rr
_{
BA
}
)
\\
&
&
+M
_{
(2,0,0)
}
(
\muu
_
A)D
_{
(2,0,0)
}
(
\rr
_{
BA
}
)
\\
...
@@ -196,15 +225,15 @@ m}(\muu_A)D_{{\bf m}}(\rr_{BA}) \\
...
@@ -196,15 +225,15 @@ m}(\muu_A)D_{{\bf m}}(\rr_{BA}) \\
&
=
&
M
_{{
\rm
tot
}
, A
}
\phi
(
\rr
_{
BA
}
) +
&
=
&
M
_{{
\rm
tot
}
, A
}
\phi
(
\rr
_{
BA
}
) +
\frac
{
1
}{
2
}
\sum
_{
\alpha
,
\beta
}
I
_{
A,
\alpha\beta
}
\partial
_{
\alpha\beta
}
\phi
(
\rr
_{
\frac
{
1
}{
2
}
\sum
_{
\alpha
,
\beta
}
I
_{
A,
\alpha\beta
}
\partial
_{
\alpha\beta
}
\phi
(
\rr
_{
BA
}
)
\\
BA
}
)
\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onal term):
\begin{eqnarray}
\begin{eqnarray}
F
_{
(2,0,0)
}
(
\muu
_
B)~=~ J
_{
B,xx
}
&
=
&
\sum
_{
|
{
\bf
m
}
|
\leq
0
}
M
_{
\bf
F
_{
(2,0,0)
}
(
\muu
_
B)~=~ J
_{
B
A
,xx
}
&
=
&
\sum
_{
|
{
\bf
m
}
|
\leq
0
}
M
_{
\bf
m
}
(
\muu
_
A)D
_{{
\bf
m
}
(
\muu
_
A)D
_{{
\bf
m
}
+(2,0,0)
}
(
\rr
_{
BA
}
)
\\
m
}
+(2,0,0)
}
(
\rr
_{
BA
}
)
\\
&
=
&
M
_{
(0,0,0)
}
(
\muu
_
A)D
_{
(2,0,0)
}
(
\rr
_{
BA
}
)
\\
&
=
&
M
_{
(0,0,0)
}
(
\muu
_
A)D
_{
(2,0,0)
}
(
\rr
_{
BA
}
)
\\
...
@@ -226,7 +255,7 @@ m}+(2,0,0)}(\rr_{BA}) \\
...
@@ -226,7 +255,7 @@ m}+(2,0,0)}(\rr_{BA}) \\
Quadrupole (off-diagonal term):
Quadrupole (off-diagonal term):
\begin{eqnarray}
\begin{eqnarray}
F
_{
(1,1,0)
}
(
\muu
_
B)~=~J
_{
B,xy
}
&
=
&
\sum
_{
|
{
\bf
m
}
|
\leq
0
}
M
_{
\bf
F
_{
(1,1,0)
}
(
\muu
_
B)~=~J
_{
B
A
,xy
}
&
=
&
\sum
_{
|
{
\bf
m
}
|
\leq
0
}
M
_{
\bf
m
}
(
\muu
_
A)D
_{{
\bf
m
}
(
\muu
_
A)D
_{{
\bf
m
}
+(1,1,0)
}
(
\rr
_{
BA
}
)
\\
m
}
+(1,1,0)
}
(
\rr
_{
BA
}
)
\\
&
=
&
M
_{
(0,0,0)
}
(
\muu
_
A)D
_{
(1,1,0)
}
(
\rr
_{
BA
}
)
\\
&
=
&
M
_{
(0,0,0)
}
(
\muu
_
A)D
_{
(1,1,0)
}
(
\rr
_{
BA
}
)
\\
...
@@ -236,16 +265,48 @@ m}+(1,1,0)}(\rr_{BA}) \\
...
@@ -236,16 +265,48 @@ m}+(1,1,0)}(\rr_{BA}) \\
All these terms can be written using a more compact notation.
All these terms can be written using a more compact notation.
\begin{eqnarray}
\begin{eqnarray}
N
_
B
&
=
&
\frac
{
GM
_{{
\rm
tot
}
, A
}}{
|
\rr
_{
BA
}
|
}
-
\frac
{
1
}{
2
}
\frac
{{
\rm
N
_
{
BA
}
&
=
&
\frac
{
GM
_{{
\rm
tot
}
, A
}}{
|
\rr
_{
BA
}
|
}
-
\frac
{
G
}{
2
}
\frac
{{
\rm
tr
}
(
\ii
{
A
}
)
}{
|
\rr
_{
BA
}
|
^
3
}
+
tr
}
(
\ii
{
A
}
)
}{
|
\rr
_{
BA
}
|
^
3
}
+
\frac
{
3
}{
2
}
\frac
{
\rr
_{
BA
}^
T
\cdot
\frac
{
3
G
}{
2
}
\frac
{
\rr
_{
BA
}^
T
\cdot
\ii
{
A
}
\cdot
\rr
_{
BA
}}{
|
\rr
_{
BA
}
|
^
5
}
\\
\ii
{
A
}
\cdot
\rr
_{
BA
}}{
|
\rr
_{
BA
}
|
^
5
}
\\
\qq
{
B
}
&
=
&
\frac
{
GM
_{{
\rm
tot
}
, A
}}{
|
\rr
_{
BA
}
|
^
3
}
\rr
_{
BA
}
\\
\qq
{
B
A
}
&
=
&
\frac
{
GM
_{{
\rm
tot
}
, A
}}{
|
\rr
_{
BA
}
|
^
3
}
\rr
_{
BA
}
\\
\jj
{
B
}
&
=
&
\frac
{
3GM
_{{
\rm
tot
}
, A
}}{
|
\rr
_{
BA
}
|
^
5
}
\rr
_{
BA
}
\jj
{
B
A
}
&
=
&
\frac
{
3GM
_{{
\rm
tot
}
, A
}}{
|
\rr
_{
BA
}
|
^
5
}
\rr
_{
BA
}
\otimes\rr
_{
BA
}
-
\frac
{
GM
_{{
\rm
tot
}
, A
}}{
|
\rr
_{
BA
}
|
^
3
}
\identity
\otimes\rr
_{
BA
}
-
\frac
{
GM
_{{
\rm
tot
}
, A
}}{
|
\rr
_{
BA
}
|
^
3
}
\identity
\end{eqnarray}
\end{eqnarray}
Note that
$
\jj
{
B
}$
is symmetric, meaning that
$
10
$
additional numbers per cell
only have to be stored. That is a total of
$
10
$
for the multipoles and
$
10
$
for
the field tensors.
\section
{
Gravitational potential in FMM
}
The potential at the position
$
\p
{
i
}$
in the vicinity of
$
\muu
_
B
$
due to the
mass clustered around
$
\muu
_
A
$
can be computed using the field tensors created
by the mutipoles at position
$
\muu
_
A
$
on the position
$
\muu
_
B
$
.
\begin{equation}
\phi
_
A(
\p
{
i
}
) =
\sum
_{
|
{
\bf
n
}
|
\leq
2
}
\frac
{
1
}{
{
\bf
n
}
!
}
(
\p
{
i
}
-
\muu
_
B)
^{
\bf
n
}
F
_{
\bf
n
}
(
\muu
_
B)
\end{equation}
Setting
$
\dd
_{
i,B
}
=
\p
{
i
}
-
\muu
_
B
$
and
$
\rr
_{
BA
}
=
\muu
_
B
-
\muu
_
A
$
, this sum
expands into
\begin{eqnarray}
\phi
_
A(
\p
{
i
}
)
&
=
&
N
_{
BA
}
+
\dd
_{
i,B
}
\cdot\qq
{
BA
}
+
\dd
_{
i,B
}^
T
\cdot
\jj
{
BA
}
\cdot
\dd
_{
i,B
}
\\
&
=
&
\frac
{
GM
_{{
\rm
tot
}
, A
}}{
|
\rr
_{
BA
}
|
}
-
\frac
{
1
}{
2
}
\frac
{{
\rm
tr
}
(
\ii
{
A
}
)
}{
|
\rr
_{
BA
}
|
^
3
}
+
\frac
{
3
}{
2
}
\frac
{
\rr
_{
BA
}^
T
\cdot
\ii
{
A
}
\cdot
\rr
_{
BA
}}{
|
\rr
_{
BA
}
|
^
5
}
\\
&
&
+
\frac
{
GM
_{{
\rm
tot
}
, A
}}{
|
\rr
_{
BA
}
|
^
3
}
\rr
_{
BA
}
\cdot\dd
_{
i,B
}
\\
&
&
+
\frac
{
3
}{
2
}
\frac
{
GM
_{{
\rm
tot
}
, A
}}{
|
\rr
_{
BA
}
|
^
5
}
\left
(
\dd
_{
i,B
}^
T
\cdot
\rr
_{
BA
}
\otimes\rr
_{
BA
}
\cdot
\dd
_{
i,B
}
\right
)
\\
&
&
-
\frac
{
1
}{
2
}
\frac
{
GM
_{{
\rm
tot
}
, A
}}{
|
\rr
_{
BA
}
|
^
3
}
\left
(
\dd
_{
i,B
}^
T
\cdot\identity
\cdot
\dd
_{
i,B
}
\right
)
\end{eqnarray}
Note that if
$
\p
{
i
}
=
\muu
_
B
$
(i.e.
$
d
_{
i,B
}
=
{
\bf
0
}$
), the expression for the
potential in the B-H formalism is recovered.
\end{document}
\end{document}
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