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
b59d7c4e
Commit
b59d7c4e
authored
7 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Correct expression for Gadget-2's long-range force truncation scheme.
parent
56d84a63
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!432
Gravity documentation
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theory/Multipoles/plot_mesh.py
+5
-5
5 additions, 5 deletions
theory/Multipoles/plot_mesh.py
with
5 additions
and
5 deletions
theory/Multipoles/plot_mesh.py
+
5
−
5
View file @
b59d7c4e
...
@@ -52,7 +52,7 @@ colors=['#4477AA', '#CC6677', '#DDCC77', '#117733']
...
@@ -52,7 +52,7 @@ colors=['#4477AA', '#CC6677', '#DDCC77', '#117733']
# Parameters
# Parameters
r_s
=
2.
r_s
=
2.
r_min
=
1
e-2
r_min
=
3
e-2
r_max
=
1.5e2
r_max
=
1.5e2
# Radius
# Radius
...
@@ -95,7 +95,7 @@ def swift_corr(x):
...
@@ -95,7 +95,7 @@ def swift_corr(x):
# Correction in real space
# Correction in real space
corr_short_gadget2
=
special
.
erf
(
r
/
(
2.
*
r_s
))
corr_short_gadget2
=
special
.
erf
(
r
/
(
2.
*
r_s
))
corr_short_swift
=
swift_corr
(
r
/
(
2.
*
r_s
))
corr_short_swift
=
swift_corr
(
r
/
(
2.
*
r_s
))
eta_short_gadget2
=
special
.
erfc
(
r
/
2.
*
r_s
)
+
(
r
/
(
r_s
*
math
.
sqrt
(
math
.
pi
)))
*
exp
(
-
r
**
2
/
(
4.
*
r_s
**
2
))
eta_short_gadget2
=
special
.
erfc
(
r
/
(
2.
*
r_s
)
)
+
(
r
/
(
r_s
*
math
.
sqrt
(
math
.
pi
)))
*
exp
(
-
r
**
2
/
(
4.
*
r_s
**
2
))
eta_short_swift
=
4.
*
(
r
/
r_s
)
*
d_sigmoid
(
2.
*
r
/
r_s
)
-
2.
*
sigmoid
(
2
*
r
/
r_s
)
+
2.
eta_short_swift
=
4.
*
(
r
/
r_s
)
*
d_sigmoid
(
2.
*
r
/
r_s
)
-
2.
*
sigmoid
(
2
*
r
/
r_s
)
+
2.
# Corection in Fourier space
# Corection in Fourier space
...
@@ -161,7 +161,7 @@ ylim(3e-3, 1.5)
...
@@ -161,7 +161,7 @@ ylim(3e-3, 1.5)
#ylabel("$1 - \\chi_s(r)$", labelpad=-2)
#ylabel("$1 - \\chi_s(r)$", labelpad=-2)
ylabel
(
"
$1 -
\\
varphi_s(r)
\\
times r$
"
,
labelpad
=-
2
)
ylabel
(
"
$1 -
\\
varphi_s(r)
\\
times r$
"
,
labelpad
=-
2
)
yticks
([
1e-2
,
1e-1
,
1
],
[
"
$0.01$
"
,
"
$0.1$
"
,
"
$1$
"
])
yticks
([
1e-2
,
1e-1
,
1
],
[
"
$0.01$
"
,
"
$0.1$
"
,
"
$1$
"
])
xlabel
(
"
$r / r_s$
"
,
labelpad
=
-
3
)
xlabel
(
"
$r / r_s$
"
,
labelpad
=
1
)
savefig
(
"
potential_short.pdf
"
)
savefig
(
"
potential_short.pdf
"
)
...
@@ -212,7 +212,7 @@ ylim(3e-3, 1.5)
...
@@ -212,7 +212,7 @@ ylim(3e-3, 1.5)
#ylabel("$1 - \\eta_s(r)$", labelpad=-2)
#ylabel("$1 - \\eta_s(r)$", labelpad=-2)
ylabel
(
"
$1 - |
\\
mathbf{f}_s(r)|
\\
times r^2$
"
,
labelpad
=-
3
)
ylabel
(
"
$1 - |
\\
mathbf{f}_s(r)|
\\
times r^2$
"
,
labelpad
=-
3
)
yticks
([
1e-2
,
1e-1
,
1
],
[
"
$0.01$
"
,
"
$0.1$
"
,
"
$1$
"
])
yticks
([
1e-2
,
1e-1
,
1
],
[
"
$0.01$
"
,
"
$0.1$
"
,
"
$1$
"
])
xlabel
(
"
$r / r_s$
"
,
labelpad
=
-
3
)
xlabel
(
"
$r / r_s$
"
,
labelpad
=
1
)
savefig
(
"
force_short.pdf
"
)
savefig
(
"
force_short.pdf
"
)
...
@@ -262,6 +262,6 @@ ylim(3e-3, 1.5)
...
@@ -262,6 +262,6 @@ ylim(3e-3, 1.5)
ylabel
(
"
$1 - k^2
\\
times
\\
tilde{
\\
varphi_l}(k)$
"
,
labelpad
=-
3
)
ylabel
(
"
$1 - k^2
\\
times
\\
tilde{
\\
varphi_l}(k)$
"
,
labelpad
=-
3
)
yticks
([
1e-2
,
1e-1
,
1
],
[
"
$0.01$
"
,
"
$0.1$
"
,
"
$1$
"
])
yticks
([
1e-2
,
1e-1
,
1
],
[
"
$0.01$
"
,
"
$0.1$
"
,
"
$1$
"
])
xlabel
(
"
$k
\\
times r_s$
"
,
labelpad
=
0
)
xlabel
(
"
$k
\\
times r_s$
"
,
labelpad
=
1
)
savefig
(
"
potential_long.pdf
"
)
savefig
(
"
potential_long.pdf
"
)
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