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
d847056c
Commit
d847056c
authored
Apr 10, 2018
by
Bert Vandenbroucke
Committed by
Matthieu Schaller
Apr 10, 2018
Browse files
Added debug check on particle drift distance.
parent
b403c0fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/cell.c
View file @
d847056c
...
...
@@ -2405,6 +2405,15 @@ void cell_drift_part(struct cell *c, const struct engine *e, int force) {
drift_part
(
p
,
xp
,
dt_drift
,
dt_kick_hydro
,
dt_kick_grav
,
dt_therm
,
ti_old_part
,
ti_current
);
#ifdef SWIFT_DEBUG_CHECKS
/* Make sure the particle does not drift by more than a box length. */
if
(
fabsf
(
xp
->
v_full
[
0
]
*
dt_drift
)
>
e
->
s
->
dim
[
0
]
||
fabsf
(
xp
->
v_full
[
1
]
*
dt_drift
)
>
e
->
s
->
dim
[
1
]
||
fabsf
(
xp
->
v_full
[
2
]
*
dt_drift
)
>
e
->
s
->
dim
[
2
])
{
error
(
"Particle drifts by more than a box length!"
);
}
#endif
/* Limit h to within the allowed range */
p
->
h
=
min
(
p
->
h
,
hydro_h_max
);
...
...
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