Skip to content
GitLab
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
dcb0fd7a
Commit
dcb0fd7a
authored
Aug 24, 2016
by
Matthieu Schaller
Browse files
Style change in cell_is_drift_needed() and early abort in the drift when dt==0
parent
a83354c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/cell.c
View file @
dcb0fd7a
...
...
@@ -829,12 +829,10 @@ int cell_is_drift_needed(struct cell *c, int ti_current) {
if
(
l
->
t
->
type
!=
task_type_pair
&&
l
->
t
->
type
!=
task_type_sub_pair
)
continue
;
/* Left or right? */
if
(
l
->
t
->
ci
==
c
)
{
if
(
l
->
t
->
cj
->
ti_end_min
==
ti_current
)
return
1
;
}
else
if
(
l
->
t
->
cj
==
c
)
{
if
(
l
->
t
->
ci
->
ti_end_min
==
ti_current
)
return
1
;
}
/* Does the other cell in the pair have an active particle ? */
if
((
l
->
t
->
ci
==
c
)
&&
(
l
->
t
->
cj
->
ti_end_min
==
ti_current
)
||
(
l
->
t
->
cj
==
c
)
&&
(
l
->
t
->
ci
->
ti_end_min
==
ti_current
))
return
1
;
}
/* No neighbouring cell has active particles. Drift not necessary */
...
...
src/runner.c
View file @
dcb0fd7a
...
...
@@ -650,6 +650,9 @@ static void runner_do_drift(struct cell *c, struct engine *e) {
/* Do we need to drift ? */
if
(
!
e
->
drift_all
&&
!
cell_is_drift_needed
(
c
,
ti_current
))
return
;
/* Check that we are actually going to move forward. */
if
(
ti_current
==
ti_old
)
return
;
/* Drift from the last time the cell was drifted to the current time */
const
double
dt
=
(
ti_current
-
ti_old
)
*
timeBase
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment