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
15a7fb00
Commit
15a7fb00
authored
6 years ago
by
James Willis
Browse files
Options
Downloads
Patches
Plain Diff
Set w_de correctly for VELOCIraptor. Scale velocities by 1/a^2 and set cosmology flag correctly.
parent
d730ecfb
No related branches found
No related tags found
1 merge request
!578
Swift velociraptor
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/velociraptor_interface.c
+9
-5
9 additions, 5 deletions
src/velociraptor_interface.c
with
9 additions
and
5 deletions
src/velociraptor_interface.c
+
9
−
5
View file @
15a7fb00
...
...
@@ -67,7 +67,7 @@ void velociraptor_init(struct engine *e) {
cosmo_info
.
Omega_b
=
e
->
cosmology
->
Omega_b
;
cosmo_info
.
Omega_Lambda
=
e
->
cosmology
->
Omega_lambda
;
cosmo_info
.
Omega_cdm
=
e
->
cosmology
->
Omega_m
-
e
->
cosmology
->
Omega_b
;
cosmo_info
.
w_de
=
e
->
cosmology
->
w
_0
;
cosmo_info
.
w_de
=
e
->
cosmology
->
w
;
message
(
"Scale factor: %e"
,
cosmo_info
.
atime
);
message
(
"Little h: %e"
,
cosmo_info
.
littleh
);
...
...
@@ -103,7 +103,8 @@ void velociraptor_init(struct engine *e) {
else
sim_info
.
period
=
0
.
0
;
sim_info
.
zoomhigresolutionmass
=
-
1
.
0
;
/* Placeholder. */
sim_info
.
interparticlespacing
=
sim_info
.
period
/
cbrt
(
total_nr_dmparts
);
sim_info
.
icosmologicalsim
=
(
e
->
policy
&
engine_policy_cosmology
);
if
(
e
->
policy
&
engine_policy_cosmology
)
sim_info
.
icosmologicalsim
=
1
;
else
sim_info
.
icosmologicalsim
=
0
;
sim_info
.
spacedimension
[
0
]
=
unit_info
.
lengthtokpc
*
s
->
dim
[
0
];
sim_info
.
spacedimension
[
1
]
=
unit_info
.
lengthtokpc
*
s
->
dim
[
1
];
sim_info
.
spacedimension
[
2
]
=
unit_info
.
lengthtokpc
*
s
->
dim
[
2
];
...
...
@@ -218,15 +219,18 @@ void velociraptor_invoke(struct engine *e) {
bzero
(
swift_parts
,
nr_gparts
*
sizeof
(
struct
swift_vel_part
));
const
float
energy_scale
=
1
.
0
;
const
float
a2
=
e
->
cosmology
->
a
*
e
->
cosmology
->
a
;
message
(
"Energy scaling factor: %f"
,
energy_scale
);
message
(
"a^2: %f"
,
a2
);
for
(
int
i
=
0
;
i
<
nr_gparts
;
i
++
)
{
swift_parts
[
i
].
x
[
0
]
=
gparts
[
i
].
x
[
0
]
*
conv_fac
->
lengthtokpc
;
swift_parts
[
i
].
x
[
1
]
=
gparts
[
i
].
x
[
1
]
*
conv_fac
->
lengthtokpc
;
swift_parts
[
i
].
x
[
2
]
=
gparts
[
i
].
x
[
2
]
*
conv_fac
->
lengthtokpc
;
swift_parts
[
i
].
v
[
0
]
=
gparts
[
i
].
v_full
[
0
]
*
conv_fac
->
velocitytokms
;
swift_parts
[
i
].
v
[
1
]
=
gparts
[
i
].
v_full
[
1
]
*
conv_fac
->
velocitytokms
;
swift_parts
[
i
].
v
[
2
]
=
gparts
[
i
].
v_full
[
2
]
*
conv_fac
->
velocitytokms
;
swift_parts
[
i
].
v
[
0
]
=
gparts
[
i
].
v_full
[
0
]
*
conv_fac
->
velocitytokms
/
a2
;
swift_parts
[
i
].
v
[
1
]
=
gparts
[
i
].
v_full
[
1
]
*
conv_fac
->
velocitytokms
/
a2
;
swift_parts
[
i
].
v
[
2
]
=
gparts
[
i
].
v_full
[
2
]
*
conv_fac
->
velocitytokms
/
a2
;
swift_parts
[
i
].
mass
=
gparts
[
i
].
mass
*
conv_fac
->
masstosolarmass
;
swift_parts
[
i
].
potential
=
gparts
[
i
].
potential
*
conv_fac
->
energyperunitmass
;
swift_parts
[
i
].
type
=
gparts
[
i
].
type
;
...
...
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