Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CSDS Reader
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Loic Hausammann
CSDS Reader
Merge requests
!51
Cleanup cosmology + parameters
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Cleanup cosmology + parameters
cleanup_cosmo
into
master
Overview
0
Commits
2
Pipelines
2
Changes
14
Merged
Loic Hausammann
requested to merge
cleanup_cosmo
into
master
3 years ago
Overview
0
Commits
2
Pipelines
2
Changes
14
Expand
#23 (closed)
0
0
Merge request reports
Compare
master
version 1
f083369a
3 years ago
master (base)
and
latest version
latest version
4de9bb45
2 commits,
3 years ago
version 1
f083369a
1 commit,
3 years ago
14 files
+
380
−
380
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
14
Search (e.g. *.vue) (Ctrl+P)
src/csds_cosmology.cpp
+
12
−
19
Options
@@ -25,45 +25,38 @@
#include
"csds_tools.hpp"
/**
* @brief Compute the first time derivative of the scale factor
*
* @param cosmo The cosmological model
* @param scale The scale factor
*
* @return The first derivative of the scale factor.
* @brief Initialize the #Cosmology from a file.
*/
void
csds_cosmology_init
(
struct
csds_cosmology
*
cosmo
,
struct
csds_parser
*
params
)
{
Cosmology
::
Cosmology
(
struct
csds_parser
&
params
)
{
/* Read Omega_cdm */
cosmo
->
Omega
_c
dm
=
parser_get_param_double
(
params
,
"Cosmology:Omega_cdm"
);
m
Omega
C
dm
=
parser_get_param_double
(
params
,
"Cosmology:Omega_cdm"
);
/* Read Omega_lambda */
cosmo
->
Omega_lambda
=
parser_get_param_double
(
params
,
"Cosmology:Omega_lambda"
);
mOmegaLambda
=
parser_get_param_double
(
params
,
"Cosmology:Omega_lambda"
);
/* Read Omega_b */
cosmo
->
Omega_b
=
parser_get_param_double
(
params
,
"Cosmology:Omega_b"
);
mOmegaBaryon
=
parser_get_param_double
(
params
,
"Cosmology:Omega_b"
);
/* Read Omega_r */
cosmo
->
Omega_r
=
parser_get_param_double
(
params
,
"Cosmology:Omega_r"
);
mOmegaRadiation
=
parser_get_param_double
(
params
,
"Cosmology:Omega_r"
);
/* Read Omega_k */
cosmo
->
Omega_k
=
parser_get_param_double
(
params
,
"Cosmology:Omega_k"
);
mOmegaCurvature
=
parser_get_param_double
(
params
,
"Cosmology:Omega_k"
);
/* Read Omega_nu_0 */
double
O
mega_nu_0
=
double
o
mega_nu_0
=
parser_get_opt_param_double
(
params
,
"Cosmology:Omega_nu_0"
,
0
);
if
(
O
mega_nu_0
!=
0
)
if
(
o
mega_nu_0
!=
0
)
csds_error
(
"Neutrinos are not implemented in the cosmology."
);
/* Read w_0 */
cosmo
->
w_
0
=
parser_get_param_double
(
params
,
"Cosmology:w_0"
);
mW
0
=
parser_get_param_double
(
params
,
"Cosmology:w_0"
);
/* Read w_a */
cosmo
->
w_
a
=
parser_get_param_double
(
params
,
"Cosmology:w_a"
);
mW
a
=
parser_get_param_double
(
params
,
"Cosmology:w_a"
);
/* Read the Hubble constant at z=0 */
cosmo
->
H0
=
parser_get_param_double
(
params
,
"Cosmology:Hubble0"
);
m
H0
=
parser_get_param_double
(
params
,
"Cosmology:Hubble0"
);
}
Loading