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
7c052c00
Commit
7c052c00
authored
9 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Also check that the final time is larger than the initial time + correct a typo.
parent
f4836978
No related branches found
No related tags found
2 merge requests
!136
Master
,
!104
Multi time step warnings and stop condition
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/main.c
+1
-5
1 addition, 5 deletions
examples/main.c
src/engine.c
+12
-0
12 additions, 0 deletions
src/engine.c
with
13 additions
and
5 deletions
examples/main.c
+
1
−
5
View file @
7c052c00
...
...
@@ -171,7 +171,7 @@ int main(int argc, char *argv[]) {
case
'd'
:
if
(
sscanf
(
optarg
,
"%f"
,
&
dt_min
)
!=
1
)
error
(
"Error parsing minimal timestep."
);
if
(
myrank
==
0
)
message
(
"dt_min set to %e."
,
dt_m
ax
);
if
(
myrank
==
0
)
message
(
"dt_min set to %e."
,
dt_m
in
);
fflush
(
stdout
);
break
;
case
'e'
:
...
...
@@ -323,10 +323,6 @@ int main(int argc, char *argv[]) {
aFactor
(
&
us
,
UNIT_CONV_ENTROPY
),
hFactor
(
&
us
,
UNIT_CONV_ENTROPY
));
}
/* Check we have sensible time step bounds */
if
(
dt_min
>
dt_max
)
error
(
"Minimal time step size must be large than maximal time step size "
);
/* Check whether an IC file has been provided */
if
(
strcmp
(
ICfileName
,
""
)
==
0
)
error
(
"An IC file name must be provided via the option -f"
);
...
...
This diff is collapsed.
Click to expand it.
src/engine.c
+
12
−
0
View file @
7c052c00
...
...
@@ -1936,6 +1936,18 @@ void engine_init(struct engine *e, struct space *s, float dt, int nr_threads,
/* Print information about the hydro scheme */
if
(
e
->
nodeID
==
0
)
message
(
"Hydrodynamic scheme: %s"
,
SPH_IMPLEMENTATION
);
/* Check we have sensible time bounds */
if
(
timeBegin
>=
timeEnd
)
error
(
"Final simulation time (t_end = %e) must be larger than the start time "
"(t_beg = %e)"
,
timeEnd
,
timeBegin
);
/* Check we have sensible time step bounds */
if
(
e
->
dt_min
>
e
->
dt_max
)
error
(
"Minimal time step size must be smaller than maximal time step size "
);
/* Deal with timestep */
e
->
timeBase
=
(
timeEnd
-
timeBegin
)
/
max_nr_timesteps
;
e
->
ti_current
=
0
;
...
...
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