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
3af059d1
Commit
3af059d1
authored
Jun 26, 2017
by
Pedro Gonnet
Browse files
add a function to clear cell flags.
parent
3f3d324f
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/cell.c
View file @
3af059d1
...
...
@@ -1316,6 +1316,14 @@ int cell_is_drift_needed(struct cell *c, const struct engine *e) {
return
0
;
}
/**
* @brief Clear the drift flags on the given cell.
*/
void
cell_clear_drift_flags
(
struct
cell
*
c
,
void
*
data
)
{
c
->
do_drift
=
0
;
c
->
do_sub_drift
=
0
;
}
/**
* @brief Activate the drifts on the given cell.
*/
...
...
@@ -1358,8 +1366,8 @@ void cell_activate_sorts(struct cell *c, int sid, struct scheduler *s) {
for
(
struct
cell
*
finger
=
c
;
finger
!=
NULL
;
finger
=
finger
->
parent
)
{
if
(
finger
->
requires_sorts
==
ti_current
)
{
atomic_or
(
&
finger
->
sorts
->
flags
,
finger
->
sorted
);
scheduler_activate
(
s
,
finger
->
sorts
);
if
(
finger
->
nodeID
==
engine_rank
)
cell_activate_drift_part
(
finger
,
s
);
scheduler_activate
(
s
,
finger
->
sorts
);
}
finger
->
sorted
=
0
;
}
...
...
@@ -1896,10 +1904,6 @@ void cell_drift_part(struct cell *c, const struct engine *e, int force) {
/* Update the time of the last drift */
c
->
ti_old_part
=
ti_current
;
/* Clear the drift flags. */
c
->
do_drift
=
0
;
c
->
do_sub_drift
=
0
;
}
else
if
(
force
&&
ti_current
>
ti_old_part
)
{
/* Loop over all the gas particles in the cell */
...
...
@@ -1946,11 +1950,11 @@ void cell_drift_part(struct cell *c, const struct engine *e, int force) {
/* Update the time of the last drift */
c
->
ti_old_part
=
ti_current
;
/* Clear the drift flags. */
c
->
do_drift
=
0
;
c
->
do_sub_drift
=
0
;
}
/* Clear the drift flags. */
c
->
do_drift
=
0
;
c
->
do_sub_drift
=
0
;
}
/**
...
...
src/cell.h
View file @
3af059d1
...
...
@@ -397,6 +397,7 @@ void cell_activate_subcell_tasks(struct cell *ci, struct cell *cj,
struct
scheduler
*
s
);
void
cell_activate_drift_part
(
struct
cell
*
c
,
struct
scheduler
*
s
);
void
cell_activate_sorts
(
struct
cell
*
c
,
int
sid
,
struct
scheduler
*
s
);
void
cell_clear_drift_flags
(
struct
cell
*
c
,
void
*
data
);
/* Inlined functions (for speed). */
...
...
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