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
6d1e59da
Commit
6d1e59da
authored
6 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Make the cosmology routines interpolate the correct table for the hydro kick and thermal kick.
parent
1118d268
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/cosmology.c
+6
-5
6 additions, 5 deletions
src/cosmology.c
with
6 additions
and
5 deletions
src/cosmology.c
+
6
−
5
View file @
6d1e59da
...
...
@@ -585,7 +585,8 @@ double cosmology_get_grav_kick_factor(const struct cosmology *c,
/**
* @brief Computes the cosmology factor that enters the hydro kick operator.
*
* Computes \f$ \int_{a_start}^{a_end} dt/a \f$ using the interpolation table.
* Computes \f$ \int_{a_start}^{a_end} dt/a^{3(gamma - 1)} \f$ using the
* interpolation table.
*
* @param c The current #cosmology.
* @param ti_start the (integer) time of the start of the drift.
...
...
@@ -602,9 +603,9 @@ double cosmology_get_hydro_kick_factor(const struct cosmology *c,
const
double
a_start
=
c
->
log_a_begin
+
ti_start
*
c
->
time_base
;
const
double
a_end
=
c
->
log_a_begin
+
ti_end
*
c
->
time_base
;
const
double
int_start
=
interp_table
(
c
->
drift
_fac_interp_table
,
a_start
,
const
double
int_start
=
interp_table
(
c
->
hydro_kick
_fac_interp_table
,
a_start
,
c
->
log_a_begin
,
c
->
log_a_end
);
const
double
int_end
=
interp_table
(
c
->
drift
_fac_interp_table
,
a_end
,
const
double
int_end
=
interp_table
(
c
->
hydro_kick
_fac_interp_table
,
a_end
,
c
->
log_a_begin
,
c
->
log_a_end
);
return
int_end
-
int_start
;
...
...
@@ -631,9 +632,9 @@ double cosmology_get_therm_kick_factor(const struct cosmology *c,
const
double
a_start
=
c
->
log_a_begin
+
ti_start
*
c
->
time_base
;
const
double
a_end
=
c
->
log_a_begin
+
ti_end
*
c
->
time_base
;
const
double
int_start
=
interp_table
(
c
->
hydro_kick
_fac_interp_table
,
a_start
,
const
double
int_start
=
interp_table
(
c
->
drift
_fac_interp_table
,
a_start
,
c
->
log_a_begin
,
c
->
log_a_end
);
const
double
int_end
=
interp_table
(
c
->
hydro_kick
_fac_interp_table
,
a_end
,
const
double
int_end
=
interp_table
(
c
->
drift
_fac_interp_table
,
a_end
,
c
->
log_a_begin
,
c
->
log_a_end
);
return
int_end
-
int_start
;
...
...
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