Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
e0b2ecee
Commit
e0b2ecee
authored
Mar 11, 2018
by
Matthieu Schaller
Browse files
Add cosmological conversion from internal velocity units to peculiar velocities.
parent
7a8a0fc9
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/gravity/Default/gravity_io.h
View file @
e0b2ecee
...
...
@@ -56,9 +56,15 @@ void convert_gpart_vel(const struct engine* e, const struct gpart* gp,
dt_kick_grav
=
(
ti_current
-
((
ti_beg
+
ti_end
)
/
2
))
*
time_base
;
}
/* Extrapolate the velocites to the current time */
ret
[
0
]
=
gp
->
v_full
[
0
]
+
gp
->
a_grav
[
0
]
*
dt_kick_grav
;
ret
[
1
]
=
gp
->
v_full
[
1
]
+
gp
->
a_grav
[
1
]
*
dt_kick_grav
;
ret
[
2
]
=
gp
->
v_full
[
2
]
+
gp
->
a_grav
[
2
]
*
dt_kick_grav
;
/* Conversion from internal units to peculiar velocities */
ret
[
0
]
*=
cosmo
->
a2_inv
;
ret
[
1
]
*=
cosmo
->
a2_inv
;
ret
[
2
]
*=
cosmo
->
a2_inv
;
}
/**
...
...
src/hydro/Gadget2/hydro_io.h
View file @
e0b2ecee
...
...
@@ -106,7 +106,13 @@ void convert_part_vel(const struct engine* e, const struct part* p,
dt_kick_hydro
=
(
ti_current
-
((
ti_beg
+
ti_end
)
/
2
))
*
time_base
;
}
/* Extrapolate the velocites to the current time */
hydro_get_drifted_velocities
(
p
,
xp
,
dt_kick_hydro
,
dt_kick_grav
,
ret
);
/* Conversion from internal units to peculiar velocities */
ret
[
0
]
*=
cosmo
->
a2_inv
;
ret
[
1
]
*=
cosmo
->
a2_inv
;
ret
[
2
]
*=
cosmo
->
a2_inv
;
}
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment