Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
39740c15
Commit
39740c15
authored
5 years ago
by
Yannick Bahé
Committed by
Matthieu Schaller
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix bug in multiple BH mergers
parent
26c1d7b4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/runner_black_holes.c
+21
-5
21 additions, 5 deletions
src/runner_black_holes.c
with
21 additions
and
5 deletions
src/runner_black_holes.c
+
21
−
5
View file @
39740c15
...
...
@@ -306,9 +306,10 @@ void runner_do_bh_swallow(struct runner *r, struct cell *c, int timer) {
}
}
else
{
/* Loop over all the
gas
particles in the cell
/* Loop over all the
BH
particles in the cell
* Note that the cell (and hence the bparts) may be local or foreign. */
const
size_t
nr_cell_bparts
=
c
->
black_holes
.
count
;
for
(
size_t
k
=
0
;
k
<
nr_cell_bparts
;
k
++
)
{
/* Get a handle on the part. */
...
...
@@ -317,7 +318,7 @@ void runner_do_bh_swallow(struct runner *r, struct cell *c, int timer) {
/* Ignore inhibited particles (they have already been removed!) */
if
(
bpart_is_inhibited
(
cell_bp
,
e
))
continue
;
/* Get the ID of the black holes that will swallow this part */
/* Get the ID of the black holes that will swallow this
b
part */
const
long
long
swallow_id
=
black_holes_get_bpart_swallow_id
(
&
cell_bp
->
merger_data
);
...
...
@@ -350,7 +351,21 @@ void runner_do_bh_swallow(struct runner *r, struct cell *c, int timer) {
*/
lock_lock
(
&
s
->
lock
);
/* Swallow the gas particle (i.e. update the BH properties) */
/* If bpart is inhibited, it cannot do any swallowing */
if
(
bpart_is_inhibited
(
bp
,
e
))
{
message
(
"BH %lld inhibited -- DOES NOT swallow BH %lld"
,
bp
->
id
,
cell_bp
->
id
);
/* Pretend it was found */
found
=
1
;
if
(
lock_unlock
(
&
s
->
lock
)
!=
0
)
error
(
"Failed to unlock the space."
);
break
;
}
/* Swallow the BH particle (i.e. update the swallowing BH
* properties with the properties of cell_bp) */
black_holes_swallow_bpart
(
bp
,
cell_bp
,
e
->
cosmology
,
e
->
time
,
with_cosmology
,
props
);
...
...
@@ -360,12 +375,12 @@ void runner_do_bh_swallow(struct runner *r, struct cell *c, int timer) {
message
(
"BH %lld swallowing BH particle %lld"
,
bp
->
id
,
cell_bp
->
id
);
/* If the
gas
particle is local, remove it */
/* If the
BH
particle is local, remove it */
if
(
c
->
nodeID
==
e
->
nodeID
)
{
message
(
"BH %lld removing BH particle %lld"
,
bp
->
id
,
cell_bp
->
id
);
/* Finally, remove the
gas
particle from the system
/* Finally, remove the
BH
particle from the system
* Recall that the gpart associated with it is also removed
* at the same time. */
cell_remove_bpart
(
e
,
c
,
cell_bp
);
...
...
@@ -414,6 +429,7 @@ void runner_do_bh_swallow(struct runner *r, struct cell *c, int timer) {
error
(
"BH particle %lld could not find BH %lld to be swallowed"
,
cell_bp
->
id
,
swallow_id
);
}
}
/* Part was flagged for swallowing */
}
/* Loop over the parts */
}
/* Cell is not split */
...
...
This diff is collapsed.
Click to expand it.
John Helly
@jch
mentioned in issue
#660 (closed)
·
5 years ago
mentioned in issue
#660 (closed)
mentioned in issue #660
Toggle commit list
John Helly
@jch
mentioned in issue
#662 (closed)
·
5 years ago
mentioned in issue
#662 (closed)
mentioned in issue #662
Toggle commit list
John Helly
@jch
mentioned in issue
#665 (closed)
·
5 years ago
mentioned in issue
#665 (closed)
mentioned in issue #665
Toggle commit list
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment