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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
415f21ce
Commit
415f21ce
authored
Aug 4, 2020
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Document the logic in runner_do_star_formation() a bit better
parent
f3793a0e
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/runner_others.c
+7
-1
7 additions, 1 deletion
src/runner_others.c
with
7 additions
and
1 deletion
src/runner_others.c
+
7
−
1
View file @
415f21ce
...
@@ -339,7 +339,9 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) {
...
@@ -339,7 +339,9 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) {
const
int
spawn_spart
=
const
int
spawn_spart
=
star_formation_should_spawn_spart
(
p
,
xp
,
sf_props
);
star_formation_should_spawn_spart
(
p
,
xp
,
sf_props
);
/* Are we using a model that actually generates star particles? */
if
(
swift_star_formation_model_creates_stars
)
{
if
(
swift_star_formation_model_creates_stars
)
{
/* Check if we should create a new particle or transform one */
/* Check if we should create a new particle or transform one */
if
(
spawn_spart
)
{
if
(
spawn_spart
)
{
/* Spawn a new spart (+ gpart) */
/* Spawn a new spart (+ gpart) */
...
@@ -348,7 +350,11 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) {
...
@@ -348,7 +350,11 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) {
/* Convert the gas particle to a star particle */
/* Convert the gas particle to a star particle */
sp
=
cell_convert_part_to_spart
(
e
,
c
,
p
,
xp
);
sp
=
cell_convert_part_to_spart
(
e
,
c
,
p
,
xp
);
}
}
}
else
{
}
else
{
/* We are in a model where spart don't exist
* --> convert the part to a DM gpart */
cell_convert_part_to_gpart
(
e
,
c
,
p
,
xp
);
cell_convert_part_to_gpart
(
e
,
c
,
p
,
xp
);
}
}
...
@@ -393,7 +399,7 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) {
...
@@ -393,7 +399,7 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) {
/* log_all */
1
,
/* log_all */
1
,
/* special flags */
0
);
/* special flags */
0
);
#endif
#endif
}
else
{
}
else
if
(
swift_star_formation_model_creates_stars
)
{
/* Do something about the fact no star could be formed.
/* Do something about the fact no star could be formed.
Note that in such cases a tree rebuild to create more free
Note that in such cases a tree rebuild to create more free
...
...
...
...
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
sign in
to comment