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
faeb9758
Commit
faeb9758
authored
7 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Added cosmological terms to the cooling task.
parent
14c0fe90
No related branches found
No related tags found
1 merge request
!509
Cosmological time integration
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/runner.c
+17
-6
17 additions, 6 deletions
src/runner.c
with
17 additions
and
6 deletions
src/runner.c
+
17
−
6
View file @
faeb9758
...
...
@@ -173,14 +173,17 @@ void runner_do_grav_external(struct runner *r, struct cell *c, int timer) {
*/
void
runner_do_cooling
(
struct
runner
*
r
,
struct
cell
*
c
,
int
timer
)
{
struct
part
*
restrict
parts
=
c
->
parts
;
struct
xpart
*
restrict
xparts
=
c
->
xparts
;
const
int
count
=
c
->
count
;
const
struct
engine
*
e
=
r
->
e
;
const
struct
cosmology
*
cosmo
=
e
->
cosmology
;
const
int
with_cosmology
=
(
e
->
policy
&
engine_policy_cosmology
);
const
struct
cooling_function_data
*
cooling_func
=
e
->
cooling_func
;
const
struct
phys_const
*
constants
=
e
->
physical_constants
;
const
struct
unit_system
*
us
=
e
->
internal_units
;
const
double
time_base
=
e
->
time_base
;
const
integertime_t
ti_current
=
e
->
ti_current
;
struct
part
*
restrict
parts
=
c
->
parts
;
struct
xpart
*
restrict
xparts
=
c
->
xparts
;
const
int
count
=
c
->
count
;
TIMER_TIC
;
...
...
@@ -202,11 +205,19 @@ void runner_do_cooling(struct runner *r, struct cell *c, int timer) {
if
(
part_is_active
(
p
,
e
))
{
// MATTHIEU -- cosmological dt for cooling??? */
double
dt_cool
;
if
(
with_cosmology
)
{
const
integertime_t
ti_step
=
get_integer_timestep
(
p
->
time_bin
);
const
integertime_t
ti_begin
=
get_integer_time_begin
(
ti_current
+
1
,
p
->
time_bin
);
dt_cool
=
cosmology_get_delta_time
(
cosmo
,
ti_begin
,
ti_begin
+
ti_step
);
}
else
{
dt_cool
=
get_timestep
(
p
->
time_bin
,
time_base
);
}
/* Let's cool ! */
const
double
dt
=
get_timestep
(
p
->
time_bin
,
time_base
);
cooling_cool_part
(
constants
,
us
,
cooling_func
,
p
,
xp
,
dt
);
cooling_cool_part
(
constants
,
us
,
cooling_func
,
p
,
xp
,
dt_cool
);
}
}
}
...
...
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