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
3094307e
Commit
3094307e
authored
7 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Added some more cosmological information to the snapshots.
parent
f0d50532
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/cosmology.c
+9
-0
9 additions, 0 deletions
src/cosmology.c
src/parallel_io.c
+1
-0
1 addition, 0 deletions
src/parallel_io.c
src/serial_io.c
+1
-0
1 addition, 0 deletions
src/serial_io.c
src/single_io.c
+1
-0
1 addition, 0 deletions
src/single_io.c
with
12 additions
and
0 deletions
src/cosmology.c
+
9
−
0
View file @
3094307e
...
...
@@ -642,8 +642,12 @@ void cosmology_write_model(hid_t h_grp, const struct cosmology *c) {
io_write_attribute_d
(
h_grp
,
"a_end"
,
c
->
a_end
);
io_write_attribute_d
(
h_grp
,
"time_beg [internal units]"
,
c
->
time_begin
);
io_write_attribute_d
(
h_grp
,
"time_end [internal units]"
,
c
->
time_end
);
io_write_attribute_d
(
h_grp
,
"Universe age [internal units]"
,
c
->
time
);
io_write_attribute_d
(
h_grp
,
"Lookback time [internal units]"
,
c
->
lookback_time
);
io_write_attribute_d
(
h_grp
,
"h"
,
c
->
h
);
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_m
);
io_write_attribute_d
(
h_grp
,
"Omega_r"
,
c
->
Omega_r
);
...
...
@@ -652,6 +656,11 @@ void cosmology_write_model(hid_t h_grp, const struct cosmology *c) {
io_write_attribute_d
(
h_grp
,
"Omega_lambda"
,
c
->
Omega_lambda
);
io_write_attribute_d
(
h_grp
,
"w_0"
,
c
->
w_0
);
io_write_attribute_d
(
h_grp
,
"w_a"
,
c
->
w_a
);
io_write_attribute_d
(
h_grp
,
"w"
,
c
->
w
);
io_write_attribute_d
(
h_grp
,
"Redshift"
,
c
->
z
);
io_write_attribute_d
(
h_grp
,
"Scale-factor"
,
c
->
a
);
io_write_attribute_d
(
h_grp
,
"Critical density [internal units]"
,
c
->
critical_density
);
}
#endif
...
...
This diff is collapsed.
Click to expand it.
src/parallel_io.c
+
1
−
0
View file @
3094307e
...
...
@@ -904,6 +904,7 @@ void prepare_file(struct engine* e, const char* baseName, long long N_total[6],
io_write_attribute
(
h_grp
,
"Dimension"
,
INT
,
&
dimension
,
1
);
io_write_attribute
(
h_grp
,
"Redshift"
,
DOUBLE
,
&
e
->
cosmology
->
z
,
1
);
io_write_attribute
(
h_grp
,
"Scale-factor"
,
DOUBLE
,
&
e
->
cosmology
->
a
,
1
);
io_write_attribute_s
(
h_grp
,
"Code"
,
"SWIFT"
);
/* GADGET-2 legacy values */
/* Number of particles of each type */
...
...
This diff is collapsed.
Click to expand it.
src/serial_io.c
+
1
−
0
View file @
3094307e
...
...
@@ -813,6 +813,7 @@ void write_output_serial(struct engine* e, const char* baseName,
io_write_attribute
(
h_grp
,
"Dimension"
,
INT
,
&
dimension
,
1
);
io_write_attribute
(
h_grp
,
"Redshift"
,
DOUBLE
,
&
e
->
cosmology
->
z
,
1
);
io_write_attribute
(
h_grp
,
"Scale-factor"
,
DOUBLE
,
&
e
->
cosmology
->
a
,
1
);
io_write_attribute_s
(
h_grp
,
"Code"
,
"SWIFT"
);
/* GADGET-2 legacy values */
/* Number of particles of each type */
...
...
This diff is collapsed.
Click to expand it.
src/single_io.c
+
1
−
0
View file @
3094307e
...
...
@@ -667,6 +667,7 @@ void write_output_single(struct engine* e, const char* baseName,
io_write_attribute
(
h_grp
,
"Dimension"
,
INT
,
&
dimension
,
1
);
io_write_attribute
(
h_grp
,
"Redshift"
,
DOUBLE
,
&
e
->
cosmology
->
z
,
1
);
io_write_attribute
(
h_grp
,
"Scale-factor"
,
DOUBLE
,
&
e
->
cosmology
->
a
,
1
);
io_write_attribute_s
(
h_grp
,
"Code"
,
"SWIFT"
);
/* GADGET-2 legacy values */
/* Number of particles of each type */
...
...
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