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
7f55a108
Commit
7f55a108
authored
1 year ago
by
Dennis Gläser
Committed by
Timo Koch
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
[timeloop][test] remove mpi helper (not tested in parallel)
parent
7c003e74
No related branches found
No related tags found
1 merge request
!3618
[TimeLoop] define base tolerance
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/common/timeloop/test_timeloop.cc
+8
-11
8 additions, 11 deletions
test/common/timeloop/test_timeloop.cc
with
8 additions
and
11 deletions
test/common/timeloop/test_timeloop.cc
+
8
−
11
View file @
7f55a108
...
@@ -18,9 +18,7 @@
...
@@ -18,9 +18,7 @@
#include
<dumux/common/initialize.hh>
#include
<dumux/common/initialize.hh>
#include
<dumux/common/timeloop.hh>
#include
<dumux/common/timeloop.hh>
template
<
class
MPIHelper
>
void
testTimeLoops
(
double
tStart
,
void
testTimeLoops
(
const
MPIHelper
&
mpiHelper
,
double
tStart
,
double
tEnd
,
double
tEnd
,
double
dt
,
double
dt
,
std
::
optional
<
double
>
dtInLoop
=
{})
std
::
optional
<
double
>
dtInLoop
=
{})
...
@@ -33,7 +31,7 @@ void testTimeLoops(const MPIHelper& mpiHelper,
...
@@ -33,7 +31,7 @@ void testTimeLoops(const MPIHelper& mpiHelper,
//! Standard time loop
//! Standard time loop
{
{
if
(
mpiHelper
.
rank
()
==
0
)
std
::
cout
<<
"------- Test time loop ----------"
<<
std
::
endl
;
std
::
cout
<<
"------- Test time loop ----------"
<<
std
::
endl
;
Dumux
::
TimeLoop
<
double
>
timeLoop
(
tStart
,
dt
,
tEnd
);
Dumux
::
TimeLoop
<
double
>
timeLoop
(
tStart
,
dt
,
tEnd
);
if
(
std
::
abs
(
timeLoop
.
time
()
-
tStart
)
>
1e-15
)
if
(
std
::
abs
(
timeLoop
.
time
()
-
tStart
)
>
1e-15
)
...
@@ -77,7 +75,7 @@ void testTimeLoops(const MPIHelper& mpiHelper,
...
@@ -77,7 +75,7 @@ void testTimeLoops(const MPIHelper& mpiHelper,
// check point timeLoop
// check point timeLoop
{
{
if
(
mpiHelper
.
rank
()
==
0
)
std
::
cout
<<
std
::
endl
<<
"------- Test check point time loop ----------"
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
<<
"------- Test check point time loop ----------"
<<
std
::
endl
;
Dumux
::
CheckPointTimeLoop
<
double
>
timeLoop
(
tStart
,
dt
,
tEnd
);
Dumux
::
CheckPointTimeLoop
<
double
>
timeLoop
(
tStart
,
dt
,
tEnd
);
timeLoop
.
setPeriodicCheckPoint
(
0.03
*
dt
,
-
0.03
*
dt
);
timeLoop
.
setPeriodicCheckPoint
(
0.03
*
dt
,
-
0.03
*
dt
);
if
(
!
timeLoop
.
isCheckPoint
())
if
(
!
timeLoop
.
isCheckPoint
())
...
@@ -159,7 +157,7 @@ void testTimeLoops(const MPIHelper& mpiHelper,
...
@@ -159,7 +157,7 @@ void testTimeLoops(const MPIHelper& mpiHelper,
// check if time loops remembers time step before check point
// check if time loops remembers time step before check point
{
{
if
(
mpiHelper
.
rank
()
==
0
)
std
::
cout
<<
std
::
endl
<<
"------- Test check point time loop ----------"
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
<<
"------- Test check point time loop ----------"
<<
std
::
endl
;
Dumux
::
CheckPointTimeLoop
<
double
>
timeLoop
(
tStart
,
dt
,
tEnd
);
Dumux
::
CheckPointTimeLoop
<
double
>
timeLoop
(
tStart
,
dt
,
tEnd
);
timeLoop
.
setCheckPoint
(
1.01
*
dt
);
timeLoop
.
setCheckPoint
(
1.01
*
dt
);
timeLoop
.
start
();
timeLoop
.
start
();
...
@@ -218,19 +216,18 @@ int main(int argc, char* argv[])
...
@@ -218,19 +216,18 @@ int main(int argc, char* argv[])
{
{
// maybe initialize MPI and/or multithreading backend
// maybe initialize MPI and/or multithreading backend
Dumux
::
initialize
(
argc
,
argv
);
Dumux
::
initialize
(
argc
,
argv
);
const
auto
&
mpiHelper
=
Dune
::
MPIHelper
::
instance
();
// unit time
// unit time
testTimeLoops
(
mpiHelper
,
0.0
,
1.0
,
0.1
);
testTimeLoops
(
0.0
,
1.0
,
0.1
);
// microseconds
// microseconds
testTimeLoops
(
mpiHelper
,
0.0
,
1.0e-6
,
1e-7
);
testTimeLoops
(
0.0
,
1.0e-6
,
1e-7
);
// large time scales
// large time scales
testTimeLoops
(
mpiHelper
,
0.0
,
1.0e12
,
1e9
,
{
1e11
});
testTimeLoops
(
0.0
,
1.0e12
,
1e9
,
{
1e11
});
// large time scales but small initial time step
// large time scales but small initial time step
testTimeLoops
(
mpiHelper
,
0.0
,
1.0e12
,
0.1
,
{
1e11
});
testTimeLoops
(
0.0
,
1.0e12
,
0.1
,
{
1e11
});
return
0
;
return
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