...
  View open merge request
Commits (6)
......@@ -147,6 +147,12 @@ test:st:ode:
- $DUNECONTROL --only=dorie configure
- $DUNECONTROL --only=dorie make test_run_ode
test:st:timestep_scheme:
<<: *test
script:
- $DUNECONTROL --only=dorie configure
- $DUNECONTROL --only=dorie make test_run_timestep_scheme
test:st:parallel:
<<: *test
tags:
......
......@@ -20,6 +20,7 @@
* Code coverage reports for unit tests. Detailed reports can be retrieved from
the artifacts of the `test:unit-tests` test in the folder
`build-cmake/test/coverage`. The total coverage is reported to GitLab.
* Now, there are several timestep schemes available via the ini filie.
### Changed
* `Simulation` is renamed `RichardsSimulation` and moved to
......
......@@ -245,6 +245,13 @@ adding an empty line, make text **bold** or ``monospaced``.
<values> float &lt; 1 </values>
<suggestion> 0.5 </suggestion>
</parameter>
<parameter name="timestepScheme">
<definition> Numerical scheme for the stepping in time. </definition>
<values> implicitEuler, heun, shu3, rk4, alex2, fractional, alex3 </values>
<suggestion> alex2 </suggestion>
<comment> Choose type of timestep scheme: implicitEuler, alex2, fractional, alex3 </comment>
</parameter>
</category>
<category name="parameters">
......
......@@ -57,6 +57,20 @@ RichardsSimulation<Traits>::RichardsSimulation (Dune::MPIHelper& _helper, std::s
u = std::make_shared<U>(*gfs,.0);
Dune::PDELab::interpolate(*finitial,*gfs,*u);
// --- Set timestep scheme --- //
std::string tsscheme_str = _inifile.get<std::string>("time.timestepScheme");
if (tsscheme_str=="implicitEuler")
tsscheme = std::make_unique<Dune::PDELab::ImplicitEulerParameter<RF>>();
else if (tsscheme_str=="alex2")
tsscheme = std::make_unique<Dune::PDELab::Alexander2Parameter<RF>>();
else if (tsscheme_str=="fractional")
tsscheme = std::make_unique<Dune::PDELab::FractionalStepParameter<RF>>();
else if (tsscheme_str=="alex3")
tsscheme = std::make_unique<Dune::PDELab::Alexander3Parameter<RF>>();
else
DUNE_THROW(NotImplemented,"Not known time step scheme: "
<< tsscheme_str << "!");
// --- Operator Setup --- //
operator_setup();
......@@ -104,7 +118,7 @@ void RichardsSimulation<Traits>::operator_setup ()
if(osm){
osm_result = osm->result(); // cache old result
}
osm = std::make_unique<OSM>(alex2,*igo,*pdesolver);
osm = std::make_unique<OSM>(*tsscheme,*igo,*pdesolver);
osm->setResult(osm_result);
osm->setVerbosityLevel(verbose+1);
......
......@@ -109,7 +109,7 @@ struct RichardsSimulationTraits : public BaseTraits
/// Non-linear solver types
using PDESOLVER = Dune::PDELab::Newton<IGO,LS,U>;
/// Time stepping scheme
using TimeStepScheme = Dune::PDELab::Alexander2Parameter<RF>;
using TimeStepScheme = Dune::PDELab::TimeSteppingParameterInterface<RF>;
/// Methods computing the time step
using OSM = Dune::PDELab::OneStepMethod<RF,IGO,PDESOLVER,U,U>;
......@@ -268,7 +268,7 @@ protected:
std::unique_ptr<LS> ls;
std::unique_ptr<PDESOLVER> pdesolver;
std::unique_ptr<OSM> osm;
TimeStepScheme alex2;
std::unique_ptr<TimeStepScheme> tsscheme;
std::shared_ptr<U> u;
......
......@@ -9,6 +9,13 @@ dorie_add_metaini_test(TARGET dorie METAINI ode_layered.mini.in)
add_custom_target(test_run_ode
COMMAND ctest --output-on-failure --tests-regex ^dorie_ode.+$)
# dorie run: TimestepScheme tests
dorie_add_metaini_test(TARGET dorie METAINI timestep_scheme.mini.in)
# add target for TimestepScheme tests
add_custom_target(test_run_timestep_scheme
COMMAND ctest --output-on-failure --tests-regex timestep_scheme_.+$)
# dorie run: Reference tests
dorie_add_metaini_test(TARGET dorie-rfg METAINI parfield_muphi.mini.in)
dorie_add_metaini_test(TARGET dorie METAINI muphi.mini.in)
......
include ${CMAKE_BINARY_DIR}/doc/default_files/config.ini
__name = timestep_scheme
_test_command = run
_asset_path = "${CMAKE_CURRENT_LIST_DIR}"
_evaluation = ode
output.fileName = timestep_scheme | unique name
output.outputPath = timestep_scheme | unique name
output.verbose = 0
time.end = 1E7
time.maxTimestep = 1E7
time.startTimestep = 1E4
# heun, shu3, and rk4 do not work even for this naive case
time.timestepScheme = implicitEuler, alex2, fractional, alex3 | expand prec
adaptivity.useAdaptivity = false
grid.dimensions = 2
grid.initialLevel = 0
grid.gridType = rectangular
grid.cells = 1 160
grid.FEorder = 1
grid.extensions = 1 1
boundary.file = "{_asset_path}/bcs/infiltration_2d.dat"
parameters.arrayFile = "{_asset_path}/parfields/sand.h5"
[_ode]
flux = -5.55e-6
head_abstol = 3E-6
flux_abstol = 5E-11, 5E-11, 5E-9, 5E-11 | expand prec
\ No newline at end of file