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
ae8b62f2
Commit
ae8b62f2
authored
6 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
First buggy attempt at forcing a re-sort after star formation has occured in a super cell.
parent
77f17f8c
No related branches found
No related tags found
2 merge requests
!745
Rewrite of MPI loops - Add stellar feedback loops
,
!744
Mpi stars2 matthieu
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/runner.c
+13
-3
13 additions, 3 deletions
src/runner.c
with
13 additions
and
3 deletions
src/runner.c
+
13
−
3
View file @
ae8b62f2
...
...
@@ -484,7 +484,7 @@ void runner_do_cooling(struct runner *r, struct cell *c, int timer) {
/**
*
*/
void
runner_do_star_formation
(
struct
runner
*
r
,
struct
cell
*
c
,
int
timer
)
{
void
runner_do_star_formation
(
struct
runner
*
r
,
struct
cell
*
c
,
int
timer
,
int
*
formed_stars
)
{
struct
engine
*
e
=
r
->
e
;
const
struct
cosmology
*
cosmo
=
e
->
cosmology
;
...
...
@@ -508,7 +508,7 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) {
/* Recurse? */
if
(
c
->
split
)
{
for
(
int
k
=
0
;
k
<
8
;
k
++
)
if
(
c
->
progeny
[
k
]
!=
NULL
)
runner_do_star_formation
(
r
,
c
->
progeny
[
k
],
0
);
if
(
c
->
progeny
[
k
]
!=
NULL
)
runner_do_star_formation
(
r
,
c
->
progeny
[
k
],
0
,
formed_stars
);
}
else
{
/* Loop over the gas particles in this cell. */
...
...
@@ -553,6 +553,9 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) {
/* Copy the properties of the gas particle to the star particle */
star_formation_copy_properties
(
p
,
xp
,
sp
,
e
,
sf_props
,
cosmo
,
with_cosmology
);
message
(
"STAR FORMED!!!! super->ID=%d"
,
c
->
super
->
cellID
);
(
*
formed_stars
)
++
;
}
}
else
{
/* Are we not star-forming? */
...
...
@@ -566,6 +569,10 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) {
}
/* Loop over particles */
}
if
(
timer
&&
*
formed_stars
>
0
)
{
runner_do_stars_sort
(
r
,
c
,
0x1FFF
,
0
,
0
);
}
if
(
timer
)
TIMER_TOC
(
timer_do_star_formation
);
}
...
...
@@ -3210,7 +3217,10 @@ void *runner_main(void *data) {
runner_do_cooling
(
r
,
t
->
ci
,
1
);
break
;
case
task_type_star_formation
:
runner_do_star_formation
(
r
,
t
->
ci
,
1
);
{
int
formed_stars
=
0
;
runner_do_star_formation
(
r
,
t
->
ci
,
1
,
&
formed_stars
);
}
break
;
default:
error
(
"Unknown/invalid task type (%d)."
,
t
->
type
);
...
...
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