Skip to content
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 26 commits into from
Jan 22, 2019
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 Jan 10, 2019
18403ae
[NL] Small refactorings, renames, braces, types.
endJunction Jan 10, 2019
3788375
[NL] Rename IterationNumberBasedTimeStepping.
endJunction Jan 10, 2019
ac90a1e
[NL] Implement createNumberBasedTimeStepping().
endJunction Jan 10, 2019
060267b
Use int for number of iterations.
endJunction Jan 13, 2019
4deb00f
[NL] Solvers now return a NonlinearSolverStatus.
endJunction Jan 14, 2019
a79b0b7
[NL] Pass number of iterations to time step algo.
endJunction Jan 14, 2019
5893269
[NL] Add isSolutionErrorComputationNeeded = true
endJunction Jan 14, 2019
d3ae112
[T] Rename RichardsFlow PID adaptive dt project.
endJunction Jan 13, 2019
b2cee42
[T] New iteration nr. based dt; RichardsFlow
endJunction Jan 13, 2019
f0de2c5
[T] Drop unneeded tester specification.
endJunction Jan 14, 2019
c93c441
[NL] Use std::min/max instead of if's.
endJunction Jan 15, 2019
315951f
[T/NL] Updates for the changes timestepper I/F.
endJunction Jan 15, 2019
7813e4c
[T/NL] Change TimeSteppingIterationNumberBased2.
endJunction Jan 16, 2019
869c342
[NL] Remove unnecessary setIterationNumber().
endJunction Jan 16, 2019
47d12ef
[NL] TimeStepping; Cleanup comments and docu.
endJunction Jan 16, 2019
bd4d284
[doc] Add IterationNumberBasedTS prj tags docu.
endJunction Jan 16, 2019
f78423b
[NL] INBTS; Add strict constructor checks.
endJunction Jan 18, 2019
81eed6e
[NL] INBTS; Extract findMultiplier().
endJunction Jan 18, 2019
80fde82
[NL] INBTS; Special handling of first ts, first it
endJunction Jan 18, 2019
8dfd301
[NL] NS; Avoid increment of the 'iteration'.
endJunction Jan 18, 2019
52c35c3
[NL] INBTS; Take multiplier for number of iters.
endJunction Jan 18, 2019
4706681
[PL] Time loop. Add dt information on output.
endJunction Jan 18, 2019
7e3e98d
[NL] INBTS; Slightly simplify findMultiplier().
endJunction Jan 18, 2019
735f2f4
[PL] TS: Change handling when reaching end time.
endJunction Jan 21, 2019
d59bc2a
[PL] TS; Remove an abort for repeated ts size.
endJunction Jan 21, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions ProcessLib/UncoupledProcessesTimeLoop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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())
Copy link
Member

@wenqing wenqing Jan 21, 2019

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.

Copy link
Member Author

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).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see.

{
WARN(
"Time step %d was rejected %d times "
Expand All @@ -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())
Copy link
Member

@wenqing wenqing Jan 21, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be replaced with std::islessequal.

{
t -= prev_dt;
rejected_steps++;
Expand Down