Skip to content
Snippets Groups Projects
Commit bfaf7319 authored by Dennis Gläser's avatar Dennis Gläser Committed by Timo Koch
Browse files

[test][timeloop] outsource to function

parent d0a74915
No related branches found
No related tags found
1 merge request!3618[TimeLoop] define base tolerance
...@@ -17,15 +17,9 @@ ...@@ -17,15 +17,9 @@
#include <dumux/common/initialize.hh> #include <dumux/common/initialize.hh>
#include <dumux/common/timeloop.hh> #include <dumux/common/timeloop.hh>
int main(int argc, char* argv[]) template<class MPIHelper>
void testTimeLoops(const MPIHelper& mpiHelper, double tStart, double tEnd, double dt)
{ {
// maybe initialize MPI and/or multithreading backend
Dumux::initialize(argc, argv);
const auto& mpiHelper = Dune::MPIHelper::instance();
//! Standard time loop
double tStart = 0; double tEnd = 1; double dt = 0.1;
//! Standard time loop //! Standard time loop
{ {
if (mpiHelper.rank() == 0) std::cout << "------- Test time loop ----------" << std::endl; if (mpiHelper.rank() == 0) std::cout << "------- Test time loop ----------" << std::endl;
...@@ -203,6 +197,15 @@ int main(int argc, char* argv[]) ...@@ -203,6 +197,15 @@ int main(int argc, char* argv[])
if (result.empty()) if (result.empty())
DUNE_THROW(Dune::Exception, "Setting a zero timeStepSize should print a warning to std::cerr"); DUNE_THROW(Dune::Exception, "Setting a zero timeStepSize should print a warning to std::cerr");
} }
}
int main(int argc, char* argv[])
{
// maybe initialize MPI and/or multithreading backend
Dumux::initialize(argc, argv);
const auto& mpiHelper = Dune::MPIHelper::instance();
testTimeLoops(mpiHelper, 0.0, 1.0, 0.1);
return 0; return 0;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment