Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
wenqing
ogs
Commits
b76f127f
Commit
b76f127f
authored
Jan 14, 2021
by
wenqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[dt] Corrected dt for IterationNumberBasedTimeStepping when a time step is rejected.
parent
8becbac6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
NumLib/TimeStepping/Algorithms/IterationNumberBasedTimeStepping.cpp
...eStepping/Algorithms/IterationNumberBasedTimeStepping.cpp
+9
-1
NumLib/TimeStepping/Algorithms/IterationNumberBasedTimeStepping.h
...imeStepping/Algorithms/IterationNumberBasedTimeStepping.h
+5
-3
No files found.
NumLib/TimeStepping/Algorithms/IterationNumberBasedTimeStepping.cpp
View file @
b76f127f
...
...
@@ -57,10 +57,15 @@ std::tuple<bool, double> IterationNumberBasedTimeStepping::next(
{
_iter_times
=
number_iterations
;
if
(
_previous_time_step_accepted
)
{
_ts_prev
=
_ts_current
;
}
// confirm current time and move to the next if accepted
if
(
accepted
())
{
_
ts_prev
=
_ts_current
;
_
previous_time_step_accepted
=
true
;
return
std
::
make_tuple
(
true
,
getNextTimeStepSize
());
}
else
...
...
@@ -83,6 +88,9 @@ std::tuple<bool, double> IterationNumberBasedTimeStepping::next(
_ts_prev
=
// essentially equal to _ts_prev.dt = _ts_current.dt.
TimeStep
{
_ts_prev
.
previous
(),
_ts_prev
.
previous
()
+
dt
,
_ts_prev
.
steps
()};
_previous_time_step_accepted
=
false
;
return
std
::
make_tuple
(
false
,
dt
);
}
return
{};
...
...
NumLib/TimeStepping/Algorithms/IterationNumberBasedTimeStepping.h
View file @
b76f127f
...
...
@@ -102,7 +102,7 @@ public:
bool
canReduceTimestepSize
()
const
override
;
/// Return the number of repeated steps.
/// Return the number of
the total
repeated steps.
int
getNumberOfRepeatedSteps
()
const
{
return
_n_rejected_steps
;
}
private:
...
...
@@ -127,9 +127,11 @@ private:
const
int
_max_iter
;
/// The number of nonlinear iterations.
int
_iter_times
=
0
;
/// The number of rejected steps.
/// The number of
total
rejected steps.
int
_n_rejected_steps
=
0
;
/// True, if the timestep is accepted.
bool
_previous_time_step_accepted
=
true
;
/// True, if the current time step is accepted.
bool
_accepted
=
true
;
};
...
...
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