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
be7a8787
Commit
be7a8787
authored
10 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Added equations for the field tensors.
parent
bf33e5c7
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
+104
-19
104 additions, 19 deletions
examples/theory/multipoles.tex
with
104 additions
and
19 deletions
examples/theory/multipoles.tex
+
104
−
19
View file @
be7a8787
...
@@ -9,7 +9,10 @@
...
@@ -9,7 +9,10 @@
\newcommand
{
\p
}
[1]
{
\mathbf
{
p
}_{
#1
}}
\newcommand
{
\p
}
[1]
{
\mathbf
{
p
}_{
#1
}}
\newcommand
{
\acc
}
[1]
{
\mathbf
{
a
}_{
#1
}}
\newcommand
{
\acc
}
[1]
{
\mathbf
{
a
}_{
#1
}}
\newcommand
{
\muu
}{
\boldsymbol
{
\mu
}}
\newcommand
{
\muu
}{
\boldsymbol
{
\mu
}}
\newcommand
{
\qq
}
[1]
{
\mathbf
{
Q
}_{
#1
}}
\newcommand
{
\jj
}
[1]
{
\underline
{
J
_{
#1
}}}
\newcommand
{
\ii
}
[1]
{
\underline
{
I
_{
#1
}}}
\newcommand
{
\identity
}{
\rm
{
Id
_
3
}}
\title
{
B-H and FMM equations up to quadrupole terms
}
\title
{
B-H and FMM equations up to quadrupole terms
}
\author
{
Matthieu Schaller
}
\author
{
Matthieu Schaller
}
...
@@ -18,7 +21,8 @@
...
@@ -18,7 +21,8 @@
\maketitle
\maketitle
Bold quantities are vectors, underlined quantities are matrices. The indices
Bold quantities are vectors, underlined quantities are matrices. The indices
$
\alpha
,
\beta
$
run over the directions
$
x,y,z
$
.
$
\alpha
,
\beta
$
run over the directions
$
x,y,z
$
.
$
\identity
$
is the identity
matrix in 3D.
\section
{
Construction of multipoles
}
\section
{
Construction of multipoles
}
...
@@ -37,33 +41,33 @@ centre of mass $\muu_A$. The first LHS term uses Dehnen's notation.\\
...
@@ -37,33 +41,33 @@ centre of mass $\muu_A$. The first LHS term uses Dehnen's notation.\\
Monopole:
Monopole:
\begin{equation}
\begin{equation}
M
_{
(0,0,0)
}
= M
_{{
\rm
tot
}
, A
}
M
_{
(0,0,0)
}
(
\muu
_
A)
= M
_{{
\rm
tot
}
, A
}
\end{equation}
\end{equation}
Dipole:
Dipole:
\begin{eqnarray}
\begin{eqnarray}
M
_{
(1,0,0)
}
&
=
&
P
_{
A,x
}
~= 0
\\
M
_{
(1,0,0)
}
(
\muu
_
A)
&
=
&
P
_{
A,x
}
~= 0
\\
M
_{
(0,1,0)
}
&
=
&
P
_{
A,y
}
~=0
\\
M
_{
(0,1,0)
}
(
\muu
_
A)
&
=
&
P
_{
A,y
}
~=0
\\
M
_{
(0,0,1)
}
&
=
&
P
_{
A,z
}
~=0
M
_{
(0,0,1)
}
(
\muu
_
A)
&
=
&
P
_{
A,z
}
~=0
\end{eqnarray}
\end{eqnarray}
Quadrupole:
Quadrupole:
\begin{eqnarray}
\begin{eqnarray}
M
_{
(2,0,0)
}
&
=
&
\frac
{
1
}{
2
}
I
_{
A,xx
}
~=
\frac
{
1
}{
2
}
\sum
_{
i
\in
A
}
m
_
i (
M
_{
(2,0,0)
}
(
\muu
_
A)
&
=
&
\frac
{
1
}{
2
}
I
_{
A,xx
}
~=
\frac
{
1
}{
2
}
\sum
_{
i
\in
A
}
m
_
i (
p
_{
i,x
}
-
\mu
_{
A,x
}
)
^
2
\\
p
_{
i,x
}
-
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
A
}
m
_
i (
p
_{
i,y
}
-
\mu
_{
A,y
}
)( p
_{
i,z
}
-
\mu
_{
A,z
}
)
\\
p
_{
i,y
}
-
\mu
_{
A,y
}
)( p
_{
i,z
}
-
\mu
_{
A,z
}
)
\\
M
_{
(1,0,1)
}
&
=
&
\frac
{
1
}{
2
}
I
_{
A,xz
}
~=
\frac
{
1
}{
2
}
\sum
_{
i
\in
A
}
m
_
i (
M
_{
(1,0,1)
}
(
\muu
_
A)
&
=
&
\frac
{
1
}{
2
}
I
_{
A,xz
}
~=
\frac
{
1
}{
2
}
\sum
_{
i
\in
A
}
m
_
i (
p
_{
i,x
}
-
\mu
_{
A,x
}
)( p
_{
i,z
}
-
\mu
_{
A,z
}
)
p
_{
i,x
}
-
\mu
_{
A,x
}
)( p
_{
i,z
}
-
\mu
_{
A,z
}
)
\end{eqnarray}
\end{eqnarray}
\section
{
Recursive construction of the
quadru
poles
}
\section
{
Recursive construction of the
multi
poles
}
Given a set of multipoles
$
B
$
expressed around their centre of masses
Given a set of multipoles
$
B
$
expressed around their centre of masses
$
\muu
_{
B
}$
, we can construct the total multipoles around the centre of mass
$
\muu
_{
B
}$
, we can construct the total multipoles around the centre of mass
...
@@ -127,7 +131,7 @@ In the B-H approximation, the potential at position $\p{i}$ due to a set of
...
@@ -127,7 +131,7 @@ In the B-H approximation, the potential at position $\p{i}$ due to a set of
particles
$
A
$
is given by
particles
$
A
$
is given by
\begin{equation}
\begin{equation}
\phi
(
\p
{
i
}
) = -
\sum
_{
\bf
n
}
M
_{
A,
\bf
n
}
D
_{
\bf
n
}
(
\muu
_
A -
\p
{
i
}
)
\phi
(
\p
{
i
}
) = -
\sum
_{
\bf
n
}
M
_{
\bf
n
}
(
\muu
_
A)
D
_{
\bf
n
}
(
\muu
_
A -
\p
{
i
}
)
\end{equation}
\end{equation}
Keeping only the terms up to second order (i.e. letting the sum run over
Keeping only the terms up to second order (i.e. letting the sum run over
...
@@ -146,20 +150,101 @@ I_{A,\alpha} \left(\frac{3Gr_\alpha^2}{|\rr_{i,A}|^5} -
...
@@ -146,20 +150,101 @@ I_{A,\alpha} \left(\frac{3Gr_\alpha^2}{|\rr_{i,A}|^5} -
&
&
-
\frac
{
1
}{
2
}
\sum
_{
\alpha
,
\beta
}
I
_{
A,
\alpha\beta
}
\frac
{
3Gr
_
\alpha
&
&
-
\frac
{
1
}{
2
}
\sum
_{
\alpha
,
\beta
}
I
_{
A,
\alpha\beta
}
\frac
{
3Gr
_
\alpha
r
_
\beta
}{
|
\rr
_{
i,A
}
|
^
5
}
\\
r
_
\beta
}{
|
\rr
_{
i,A
}
|
^
5
}
\\
&
=
&
-G
\left
[
\frac
{
M
_{{
\rm
tot
}
,A
}}{
|
\rr
_{
i,A
}
|
}
-
\frac
{
1
}{
2
}
\frac
{{
\rm
&
=
&
-G
\left
[
\frac
{
M
_{{
\rm
tot
}
,A
}}{
|
\rr
_{
i,A
}
|
}
-
\frac
{
1
}{
2
}
\frac
{{
\rm
tr
}
(
\
underline
{
I
_
A
}
)
}{
|
\rr
_{
i,A
}
|
^
3
}
+
\frac
{
3
}{
2
}
\frac
{
\rr
_{
i,A
}^
T
\cdot
tr
}
(
\
ii
{
A
}
)
}{
|
\rr
_{
i,A
}
|
^
3
}
+
\frac
{
3
}{
2
}
\frac
{
\rr
_{
i,A
}^
T
\cdot
\
underline
{
I
_
A
}
\cdot
\rr
_{
i,A
}}{
|
\rr
_{
i,A
}
|
^
5
}
\right
]
\
ii
{
A
}
\cdot
\rr
_{
i,A
}}{
|
\rr
_{
i,A
}
|
^
5
}
\right
]
\end{eqnarray}
\end{eqnarray}
The accelerations
$
\acc
{
i
}
=
-
\nabla
_{
\rr
_{
i,A
}}
\phi
(
\p
{
i
}
)
$
are then given by:
The accelerations
$
\acc
{
i
}
=
-
\nabla
_{
\rr
_{
i,A
}}
\phi
(
\p
{
i
}
)
$
are then given by:
\begin{eqnarray}
\begin{eqnarray}
\acc
{
i
}
= G
\left
[
\frac
{
M
_{{
\rm
tot
}
,A
}
\rr
_{
i,A
}}{
|
\rr
_{
i,A
}
|
}
\acc
{
i
}
= G
\left
[
\frac
{
M
_{{
\rm
tot
}
,A
}
\rr
_{
i,A
}}{
|
\rr
_{
i,A
}
|
}
-
\frac
{
3
}{
2
}
\frac
{{
\rm
tr
}
(
\
underline
{
I
_
A
}
)
\rr
_{
i,A
}}{
|
\rr
_{
i,A
}
|
^
5
}
-
\frac
{
3
}{
2
}
\frac
{{
\rm
tr
}
(
\
ii
{
A
}
)
\rr
_{
i,A
}}{
|
\rr
_{
i,A
}
|
^
5
}
-
\frac
{
3
\
underline
{
I
_
A
}
\cdot\rr
_{
i,A
}}{
|
\rr
_{
i,A
}
|
^
5
}
-
\frac
{
3
\
ii
{
A
}
\cdot\rr
_{
i,A
}}{
|
\rr
_{
i,A
}
|
^
5
}
+
\frac
{
15
}{
2
}
\frac
{
(
\rr
_{
i,A
}^
T
\cdot
\
underline
{
I
_
A
}
\cdot
+
\frac
{
15
}{
2
}
\frac
{
(
\rr
_{
i,A
}^
T
\cdot
\
ii
{
A
}
\cdot
\rr
_{
i,A
}
)
\rr
_{
i,A
}}{
|
\rr
_{
i,A
}
|
^
7
}
\right
]
\rr
_{
i,A
}
)
\rr
_{
i,A
}}{
|
\rr
_{
i,A
}
|
^
7
}
\right
]
\end{eqnarray}
\end{eqnarray}
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
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
tot
}
,A
}
,
\muu
_
A,
\ii
{
A
}$
).
\section
{
FMM Field tensors
}
Instead of computing the potential and accelerations of each particle, field
tensors (generated by the set of particles A) at position
$
\muu
_
B
$
can
be derived. The accelerations of each particle can then be obtained from
these field tensors. These tensors are given by:
\begin{equation}
F
_{
\bf
n
}
(
\muu
_
B) =
\sum
_{
|
{
\bf
m
}
| + |
{
\bf
n
}
|
\leq
2
}
M
_{
\bf
m
}
(
\muu
_
A)D
_{{
\bf
n
}
+
{
\bf
m
}}
(
\muu
_
B -
\muu
_
A)
\end{equation}
Writing these out explicitly with
$
\rr
_{
BA
}
=
\muu
_
B
-
\muu
_
A
$
, we obtain the
following set of expressions.
\\
Monopole:
\begin{eqnarray}
F
_{
(0,0,0)
}
(
\muu
_
B) ~=~ N
_
B
&
=
&
\sum
_{
|
{
\bf
m
}
|
\leq
2
}
M
_{
\bf
m
}
(
\muu
_
A)D
_{{
\bf
m
}}
(
\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
_{
(1,1,0)
}
(
\muu
_
A)D
_{
(1,1,0)
}
(
\rr
_{
BA
}
)
\\
&
&
+
\dots
\\
&
=
&
M
_{{
\rm
tot
}
, A
}
\phi
(
\rr
_{
BA
}
) +
\frac
{
1
}{
2
}
\sum
_{
\alpha
,
\beta
}
I
_{
A,
\alpha\beta
}
\partial
_{
\alpha\beta
}
\phi
(
\rr
_{
BA
}
)
\\
&
=
&
\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
}
\end{eqnarray}
Dipole:
\begin{eqnarray}
F
_{
(1,0,0)
}
(
\muu
_
B) ~=~ Q
_{
B,x
}
&
=
&
\sum
_{
|
{
\bf
m
}
|
\leq
1
}
M
_{
\bf
m
}
(
\muu
_
A)D
_{{
\bf
m
}
+(1,0,0)
}
(
\rr
_{
BA
}
)
\\
&
=
&
M
_{
(0,0,0)
}
(
\muu
_
A)D
_{
(1,0,0)
}
(
\rr
_{
BA
}
)
\\
&
=
&
M
_{{
\rm
tot
}
, A
}
\partial
_
x
\phi
(
\rr
_{
BA
}
)
\\
&
=
&
M
_{{
\rm
tot
}
, A
}
\frac
{
G
}{
|
\rr
_{
BA
}
|
^
3
}
r
_{
BA,x
}
\end{eqnarray}
Quadrupole (diagonal term):
\begin{eqnarray}
F
_{
(2,0,0)
}
(
\muu
_
B)~=~ J
_{
B,xx
}
&
=
&
\sum
_{
|
{
\bf
m
}
|
\leq
0
}
M
_{
\bf
m
}
(
\muu
_
A)D
_{{
\bf
m
}
+(2,0,0)
}
(
\rr
_{
BA
}
)
\\
&
=
&
M
_{
(0,0,0)
}
(
\muu
_
A)D
_{
(2,0,0)
}
(
\rr
_{
BA
}
)
\\
&
=
&
M
_{{
\rm
tot
}
, A
}
\partial
_{
xx
}
\phi
(
\rr
_{
BA
}
)
\\
&
=
&
M
_{{
\rm
tot
}
, A
}
\left
(
\frac
{
3Gr
_{
BA,x
}^
2
}{
|
\rr
_{
BA
}
|
^
5
}
-
\frac
{
G
}{
|
\rr
_{
BA
}
|
^
3
}
\right
)
\end{eqnarray}
Quadrupole (off-diagonal term):
\begin{eqnarray}
F
_{
(1,1,0)
}
(
\muu
_
B)~=~J
_{
B,xy
}
&
=
&
\sum
_{
|
{
\bf
m
}
|
\leq
0
}
M
_{
\bf
m
}
(
\muu
_
A)D
_{{
\bf
m
}
+(1,1,0)
}
(
\rr
_{
BA
}
)
\\
&
=
&
M
_{
(0,0,0)
}
(
\muu
_
A)D
_{
(1,1,0)
}
(
\rr
_{
BA
}
)
\\
&
=
&
M
_{{
\rm
tot
}
, A
}
\partial
_{
xy
}
\phi
(
\rr
_{
BA
}
)
\\
&
=
&
M
_{{
\rm
tot
}
, A
}
\frac
{
3Gr
_{
BA,x
}
r
_{
BA,y
}}{
|
\rr
|
^
5
}
\end{eqnarray}
All these terms can be written using a more compact notation.
\begin{eqnarray}
N
_
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
}
\\
\qq
{
B
}
&
=
&
\frac
{
GM
_{{
\rm
tot
}
, A
}}{
|
\rr
_{
BA
}
|
^
3
}
\rr
_{
BA
}
\\
\jj
{
B
}
&
=
&
\frac
{
3GM
_{{
\rm
tot
}
, A
}}{
|
\rr
_{
BA
}
|
^
5
}
\rr
_{
BA
}
\otimes\rr
_{
BA
}
-
\frac
{
GM
_{{
\rm
tot
}
, A
}}{
|
\rr
_{
BA
}
|
^
3
}
\identity
\end{eqnarray}
...
...
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