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
9df5f9c7
Commit
9df5f9c7
authored
1 year ago
by
Willem Elbers
Browse files
Options
Downloads
Patches
Plain Diff
Make sure that the metadata (Omega_m, Omega_dcdm, etc.) in shapshots reflect decaying dark matter
parent
e4cd8723
Branches
merge_dcdm
No related tags found
1 merge request
!1907
Draft: Merge dcdm
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/cosmology.c
+11
-5
11 additions, 5 deletions
src/cosmology.c
src/cosmology.h
+6
-0
6 additions, 0 deletions
src/cosmology.h
with
17 additions
and
5 deletions
src/cosmology.c
+
11
−
5
View file @
9df5f9c7
...
...
@@ -260,11 +260,13 @@ void cosmology_update(struct cosmology *c, const struct phys_const *phys_const,
/* Update the neutrino density */
c
->
Omega_nu
=
cosmology_get_neutrino_density
(
c
,
a
);
/* Update the decaying dark matter and dark radiation densities */
c
->
Omega_dcdm
=
cosmology_get_dcdm_density
(
c
,
a
);
c
->
Omega_dr
=
cosmology_get_dr_density
(
c
,
a
);
/* E(z) */
const
double
Omega_dcdm
=
cosmology_get_dcdm_density
(
c
,
a
);
const
double
Omega_dr
=
cosmology_get_dr_density
(
c
,
a
);
const
double
Omega_r
=
c
->
Omega_r
+
c
->
Omega_nu
+
Omega_dr
;
const
double
Omega_m
=
c
->
Omega_cdm
+
c
->
Omega_b
+
Omega_dcdm
;
const
double
Omega_r
=
c
->
Omega_r
+
c
->
Omega_nu
+
c
->
Omega_dr
;
const
double
Omega_m
=
c
->
Omega_cdm
+
c
->
Omega_b
+
c
->
Omega_dcdm
;
const
double
Omega_k
=
c
->
Omega_k
;
const
double
Omega_l
=
c
->
Omega_lambda
;
const
double
w0
=
c
->
w_0
;
...
...
@@ -1256,6 +1258,8 @@ void cosmology_init_no_cosmo(struct cosmology *c) {
c
->
Omega_dcdmdr_0
=
0
.;
c
->
Gamma_dcdm
=
0
.;
c
->
Omega_dcdm
=
0
.;
c
->
Omega_dr
=
0
.;
c
->
Omega_ur
=
0
.;
c
->
Omega_g
=
0
.;
...
...
@@ -1789,7 +1793,7 @@ void cosmology_write_model(hid_t h_grp, const struct cosmology *c) {
io_write_attribute_d
(
h_grp
,
"H0 [internal units]"
,
c
->
H0
);
io_write_attribute_d
(
h_grp
,
"H [internal units]"
,
c
->
H
);
io_write_attribute_d
(
h_grp
,
"Hubble time [internal units]"
,
c
->
Hubble_time
);
io_write_attribute_d
(
h_grp
,
"Omega_m"
,
c
->
Omega_cdm
+
c
->
Omega_b
);
io_write_attribute_d
(
h_grp
,
"Omega_m"
,
c
->
Omega_cdm
+
c
->
Omega_b
+
c
->
Omega_dcdm
);
io_write_attribute_d
(
h_grp
,
"Omega_r"
,
c
->
Omega_r
);
io_write_attribute_d
(
h_grp
,
"Omega_b"
,
c
->
Omega_b
);
io_write_attribute_d
(
h_grp
,
"Omega_k"
,
c
->
Omega_k
);
...
...
@@ -1798,6 +1802,8 @@ void cosmology_write_model(hid_t h_grp, const struct cosmology *c) {
io_write_attribute_d
(
h_grp
,
"Omega_nu_0"
,
c
->
Omega_nu_0
);
io_write_attribute_d
(
h_grp
,
"Omega_ur"
,
c
->
Omega_ur
);
io_write_attribute_d
(
h_grp
,
"Omega_cdm"
,
c
->
Omega_cdm
);
io_write_attribute_d
(
h_grp
,
"Omega_dcdm"
,
c
->
Omega_dcdm
);
io_write_attribute_d
(
h_grp
,
"Omega_dr"
,
c
->
Omega_dr
);
io_write_attribute_d
(
h_grp
,
"Omega_g"
,
c
->
Omega_g
);
io_write_attribute_d
(
h_grp
,
"T_nu_0 [internal units]"
,
c
->
T_nu_0
);
io_write_attribute_d
(
h_grp
,
"T_nu_0 [eV]"
,
c
->
T_nu_0_eV
);
...
...
This diff is collapsed.
Click to expand it.
src/cosmology.h
+
6
−
0
View file @
9df5f9c7
...
...
@@ -172,6 +172,12 @@ struct cosmology {
/*! The initial decaying dark matter density (computed) */
double
Omega_dcdm_ini
;
/*! The current decaying dark matter density (computed) */
double
Omega_dcdm
;
/*! The current dark radiation density (computed) */
double
Omega_dr
;
/*! Ultra-relativistic species (e.g. massless neutrinos) density parameter */
double
Omega_ur
;
...
...
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