diff --git a/examples/cahn_hilliard/doc/main.md b/examples/cahn_hilliard/doc/main.md index 1d42334b80f602504e740832fbe363eae8c8b316..1f30c44ce2288cb66f9508d9c2c98e7ddbd8bba8 100644 --- a/examples/cahn_hilliard/doc/main.md +++ b/examples/cahn_hilliard/doc/main.md @@ -44,6 +44,7 @@ We start in `main.cc` with the necessary header includes: #include <dumux/assembly/fvassembler.hh> #include <dune/grid/yaspgrid.hh> +#include <dumux/io/chrono.hh> #include <dumux/io/vtkoutputmodule.hh> #include <dumux/io/grid/gridmanager_yasp.hh> @@ -329,16 +330,16 @@ the time step size from the parameter tree (`params.input`) ```cpp auto timeLoop = std::make_shared<CheckPointTimeLoop<Scalar>>( - getParam<Scalar>("TimeLoop.TStart", 0.0), - getParam<Scalar>("TimeLoop.InitialTimeStepSize"), - getParam<Scalar>("TimeLoop.TEnd") + Chrono::toSeconds(getParam("TimeLoop.TStart", "0")), + Chrono::toSeconds(getParam("TimeLoop.InitialTimeStepSize")), + Chrono::toSeconds(getParam("TimeLoop.TEnd")) ); ``` We set the maximum time step size allowed in the adaptive time stepping scheme. ```cpp - timeLoop->setMaxTimeStepSize(getParam<Scalar>("TimeLoop.MaxTimeStepSize")); + timeLoop->setMaxTimeStepSize(Chrono::toSeconds(getParam("TimeLoop.MaxTimeStepSize"))); ``` Next, we choose the type of assembler, linear solver and PDE solver diff --git a/examples/cahn_hilliard/main.cc b/examples/cahn_hilliard/main.cc index 6ddde40f8b2aaaf10460f5fa2c18c267a815a2fc..ba61d24284320f0e97a4bd921bce21b3ed128e8b 100644 --- a/examples/cahn_hilliard/main.cc +++ b/examples/cahn_hilliard/main.cc @@ -40,6 +40,7 @@ #include <dumux/assembly/fvassembler.hh> #include <dune/grid/yaspgrid.hh> +#include <dumux/io/chrono.hh> #include <dumux/io/vtkoutputmodule.hh> #include <dumux/io/grid/gridmanager_yasp.hh> @@ -266,13 +267,13 @@ int main(int argc, char** argv) // We instantiate time loop using start and end time as well as // the time step size from the parameter tree (`params.input`) auto timeLoop = std::make_shared<CheckPointTimeLoop<Scalar>>( - getParam<Scalar>("TimeLoop.TStart", 0.0), - getParam<Scalar>("TimeLoop.InitialTimeStepSize"), - getParam<Scalar>("TimeLoop.TEnd") + Chrono::toSeconds(getParam("TimeLoop.TStart", "0")), + Chrono::toSeconds(getParam("TimeLoop.InitialTimeStepSize")), + Chrono::toSeconds(getParam("TimeLoop.TEnd")) ); // We set the maximum time step size allowed in the adaptive time stepping scheme. - timeLoop->setMaxTimeStepSize(getParam<Scalar>("TimeLoop.MaxTimeStepSize")); + timeLoop->setMaxTimeStepSize(Chrono::toSeconds(getParam("TimeLoop.MaxTimeStepSize"))); // Next, we choose the type of assembler, linear solver and PDE solver // and construct instances of these classes. diff --git a/examples/cahn_hilliard/params.input b/examples/cahn_hilliard/params.input index f9d41a960d4dd43dd177449a3ffdba6ea82425c4..05a95c190d0281650808b46488a10cc7c1fb1467 100644 --- a/examples/cahn_hilliard/params.input +++ b/examples/cahn_hilliard/params.input @@ -1,7 +1,7 @@ [TimeLoop] -TEnd = 1.0 -InitialTimeStepSize = 0.0025 -MaxTimeStepSize = 0.01 +TEnd = 1.0s +InitialTimeStepSize = 2.5ms +MaxTimeStepSize = 10ms [Grid] LowerLeft = 0 0