Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
b5381515
Commit
b5381515
authored
Mar 11, 2018
by
Matthieu Schaller
Browse files
Be less verbose when initialising the cosmology model and when computing the next snapshot time.
parent
157bc5e8
Changes
3
Hide whitespace changes
Inline
Side-by-side
examples/main.c
View file @
b5381515
...
@@ -606,7 +606,7 @@ int main(int argc, char *argv[]) {
...
@@ -606,7 +606,7 @@ int main(int argc, char *argv[]) {
cosmology_init
(
params
,
&
us
,
&
prog_const
,
&
cosmo
);
cosmology_init
(
params
,
&
us
,
&
prog_const
,
&
cosmo
);
else
else
cosmology_init_no_cosmo
(
&
cosmo
);
cosmology_init_no_cosmo
(
&
cosmo
);
if
(
with_cosmology
)
cosmology_print
(
&
cosmo
);
if
(
myrank
==
0
&&
with_cosmology
)
cosmology_print
(
&
cosmo
);
/* Initialise the hydro properties */
/* Initialise the hydro properties */
if
(
with_hydro
)
hydro_props_init
(
&
hydro_properties
,
params
);
if
(
with_hydro
)
hydro_props_init
(
&
hydro_properties
,
params
);
...
...
src/cosmology.h
View file @
b5381515
...
@@ -192,6 +192,7 @@ void cosmology_write_model(hid_t h_grp, const struct cosmology *c);
...
@@ -192,6 +192,7 @@ void cosmology_write_model(hid_t h_grp, const struct cosmology *c);
/* Dump/restore. */
/* Dump/restore. */
void
cosmology_struct_dump
(
const
struct
cosmology
*
cosmology
,
FILE
*
stream
);
void
cosmology_struct_dump
(
const
struct
cosmology
*
cosmology
,
FILE
*
stream
);
void
cosmology_struct_restore
(
int
enabled
,
struct
cosmology
*
cosmology
,
FILE
*
stream
);
void
cosmology_struct_restore
(
int
enabled
,
struct
cosmology
*
cosmology
,
FILE
*
stream
);
#endif
/* SWIFT_COSMOLOGY_H */
#endif
/* SWIFT_COSMOLOGY_H */
src/engine.c
View file @
b5381515
...
@@ -5818,11 +5818,13 @@ void engine_compute_next_snapshot_time(struct engine *e) {
...
@@ -5818,11 +5818,13 @@ void engine_compute_next_snapshot_time(struct engine *e) {
if
(
e
->
policy
&
engine_policy_cosmology
)
{
if
(
e
->
policy
&
engine_policy_cosmology
)
{
const
float
next_snapshot_time
=
const
float
next_snapshot_time
=
exp
(
e
->
ti_nextSnapshot
*
e
->
time_base
)
*
e
->
cosmology
->
a_begin
;
exp
(
e
->
ti_nextSnapshot
*
e
->
time_base
)
*
e
->
cosmology
->
a_begin
;
message
(
"Next output time set to a=%e."
,
next_snapshot_time
);
if
(
e
->
verbose
)
message
(
"Next output time set to a=%e."
,
next_snapshot_time
);
}
else
{
}
else
{
const
float
next_snapshot_time
=
const
float
next_snapshot_time
=
e
->
ti_nextSnapshot
*
e
->
time_base
+
e
->
time_begin
;
e
->
ti_nextSnapshot
*
e
->
time_base
+
e
->
time_begin
;
message
(
"Next output time set to t=%e."
,
next_snapshot_time
);
if
(
e
->
verbose
)
message
(
"Next output time set to t=%e."
,
next_snapshot_time
);
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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