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
332dd994
Commit
332dd994
authored
6 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Applied code formatting tool.
parent
9d15ed1b
No related branches found
No related tags found
1 merge request
!768
Update h_max
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/runner.c
+22
-27
22 additions, 27 deletions
src/runner.c
with
22 additions
and
27 deletions
src/runner.c
+
22
−
27
View file @
332dd994
...
@@ -157,11 +157,11 @@ void runner_do_stars_ghost(struct runner *r, struct cell *c, int timer) {
...
@@ -157,11 +157,11 @@ void runner_do_stars_ghost(struct runner *r, struct cell *c, int timer) {
if
(
c
->
split
)
{
if
(
c
->
split
)
{
for
(
int
k
=
0
;
k
<
8
;
k
++
)
for
(
int
k
=
0
;
k
<
8
;
k
++
)
if
(
c
->
progeny
[
k
]
!=
NULL
)
{
if
(
c
->
progeny
[
k
]
!=
NULL
)
{
runner_do_stars_ghost
(
r
,
c
->
progeny
[
k
],
0
);
runner_do_stars_ghost
(
r
,
c
->
progeny
[
k
],
0
);
/* update h_max */
/* update h_max */
if
(
c
->
progeny
[
k
]
->
stars
.
h_max
>
h_max
)
if
(
c
->
progeny
[
k
]
->
stars
.
h_max
>
h_max
)
h_max
=
c
->
progeny
[
k
]
->
stars
.
h_max
;
h_max
=
c
->
progeny
[
k
]
->
stars
.
h_max
;
}
}
}
else
{
}
else
{
...
@@ -349,11 +349,10 @@ void runner_do_stars_ghost(struct runner *r, struct cell *c, int timer) {
...
@@ -349,11 +349,10 @@ void runner_do_stars_ghost(struct runner *r, struct cell *c, int timer) {
/* We now have a particle whose smoothing length has converged */
/* We now have a particle whose smoothing length has converged */
/* Check if h_max is increased */
/* Check if h_max is increased */
if
(
h_max
<
sp
->
h
)
if
(
h_max
<
sp
->
h
)
h_max
=
sp
->
h
;
h_max
=
sp
->
h
;
stars_reset_feedback
(
sp
);
stars_reset_feedback
(
sp
);
/* Compute the stellar evolution */
/* Compute the stellar evolution */
stars_evolve_spart
(
sp
,
e
->
stars_properties
,
cosmo
);
stars_evolve_spart
(
sp
,
e
->
stars_properties
,
cosmo
);
...
@@ -427,19 +426,16 @@ void runner_do_stars_ghost(struct runner *r, struct cell *c, int timer) {
...
@@ -427,19 +426,16 @@ void runner_do_stars_ghost(struct runner *r, struct cell *c, int timer) {
}
}
/* update h_max */
/* update h_max */
if
(
h_max
>
c
->
stars
.
h_max
)
if
(
h_max
>
c
->
stars
.
h_max
)
c
->
stars
.
h_max
=
h_max
;
c
->
stars
.
h_max
=
h_max
;
/* The ghost may not always be at the top level.
/* The ghost may not always be at the top level.
* Therefore we need to update h_max above the ghost */
* Therefore we need to update h_max above the ghost */
if
(
c
->
stars
.
ghost
)
{
if
(
c
->
stars
.
ghost
)
{
for
(
struct
cell
*
tmp
=
c
->
parent
;
tmp
!=
NULL
;
tmp
=
tmp
->
parent
)
{
for
(
struct
cell
*
tmp
=
c
->
parent
;
tmp
!=
NULL
;
tmp
=
tmp
->
parent
)
{
if
(
h_max
>
tmp
->
stars
.
h_max
)
if
(
h_max
>
tmp
->
stars
.
h_max
)
tmp
->
stars
.
h_max
=
h_max
;
tmp
->
stars
.
h_max
=
h_max
;
}
}
}
}
if
(
timer
)
TIMER_TOC
(
timer_dostars_ghost
);
if
(
timer
)
TIMER_TOC
(
timer_dostars_ghost
);
}
}
...
@@ -1477,11 +1473,11 @@ void runner_do_ghost(struct runner *r, struct cell *c, int timer) {
...
@@ -1477,11 +1473,11 @@ void runner_do_ghost(struct runner *r, struct cell *c, int timer) {
if
(
c
->
split
)
{
if
(
c
->
split
)
{
for
(
int
k
=
0
;
k
<
8
;
k
++
)
for
(
int
k
=
0
;
k
<
8
;
k
++
)
if
(
c
->
progeny
[
k
]
!=
NULL
)
{
if
(
c
->
progeny
[
k
]
!=
NULL
)
{
runner_do_ghost
(
r
,
c
->
progeny
[
k
],
0
);
runner_do_ghost
(
r
,
c
->
progeny
[
k
],
0
);
/* update h_max */
/* update h_max */
if
(
c
->
progeny
[
k
]
->
hydro
.
h_max
>
h_max
)
{
if
(
c
->
progeny
[
k
]
->
hydro
.
h_max
>
h_max
)
{
h_max
=
c
->
progeny
[
k
]
->
hydro
.
h_max
;
h_max
=
c
->
progeny
[
k
]
->
hydro
.
h_max
;
}
}
}
}
}
else
{
}
else
{
...
@@ -1724,12 +1720,12 @@ void runner_do_ghost(struct runner *r, struct cell *c, int timer) {
...
@@ -1724,12 +1720,12 @@ void runner_do_ghost(struct runner *r, struct cell *c, int timer) {
}
}
}
}
/* We now have a particle whose smoothing length has converged */
/* We now have a particle whose smoothing length has converged */
/* Check if h_max is increased */
/* Check if h_max is increased */
if
(
h_max
<
p
->
h
)
{
if
(
h_max
<
p
->
h
)
{
h_max
=
p
->
h
;
h_max
=
p
->
h
;
}
}
#ifdef EXTRA_HYDRO_LOOP
#ifdef EXTRA_HYDRO_LOOP
...
@@ -1851,9 +1847,8 @@ void runner_do_ghost(struct runner *r, struct cell *c, int timer) {
...
@@ -1851,9 +1847,8 @@ void runner_do_ghost(struct runner *r, struct cell *c, int timer) {
/* The ghost may not always be at the top level.
/* The ghost may not always be at the top level.
* Therefore we need to update h_max above the ghost */
* Therefore we need to update h_max above the ghost */
if
(
c
->
hydro
.
ghost
)
{
if
(
c
->
hydro
.
ghost
)
{
for
(
struct
cell
*
tmp
=
c
->
parent
;
tmp
!=
NULL
;
tmp
=
tmp
->
parent
)
{
for
(
struct
cell
*
tmp
=
c
->
parent
;
tmp
!=
NULL
;
tmp
=
tmp
->
parent
)
{
if
(
h_max
>
tmp
->
hydro
.
h_max
)
if
(
h_max
>
tmp
->
hydro
.
h_max
)
tmp
->
hydro
.
h_max
=
h_max
;
tmp
->
hydro
.
h_max
=
h_max
;
}
}
}
}
...
...
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