-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Iteration number based time stepping #2318
Merged
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
7f9003c
[NL] Simplify creation of timestepper.
endJunction 18403ae
[NL] Small refactorings, renames, braces, types.
endJunction 3788375
[NL] Rename IterationNumberBasedTimeStepping.
endJunction ac90a1e
[NL] Implement createNumberBasedTimeStepping().
endJunction 060267b
Use int for number of iterations.
endJunction 4deb00f
[NL] Solvers now return a NonlinearSolverStatus.
endJunction a79b0b7
[NL] Pass number of iterations to time step algo.
endJunction 5893269
[NL] Add isSolutionErrorComputationNeeded = true
endJunction d3ae112
[T] Rename RichardsFlow PID adaptive dt project.
endJunction b2cee42
[T] New iteration nr. based dt; RichardsFlow
endJunction f0de2c5
[T] Drop unneeded tester specification.
endJunction c93c441
[NL] Use std::min/max instead of if's.
endJunction 315951f
[T/NL] Updates for the changes timestepper I/F.
endJunction 7813e4c
[T/NL] Change TimeSteppingIterationNumberBased2.
endJunction 869c342
[NL] Remove unnecessary setIterationNumber().
endJunction 47d12ef
[NL] TimeStepping; Cleanup comments and docu.
endJunction bd4d284
[doc] Add IterationNumberBasedTS prj tags docu.
endJunction f78423b
[NL] INBTS; Add strict constructor checks.
endJunction 81eed6e
[NL] INBTS; Extract findMultiplier().
endJunction 80fde82
[NL] INBTS; Special handling of first ts, first it
endJunction 8dfd301
[NL] NS; Avoid increment of the 'iteration'.
endJunction 52c35c3
[NL] INBTS; Take multiplier for number of iters.
endJunction 4706681
[PL] Time loop. Add dt information on output.
endJunction 7e3e98d
[NL] INBTS; Slightly simplify findMultiplier().
endJunction 735f2f4
[PL] TS: Change handling when reaching end time.
endJunction d59bc2a
[PL] TS; Remove an abort for repeated ts size.
endJunction File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -328,12 +328,6 @@ double UncoupledProcessesTimeLoop::computeTimeStepping( | |
{ | ||
auto& ppd = *_per_process_data[i]; | ||
const auto& timestepper = ppd.timestepper; | ||
if (t > timestepper->end()) | ||
{ | ||
// skip the process that already reaches the ending time. | ||
ppd.skip_time_stepping = true; | ||
continue; | ||
} | ||
|
||
auto& time_disc = ppd.time_disc; | ||
auto const& x = *_process_solutions[i]; | ||
|
@@ -431,7 +425,8 @@ double UncoupledProcessesTimeLoop::computeTimeStepping( | |
} | ||
else | ||
{ | ||
if (t < _end_time) | ||
if (t < _end_time || std::abs(t - _end_time) < | ||
std::numeric_limits<double>::epsilon()) | ||
{ | ||
WARN( | ||
"Time step %d was rejected %d times " | ||
|
@@ -451,7 +446,8 @@ double UncoupledProcessesTimeLoop::computeTimeStepping( | |
} | ||
else | ||
{ | ||
if (t < _end_time) | ||
if (t < _end_time || std::abs(t - _end_time) < | ||
std::numeric_limits<double>::epsilon()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It can be replaced with std::islessequal. |
||
{ | ||
t -= prev_dt; | ||
rejected_steps++; | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just found a std function: std::islessequal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I didn't know that function. But from cppreference it seems that the only difference to
operator<=(x, y)
is that the floating point exceptions are not raised (and we do like exceptions).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see.