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
7e031e16
Commit
7e031e16
authored
6 years ago
by
lhausamm
Committed by
Loic Hausammann
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add cosmological function between a and z
parent
60383c3c
No related branches found
No related tags found
1 merge request
!560
Output time from a file
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/cosmology.c
+11
-0
11 additions, 0 deletions
src/cosmology.c
src/cosmology.h
+8
-0
8 additions, 0 deletions
src/cosmology.h
with
19 additions
and
0 deletions
src/cosmology.c
+
11
−
0
View file @
7e031e16
...
...
@@ -639,6 +639,17 @@ double cosmology_get_delta_time(const struct cosmology *c,
return
t2
-
t1
;
}
/**
* @brief Compute the scale factor from the redshift.
*
* @brief c The current #cosmology.
* @brief redshift The redshift to compute.
*/
double
cosmology_get_a_from_z
(
const
struct
cosmology
*
c
,
double
redshift
)
{
return
1
.
/
(
1
.
+
redshift
);
}
/**
* @brief Prints the #cosmology model to stdout.
*/
...
...
This diff is collapsed.
Click to expand it.
src/cosmology.h
+
8
−
0
View file @
7e031e16
...
...
@@ -180,6 +180,13 @@ double cosmology_get_therm_kick_factor(const struct cosmology *cosmo,
double
cosmology_get_delta_time
(
const
struct
cosmology
*
c
,
integertime_t
ti_start
,
integertime_t
ti_end
);
double
cosmology_get_delta_time
(
const
struct
cosmology
*
c
,
double
a1
,
double
a2
);
double
cosmology_get_a_from_z
(
const
struct
cosmology
*
c
,
double
redshift
);
double
cosmology_get_time_since_big_bang
(
const
struct
cosmology
*
c
,
double
a
);
void
cosmology_init
(
struct
swift_params
*
params
,
const
struct
unit_system
*
us
,
const
struct
phys_const
*
phys_const
,
struct
cosmology
*
c
);
...
...
@@ -188,6 +195,7 @@ void cosmology_init_no_cosmo(struct cosmology *c);
void
cosmology_print
(
const
struct
cosmology
*
c
);
void
cosmology_clean
(
struct
cosmology
*
c
);
#ifdef HAVE_HDF5
void
cosmology_write_model
(
hid_t
h_grp
,
const
struct
cosmology
*
c
);
#endif
...
...
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