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
72de62ad
Commit
72de62ad
authored
Dec 05, 2016
by
Matthieu Schaller
Browse files
src/runner_doiact.h
parent
6ae05a1f
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/cell.c
View file @
72de62ad
...
...
@@ -981,3 +981,25 @@ void cell_set_super(struct cell *c, struct cell *super) {
for
(
int
k
=
0
;
k
<
8
;
k
++
)
if
(
c
->
progeny
[
k
]
!=
NULL
)
cell_set_super
(
c
->
progeny
[
k
],
super
);
}
/**
* Set ti_old of a #cell and all its progenies to a new value.
*
* @param c The #cell.
* @param ti_current The new value of ti_old.
*/
void
cell_set_ti_old
(
struct
cell
*
c
,
int
ti_current
)
{
/* Set this cell */
c
->
ti_old
=
ti_current
;
/* Recurse */
if
(
c
->
split
)
{
for
(
int
k
=
0
;
k
<
8
;
++
k
)
{
if
(
c
->
progeny
[
k
]
!=
NULL
)
{
struct
cell
*
cp
=
c
->
progeny
[
k
];
cell_set_ti_old
(
cp
,
ti_current
);
}
}
}
}
src/cell.h
View file @
72de62ad
...
...
@@ -295,5 +295,6 @@ void cell_check_drift_point(struct cell *c, void *data);
int
cell_is_drift_needed
(
struct
cell
*
c
,
const
struct
engine
*
e
);
int
cell_unskip_tasks
(
struct
cell
*
c
,
struct
scheduler
*
s
);
void
cell_set_super
(
struct
cell
*
c
,
struct
cell
*
super
);
void
cell_set_ti_old
(
struct
cell
*
c
,
int
ti_current
);
#endif
/* SWIFT_CELL_H */
src/runner.c
View file @
72de62ad
...
...
@@ -838,6 +838,17 @@ static void runner_do_drift(struct cell *c, struct engine *e, int drift) {
/* Now, get the maximal particle motion from its square */
dx_max
=
sqrtf
(
dx2_max
);
/* Set ti_old on the sub-cells */
cell_set_ti_old
(
c
,
e
->
ti_current
);
/* Need to recurse to unskip if need be */
for
(
int
k
=
0
;
k
<
8
;
k
++
)
{
if
(
c
->
progeny
[
k
]
!=
NULL
)
{
struct
cell
*
cp
=
c
->
progeny
[
k
];
runner_do_drift
(
cp
,
e
,
0
);
}
}
}
/* Check that we are actually going to move forward. */
else
{
...
...
src/runner_doiact.h
View file @
72de62ad
...
...
@@ -1989,6 +1989,10 @@ void DOSUB_SELF1(struct runner *r, struct cell *ci, int gettimer) {
/* Should we even bother? */
if
(
!
cell_is_active
(
ci
,
r
->
e
))
return
;
#ifdef SWIFT_DEBUG_CHECKS
cell_is_drifted
(
ci
,
r
->
e
);
#endif
/* Recurse? */
if
(
ci
->
split
)
{
...
...
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