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
SWIFT
SWIFTsim
Commits
47bc1438
Commit
47bc1438
authored
Aug 06, 2018
by
James Willis
Browse files
Created a separate variable to hold the step interval between STF outputs.
parent
3eae86b1
Changes
5
Hide whitespace changes
Inline
Side-by-side
examples/EAGLE_25/eagle_25.yml
View file @
47bc1438
...
...
@@ -14,7 +14,7 @@ StructureFinding:
scale_factor_first
:
0.92
# Scale-factor of the first snaphot (cosmological run)
time_first
:
0.01
# Time of the first structure finding output (in internal units).
delta_step
:
1000
# Time difference between consecutive structure finding outputs (in internal units) in simulation steps.
delta_time
:
1
e-4
# Time difference between consecutive structure finding outputs (in internal units) in simulation time intervals.
delta_time
:
1
.10
# Time difference between consecutive structure finding outputs (in internal units) in simulation time intervals.
# Cosmological parameters
Cosmology
:
...
...
examples/EAGLE_6/eagle_6.yml
View file @
47bc1438
...
...
@@ -14,7 +14,7 @@ StructureFinding:
scale_factor_first
:
0.92
# Scale-factor of the first snaphot (cosmological run)
time_first
:
0.01
# Time of the first structure finding output (in internal units).
delta_step
:
1000
# Time difference between consecutive structure finding outputs (in internal units) in simulation steps.
delta_time
:
1
e-4
# Time difference between consecutive structure finding outputs (in internal units) in simulation time intervals.
delta_time
:
1
.10
# Time difference between consecutive structure finding outputs (in internal units) in simulation time intervals.
# Cosmological parameters
Cosmology
:
...
...
examples/SmallCosmoVolume/small_cosmo_volume.yml
View file @
47bc1438
...
...
@@ -14,7 +14,7 @@ StructureFinding:
scale_factor_first
:
0.92
# Scale-factor of the first snaphot (cosmological run)
time_first
:
0.01
# Time of the first structure finding output (in internal units).
delta_step
:
1000
# Time difference between consecutive structure finding outputs (in internal units) in simulation steps.
delta_time
:
1
e-4
# Time difference between consecutive structure finding outputs (in internal units) in simulation time intervals.
delta_time
:
1
.02
# Time difference between consecutive structure finding outputs (in internal units) in simulation time intervals.
# WMAP9 cosmology
Cosmology
:
...
...
src/engine.c
View file @
47bc1438
...
...
@@ -4780,7 +4780,7 @@ void engine_step(struct engine *e) {
/* Do we want to perform structure finding? */
if
((
e
->
policy
&
engine_policy_structure_finding
))
{
if
(
e
->
stf_output_freq_format
==
STEPS
&&
e
->
step
%
(
int
)
e
->
delta
Time
STF
==
0
)
if
(
e
->
stf_output_freq_format
==
STEPS
&&
e
->
step
%
e
->
delta
Step
STF
==
0
)
e
->
run_stf
=
1
;
else
if
(
e
->
stf_output_freq_format
==
TIME
&&
e
->
ti_end_min
>=
e
->
ti_nextSTF
&&
e
->
ti_nextSTF
>
0
)
e
->
run_stf
=
1
;
...
...
@@ -5791,6 +5791,7 @@ void engine_config(int restart, struct engine *e, struct swift_params *params,
e
->
restart_dt
=
0
;
e
->
timeFirstSTFOutput
=
0
;
e
->
deltaTimeSTF
=
0
;
e
->
deltaStepSTF
=
0
;
e
->
stf_output_freq_format
=
0
;
e
->
ti_nextSTF
=
0
;
e
->
run_stf
=
0
;
...
...
@@ -5804,7 +5805,7 @@ void engine_config(int restart, struct engine *e, struct swift_params *params,
//velociraptor_init(e);
e
->
stf_output_freq_format
=
parser_get_param_int
(
params
,
"StructureFinding:output_time_format"
);
if
(
e
->
stf_output_freq_format
==
STEPS
)
{
e
->
delta
Time
STF
=
parser_get_param_int
(
params
,
"StructureFinding:delta_step"
);
e
->
delta
Step
STF
=
parser_get_param_int
(
params
,
"StructureFinding:delta_step"
);
}
else
if
(
e
->
stf_output_freq_format
==
TIME
)
{
e
->
deltaTimeSTF
=
parser_get_param_double
(
params
,
"StructureFinding:delta_time"
);
...
...
@@ -6089,9 +6090,10 @@ void engine_config(int restart, struct engine *e, struct swift_params *params,
"simulation start a=%e."
,
e
->
a_first_statistics
,
e
->
cosmology
->
a_begin
);
if
(
e
->
policy
&
engine_policy_structure_finding
)
{
if
((
e
->
policy
&
engine_policy_structure_finding
)
&&
(
e
->
stf_output_freq_format
==
TIME
))
{
if
(
e
->
deltaTimeSTF
<=
1
.)
error
(
"Time between
snapshots
(%e) must be > 1."
,
e
->
deltaTimeSTF
);
error
(
"Time between
STF
(%e) must be > 1."
,
e
->
deltaTimeSTF
);
if
(
e
->
a_first_stf
<
e
->
cosmology
->
a_begin
)
error
(
...
...
@@ -6122,7 +6124,7 @@ void engine_config(int restart, struct engine *e, struct swift_params *params,
"t=%e."
,
e
->
time_first_statistics
,
e
->
time_begin
);
if
(
e
->
policy
&
engine_policy_structure_finding
)
{
if
(
(
e
->
policy
&
engine_policy_structure_finding
)
&&
(
e
->
stf_output_freq_format
==
TIME
))
{
if
(
e
->
deltaTimeSTF
<=
0
.)
error
(
"Time between STF (%e) must be positive."
,
...
...
src/engine.h
View file @
47bc1438
...
...
@@ -227,6 +227,7 @@ struct engine {
double
a_first_stf
;
double
timeFirstSTFOutput
;
double
deltaTimeSTF
;
int
deltaStepSTF
;
/* Integer time of the next stf output */
integertime_t
ti_nextSTF
;
...
...
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