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
31aed3eb
Commit
31aed3eb
authored
Jul 28, 2019
by
Matthieu Schaller
Browse files
When removing an spart or a bpart, update the counters accordingly.
parent
776f567e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/cell.c
View file @
31aed3eb
...
...
@@ -5398,12 +5398,15 @@ void cell_remove_spart(const struct engine *e, struct cell *c,
sp
->
gpart
->
type
=
swift_type_dark_matter
;
}
/* Un-link the spart */
sp
->
gpart
=
NULL
;
/* Update the space-wide counters */
const
size_t
one
=
1
;
atomic_add
(
&
e
->
s
->
nr_inhibited_sparts
,
one
);
if
(
sp
->
gpart
)
{
atomic_add
(
&
e
->
s
->
nr_inhibited_gparts
,
one
);
}
/* Un-link the spart */
sp
->
gpart
=
NULL
;
}
/**
...
...
@@ -5434,12 +5437,15 @@ void cell_remove_bpart(const struct engine *e, struct cell *c,
bp
->
gpart
->
type
=
swift_type_dark_matter
;
}
/* Un-link the bpart */
bp
->
gpart
=
NULL
;
/* Update the space-wide counters */
const
size_t
one
=
1
;
atomic_add
(
&
e
->
s
->
nr_inhibited_bparts
,
one
);
if
(
bp
->
gpart
)
{
atomic_add
(
&
e
->
s
->
nr_inhibited_gparts
,
one
);
}
/* Un-link the bpart */
bp
->
gpart
=
NULL
;
}
/**
...
...
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