Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
dumux-repositories
dumux
Commits
d0a74915
Commit
d0a74915
authored
1 year ago
by
Dennis Gläser
Committed by
Timo Koch
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
[checkpointtimeloop] reuse base eps
parent
1d50c7a3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!3618
[TimeLoop] define base tolerance
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dumux/common/timeloop.hh
+8
-5
8 additions, 5 deletions
dumux/common/timeloop.hh
with
8 additions
and
5 deletions
dumux/common/timeloop.hh
+
8
−
5
View file @
d0a74915
...
...
@@ -99,8 +99,6 @@ public:
template
<
class
Scalar
>
class
TimeLoop
:
public
TimeLoopBase
<
Scalar
>
{
static
constexpr
Scalar
baseEps_
=
1e-10
;
public:
TimeLoop
(
Scalar
startTime
,
Scalar
dt
,
Scalar
tEnd
,
bool
verbose
=
true
)
:
timer_
(
false
)
...
...
@@ -377,6 +375,8 @@ public:
*/
protected
:
static
constexpr
Scalar
baseEps_
=
1e-10
;
Dune
::
Timer
timer_
;
Scalar
time_
;
Scalar
endTime_
;
...
...
@@ -418,14 +418,14 @@ public:
//! Check point management, TimeLoop::isCheckPoint() has to be called after this!
// if we reached a periodic check point
if
(
periodicCheckPoints_
&&
Dune
::
FloatCmp
::
eq
(
newTime
-
lastPeriodicCheckPoint_
,
deltaPeriodicCheckPoint_
,
1e-7
))
if
(
periodicCheckPoints_
&&
fuzzyEqual_
(
newTime
-
lastPeriodicCheckPoint_
,
deltaPeriodicCheckPoint_
))
{
lastPeriodicCheckPoint_
+=
deltaPeriodicCheckPoint_
;
isCheckPoint_
=
true
;
}
// or a manually set check point
else
if
(
!
checkPoints_
.
empty
()
&&
Dune
::
FloatCmp
::
eq
(
newTime
-
checkPoints_
.
front
(),
0.0
,
1e-7
))
else
if
(
!
checkPoints_
.
empty
()
&&
fuzzyEqual_
(
newTime
-
checkPoints_
.
front
(),
0.0
))
{
checkPoints_
.
pop
();
isCheckPoint_
=
true
;
...
...
@@ -508,7 +508,7 @@ public:
<<
Fmt
::
format
(
"with the next check point at {:.5g} seconds.
\n
"
,
lastPeriodicCheckPoint_
+
interval
);
// check if the current time point is a check point
if
(
Dune
::
FloatCmp
::
eq
(
this
->
time
()
-
lastPeriodicCheckPoint_
,
0.0
,
1e-7
))
if
(
fuzzyEqual_
(
this
->
time
()
-
lastPeriodicCheckPoint_
,
0.0
))
isCheckPoint_
=
true
;
// make sure we respect this check point on the next time step
...
...
@@ -577,6 +577,9 @@ public:
}
private
:
bool
fuzzyEqual_
(
const
Scalar
t0
,
const
Scalar
t1
)
const
{
return
Dune
::
FloatCmp
::
eq
(
t0
,
t1
,
this
->
baseEps_
);
}
//! Adds a check point to the queue
void
setCheckPoint_
(
Scalar
t
)
{
...
...
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