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
ef7b5f19
Commit
ef7b5f19
authored
5 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Merge onto the most massive of the two BHs.
parent
66de389e
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!863
Black holes mergers
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/black_holes/EAGLE/black_holes_iact.h
+11
-6
11 additions, 6 deletions
src/black_holes/EAGLE/black_holes_iact.h
src/black_holes/EAGLE/black_holes_struct.h
+5
-0
5 additions, 0 deletions
src/black_holes/EAGLE/black_holes_struct.h
with
16 additions
and
6 deletions
src/black_holes/EAGLE/black_holes_iact.h
+
11
−
6
View file @
ef7b5f19
...
...
@@ -219,11 +219,12 @@ runner_iact_nonsym_bh_bh_swallow(const float r2, const float *dx,
const
float
G
=
43
.;
// MATTHIEU: Fix this!!!
/* The BH with the smaller ID will be merged onto the one with the larger ID
*/
if
(
bj
->
id
<
bi
->
id
)
{
message
(
"ID is smaller"
);
/* The BH with the smaller mass will be merged onto the one with the
* larger mass.
* To avoid rounding issues, we additionally check for IDs if the BHs
* have the exact same mass. */
if
((
bj
->
subgrid_mass
<
bi
->
subgrid_mass
)
||
(
bj
->
subgrid_mass
==
bi
->
subgrid_mass
&&
bj
->
id
<
bi
->
id
))
{
/* Merge if gravitationally bound
* Note that we use the kernel support here as the size and not just the
...
...
@@ -234,11 +235,15 @@ runner_iact_nonsym_bh_bh_swallow(const float r2, const float *dx,
/* This particle is swallowed by the BH with the largest ID of all the
* candidates wanting to swallow it */
if
(
bj
->
merger_data
.
swallow_id
<
bi
->
id
)
{
if
((
bj
->
merger_data
.
swallow_mass
<
bi
->
subgrid_mass
)
||
(
bj
->
merger_data
.
swallow_mass
==
bi
->
subgrid_mass
&&
bj
->
merger_data
.
swallow_id
<
bi
->
id
))
{
message
(
"BH %lld wants to swallow BH particle %lld"
,
bi
->
id
,
bj
->
id
);
bj
->
merger_data
.
swallow_id
=
bi
->
id
;
bj
->
merger_data
.
swallow_mass
=
bi
->
subgrid_mass
;
}
else
{
message
(
...
...
This diff is collapsed.
Click to expand it.
src/black_holes/EAGLE/black_holes_struct.h
+
5
−
0
View file @
ef7b5f19
...
...
@@ -35,6 +35,9 @@ struct black_holes_bpart_data {
/*! ID of the black-hole that will swallow this #bpart. */
long
long
swallow_id
;
/*! Mass of the black-hole that will swallow this #bpart. */
float
swallow_mass
;
};
/**
...
...
@@ -82,6 +85,7 @@ __attribute__((always_inline)) INLINE static void
black_holes_mark_bpart_as_not_swallowed
(
struct
black_holes_bpart_data
*
p_data
)
{
p_data
->
swallow_id
=
-
1
;
p_data
->
swallow_mass
=
0
.
f
;
}
/**
...
...
@@ -94,6 +98,7 @@ __attribute__((always_inline)) INLINE static void
black_holes_mark_bpart_as_merged
(
struct
black_holes_bpart_data
*
p_data
)
{
p_data
->
swallow_id
=
-
2
;
p_data
->
swallow_mass
=
-
1
.
f
;
}
/**
...
...
This diff is collapsed.
Click to expand it.
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