Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Volker Springel
Gadget4
Commits
27e822d9
Commit
27e822d9
authored
May 11, 2021
by
Volker Springel
Browse files
resurrected storing HubbleParam/Hubble in deprecated GADGET2_HEADER
parent
cda6e3b5
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/io/snap_io.cc
View file @
27e822d9
...
...
@@ -415,13 +415,13 @@ void snap_io::read_ic(const char *fname)
Sp
->
NumPart
+=
add_numpart
;
#endif
#ifdef GADGET2_HEADER
#ifndef INITIAL_CONDITIONS_CONTAIN_ENTROPY
if
(
header
.
flag_entropy_instead_u
)
Terminate
(
"Initial condition file contains entropy, but INITIAL_CONDITIONS_CONTAIN_ENTROPY is not set
\n
"
);
#else
if
(
!
header
.
flag_entropy_instead_u
)
Terminate
(
"Initial condition file contains uthermal, but INITIAL_CONDITIONS_CONTAIN_ENTROPY is set
\n
"
);
if
(
header
.
flag_entropy_instead_u
)
Terminate
(
"Initial condition file contains entropy, but INITIAL_CONDITIONS_CONTAIN_ENTROPY is not set
\n
"
);
#else
if
(
!
header
.
flag_entropy_instead_u
)
Terminate
(
"Initial condition file contains uthermal, but INITIAL_CONDITIONS_CONTAIN_ENTROPY is set
\n
"
);
#endif
#endif
...
...
@@ -736,6 +736,11 @@ void snap_io::fill_file_header(int writeTask, int lastTask, long long *n_type, l
header
.
Omega0
=
All
.
Omega0
;
header
.
OmegaLambda
=
All
.
OmegaLambda
;
#if !(defined(REARRANGE_OPTION) && defined(MERGERTREE))
header
.
HubbleParam
=
All
.
HubbleParam
;
header
.
Hubble
=
All
.
Hubble
;
#endif
#ifdef OUTPUT_IN_DOUBLEPRECISION
header
.
flag_doubleprecision
=
1
;
#else
...
...
src/io/snap_io.h
View file @
27e822d9
...
...
@@ -79,10 +79,13 @@ class snap_io : public IO_Def
double
BoxSize
;
/**< box-size of simulation in case periodic boundaries were used */
double
Omega0
;
/**< matter density in units of critical density */
double
OmegaLambda
;
/**< cosmological constant parameter */
long
long
Ntrees
;
// this replaces the storage space for HubbleParam
long
long
TotNtrees
;
// this replaces the storage space for Hubble
// double HubbleParam; /**< little 'h' to scale units systems */
// double Hubble; /**< Hubble constant in internal units */
#if defined(REARRANGE_OPTION) && defined(MERGERTREE)
long
long
Ntrees
;
// this replaces the storage space for HubbleParam
long
long
TotNtrees
;
// this replaces the storage space for Hubble
#else
double
HubbleParam
;
/**< little 'h' to scale units systems */
double
Hubble
;
/**< Hubble constant in internal units */
#endif
unsigned
int
npartTotalHighWord
[
NTYPES_HEADER
];
/**< High word of the total number of particles of each type */
int
flag_entropy_instead_u
;
/**< flags that IC-file contains entropy instead of u */
int
flag_doubleprecision
;
/**< flags that snapshot contains double-precision instead of single precision */
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment