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
7ef09863
Commit
7ef09863
authored
7 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
On start-up, pass the cosmology model to the engine.
parent
7cd98af2
No related branches found
No related tags found
1 merge request
!509
Cosmological time integration
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
examples/main.c
+5
-7
5 additions, 7 deletions
examples/main.c
src/engine.c
+2
-1
2 additions, 1 deletion
src/engine.c
src/engine.h
+1
-1
1 addition, 1 deletion
src/engine.h
with
8 additions
and
9 deletions
examples/main.c
+
5
−
7
View file @
7ef09863
...
...
@@ -771,9 +771,9 @@ int main(int argc, char *argv[]) {
/* Initialize the engine with the space and policies. */
if
(
myrank
==
0
)
clocks_gettime
(
&
tic
);
engine_init
(
&
e
,
&
s
,
params
,
N_total
[
0
],
N_total
[
1
],
engine_policies
,
talking
,
&
reparttype
,
&
us
,
&
prog_const
,
&
hydro_properties
,
&
gravity_properties
,
&
potential
,
&
cooling_func
,
&
chemistry
,
&
sourceterms
);
talking
,
&
reparttype
,
&
us
,
&
prog_const
,
&
cosmo
,
&
hydro_properties
,
&
gravity_properties
,
&
potential
,
&
cooling_func
,
&
chemistry
,
&
sourceterms
);
engine_config
(
0
,
&
e
,
params
,
nr_nodes
,
myrank
,
nr_threads
,
with_aff
,
talking
,
restart_file
);
if
(
myrank
==
0
)
{
...
...
@@ -869,8 +869,7 @@ int main(int argc, char *argv[]) {
if
(
with_verbose_timers
)
timers_print
(
e
.
step
);
/* Every so often allow the user to stop the application and dump the
* restart
* files. */
* restart files. */
if
(
j
%
restart_stop_steps
==
0
)
{
force_stop
=
restart_stop_now
(
restart_dir
,
0
);
if
(
myrank
==
0
&&
force_stop
)
...
...
@@ -878,8 +877,7 @@ int main(int argc, char *argv[]) {
}
/* Also if using nsteps to exit, will not have saved any restarts on exit,
* make
* sure we do that (useful in testing only). */
* make sure we do that (useful in testing only). */
if
(
force_stop
||
(
e
.
restart_onexit
&&
e
.
step
-
1
==
nsteps
))
engine_dump_restarts
(
&
e
,
0
,
1
);
...
...
This diff is collapsed.
Click to expand it.
src/engine.c
+
2
−
1
View file @
7ef09863
...
...
@@ -5173,7 +5173,7 @@ void engine_init(
struct
engine
*
e
,
struct
space
*
s
,
const
struct
swift_params
*
params
,
long
long
Ngas
,
long
long
Ndm
,
int
policy
,
int
verbose
,
struct
repartition
*
reparttype
,
const
struct
unit_system
*
internal_units
,
const
struct
phys_const
*
physical_constants
,
const
struct
phys_const
*
physical_constants
,
struct
cosmology
*
cosmo
,
const
struct
hydro_props
*
hydro
,
const
struct
gravity_props
*
gravity
,
const
struct
external_potential
*
potential
,
const
struct
cooling_function_data
*
cooling_func
,
...
...
@@ -5222,6 +5222,7 @@ void engine_init(
e
->
count_step
=
0
;
e
->
wallclock_time
=
0
.
f
;
e
->
physical_constants
=
physical_constants
;
e
->
cosmology
=
cosmo
;
e
->
hydro_properties
=
hydro
;
e
->
gravity_properties
=
gravity
;
e
->
external_potential
=
potential
;
...
...
This diff is collapsed.
Click to expand it.
src/engine.h
+
1
−
1
View file @
7ef09863
...
...
@@ -328,7 +328,7 @@ void engine_init(
struct
engine
*
e
,
struct
space
*
s
,
const
struct
swift_params
*
params
,
long
long
Ngas
,
long
long
Ndm
,
int
policy
,
int
verbose
,
struct
repartition
*
reparttype
,
const
struct
unit_system
*
internal_units
,
const
struct
phys_const
*
physical_constants
,
const
struct
phys_const
*
physical_constants
,
struct
cosmology
*
cosmo
,
const
struct
hydro_props
*
hydro
,
const
struct
gravity_props
*
gravity
,
const
struct
external_potential
*
potential
,
const
struct
cooling_function_data
*
cooling_func
,
...
...
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