Commit f96c5ab1 authored by Lukas Riedel's avatar Lukas Riedel 📝

Merge branch 'master' into 94-base-class-for-simulations

parents a79c1d84 d9a9b8a4
......@@ -2,7 +2,6 @@
build-cmake/
# Exclude generated files
test/*.mini
python/parfield/wrapper/pf_from_file.py
python/testtools/wrapper/test_dorie.py
python/testtools/wrapper/test_dorie_pfg.py
......
......@@ -81,18 +81,27 @@ prep:update-dune-clang:
# --- Build jobs ---
build:main:
build:system-tests: &build-tests
stage: build
script:
- CMAKE_FLAGS="$CMAKE_FLAGS"
$DUNECONTROL --only=dorie all
- $DUNECONTROL --only=dorie make build_tests
$DUNECONTROL --only=dorie configure
- $DUNECONTROL --only=dorie make build_system_tests
- $DUNECONTROL --only=dorie make doc
artifacts:
name: "$CI_JOB_NAME"
paths:
- $CI_PROJECT_DIR/build-cmake
expire_in: 1 day
build:unit-tests:
<<: *build-tests
script:
- CMAKE_FLAGS="$CMAKE_FLAGS
-DCMAKE_BUILD_TYPE=Debug"
$DUNECONTROL --only=dorie configure
- $DUNECONTROL --only=dorie make build_unit_tests
build:debug: &debug
stage: build
allow_failure: true
......@@ -102,7 +111,7 @@ build:debug: &debug
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_CXX_FLAGS_DEBUG='-Werror'"
$DUNECONTROL --only=dorie configure
- $DUNECONTROL --only=dorie make dorie_mass_conservation
- $DUNECONTROL --only=dorie make build_unit_tests
build:debug-clang:
<<: *debug
......@@ -115,14 +124,14 @@ build:debug-clang:
-DCMAKE_CXX_COMPILER=clang++
-DCMAKE_CXX_FLAGS_DEBUG='-Werror'"
$DUNECONTROL --only=dorie configure
- $DUNECONTROL --only=dorie make dorie_mass_conservation
- $DUNECONTROL --only=dorie make build_unit_tests
# --- Tests ---
test:exec_cmds: &test
test:st:exec_cmds: &test
stage: test
dependencies:
- build:main
- build:system-tests
script:
- $DUNECONTROL --only=dorie configure
- $DUNECONTROL --only=dorie make test_dorie_exec
......@@ -132,13 +141,13 @@ test:exec_cmds: &test
- $CI_PROJECT_DIR/build-cmake/test
expire_in: 1 day
test:ode:
test:st:ode:
<<: *test
script:
- $DUNECONTROL --only=dorie configure
- $DUNECONTROL --only=dorie make test_run_ode
test:parallel:
test:st:parallel:
<<: *test
tags:
- multicore
......@@ -146,18 +155,39 @@ test:parallel:
- $DUNECONTROL --only=dorie configure
- $DUNECONTROL --only=dorie make test_run_parallel
test:reference:
test:st:reference:
<<: *test
script:
- $DUNECONTROL --only=dorie configure
- $DUNECONTROL --only=dorie make test_run_ref
test:mass_conserve:
test:st:mass_conserve:
<<: *test
script:
- $DUNECONTROL --only=dorie configure
- $DUNECONTROL --only=dorie make test_mass_conservation
test:unit-tests:
<<: *test
dependencies:
- build:unit-tests
script:
# install coverage reporter
- $DUNECONTROL --only=dorie bexec
"./run-in-dune-env python3 -m pip install gcovr"
- $DUNECONTROL --only=dorie configure
- $DUNECONTROL --only=dorie make unit_tests
# report coverage
- cd $CI_PROJECT_DIR/build-cmake
- mkdir -p test/coverage
- ./run-in-dune-env gcovr
--root ../
--html --html-details
-o test/coverage/coverage.html
# run again for coverage report in GitLab
- ./run-in-dune-env gcovr
--root ../
coverage: '/^TOTAL.*\s+(\d+\%)$/'
# --- Deploy jobs ---
deploy:dockerhub-devel: &deploy
......@@ -189,3 +219,26 @@ deploy:dockerhub-stable:
--build-arg DUNE_ENV_IMAGE=$DUNE_ENV_IMAGE --build-arg PROCNUM=$CPUS_DIND
-t dorie/dorie:$CI_COMMIT_TAG .
- docker push dorie/dorie:$CI_COMMIT_TAG
deploy:sphinx-docs:
stage: deploy
only:
- tags@dorie/dorie
dependencies:
- build:system-tests
before_script:
# install the netfly CLI
- apt-get install -y golang-go golang-glide
- go get -d github.com/netlify/netlifyctl
- cd $HOME/go/src/github.com/netlify/netlifyctl/
- make deps build
- go install
- cd $HOME/go/bin
script:
- ./netlifyctl deploy
-A $NETFLY_DEPLOY_TOKEN
-s $NETFLY_SITE_ID
-P $CI_PROJECT_DIR/build-cmake/doc/html
environment:
name: sphinx-docs
url: https://dorie-doc.netlify.com/
\ No newline at end of file
......@@ -4,22 +4,72 @@
## Unreleased
### Added
* Documentation of Docker images and their usage in the CI/CD pipeline.
* DORiE now depends on [`yaml-cpp`](https://github.com/jbeder/yaml-cpp/), a
library for reading YAML files. The version required is >=5.2.0.
* Added a abstract base class [`SimulationBase`](dune/dorie/interface/base_simulation.hh)
that models the concept of simulation steps so that they
can be later coupled with other simulations.
* New classes representing parameterizations. Every parameterization must now
derive from `RichardsParameterization`, and return function objects
representing parameterization functions.
* CMake module `DorieTesting.cmake`. The module contains multiple functions
which facilitate registering tests in the two new testing categories:
System tests and Unit tests. Unit tests are compiled with appropriate flags
for code coverage reports.
* 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.
### Changed
* Rebuilds of the DUNE environment Docker image are now triggered by setting the
CI variable `REBUILD_BASE_IMAGE` to a non-empty value. Previously, the
builds in stage `setup` where triggered by any manual pipeline run.
* `Simulation` is renamed `RichardsSimulation` and moved to
[richards_simulation.hh](dune/dorie/interface/richards_simulation.hh).
* `RichardsSimulation` now has its own `RichardsSimulationTraits` derived from
`BaseTraits`, which defines all its member types. `BaseTraits` now have
reduced content and are intended to be shared between models/simulations.
* Data structures for storing and accessing parameters. The new class
`FlowParameters` maps parameter sets and scaling factors to every grid cell
on the coarsest grid level, and only stores one set of parameters for
each soil layer. Before querying the parameterization functions, users need
to call `FlowParameters::bind` with a grid entity to cache the appropriate
data. All classes and functions querying parameter data have been updated.
The old parameterization classes located in
[`param_base.hh`](dune/dorie/solver/param_base.hh),
[`param_factory.hh`](dune/dorie/solver/param_factory.hh), and
[`param_van_genuchten.hh`](dune/dorie/solver/param_van_genuchten.hh)
are still used for reading in data for the new storage scheme.
The respective objects are freed once a simulation commences.
* `RichardsSimulation` now uses one vector of coefficients instead of two, which
now is a `shared_ptr` instead a `unique_ptr`.
* Every `VTKAdapter` is now able to be used as `GridFunctionAdapter` of the
solution vector.
* `GradientFluxAdapter` was reimplemented and renamed `WaterFluxAdapter`.
* Every grid function adapter has its own file and are gathered in the
subdirectory [dune/dorie/solver/adapters](dune/dorie/solver/adapters)
* `VTKAdapters` are now managed with `shared_ptr` instead of references.
* `OutputWriter` class is deprecated in favor of an minimal extension of the
usual `VTKSequenceWriter` for grid functions called
`GridFunctionVTKSequenceWriter`.
* Swich to the stable release branch `releases/2.6` of `dune-testtools`.
* The `build` CI stage now explicitly builds system tests and unit tests. The
job `build:main` has been removed. The `build:debug` jobs now build the
unit test targets.
### Deprecated
* The configuration file key `[parameters.interpolation]` is deprecated due to
the new scheme for storing parameterization data. DORiE now only supports
nearest-neighbor interpolation of parameters and scaling factors.
## 1.1.1 (2018-08-21)
### Added
* Documentation of Docker images and their usage in the CI/CD pipeline.
### Changed
* Rebuilds of the DUNE environment Docker image are now triggered by setting the
CI variable `REBUILD_BASE_IMAGE` to a non-empty value. Previously, the
builds in stage `setup` where triggered by any manual pipeline run.
* The test system folder was renamed from `testing` to [`test`](test).
### Fixed
......@@ -37,6 +87,8 @@
captured and can be viewed and downloaded from the GitLab web interface.
* Fix a bug in the boundary condition evaluation where an `end()` iterator
was dereferenced without error.
* Re-introduced deployment of the documentation which can now be found online
at https://dorie-doc.netlify.com/.
## 1.1.0 (2018-07-27)
......
......@@ -80,7 +80,7 @@ by CI tests.
### Optional Packages
| Software | Version/Branch | Comments |
| ---------| -------------- | -------- |
| [dune-testtools](https://gitlab.dune-project.org/quality/dune-testtools) | master | Handles system tests
| [dune-testtools](https://gitlab.dune-project.org/quality/dune-testtools) | releases/2.6 | Handles system tests
| [doxygen](http://www.stack.nl/~dimitri/doxygen/) | 1.8.13 | Builds documentation
| [METIS](http://glaros.dtc.umn.edu/gkhome/views/metis) | 5 | For parallel runs
| [ParMETIS](http://glaros.dtc.umn.edu/gkhome/views/metis) | 4 | For parallel runs
......@@ -167,7 +167,7 @@ The following software packages are cross-platform, so you should be able to fin
## Documentation
The documentation of the current `master` branch can be found [online](http://dorie-doc.bitballoon.com/).
The documentation of the latest release branch can be found [online](https://dorie-doc.netlify.com/).
The documentation can be built after DORiE has been properly configured (i.e., by calling `dunecontrol`). Note that you might have to re-configure DORiE once after installing it, because some dependencies are installed at configure time (e.g. by `dunecontrol --only=dorie configure`). To build the documentation, just run
......@@ -247,18 +247,24 @@ A debugger needs special security privileges usually not provided by the Docker
The debugger `gdb` is pre-installed in the Docker container.
### Running System Tests
DORiE includes system tests for comparing its results the ones of ODE solvers or
former versions of itself. They ensure that DORiE is running correctly and
producing the expected results. If you installed DORiE, you have to make sure
that all test executables are built by calling
dunecontrol --only=dorie make build_tests
You then execute the system tests with
ARGS="--output-on-failure" dunecontrol --only=dorie make test
You will be informed whether each test has been passed or failed, and you may find additional output in the DORiE build directory.
DORiE includes a testing system for comparing its results the ones of ODE solvers
or former versions of itself. This ensures that DORiE is running correctly and
producing the expected results. We distinguish _unit tests_ for testing certain
features of the code, and _system tests_ for verifying the results of the
final application. As system tests require executing the DUNE solvers,
it is recommended to build them in a `Release` environment.
| Test category | Build tests | Execute tests | Recommended build type |
| ----- | ----- | ----- |
| Unit tests | `make build_unit_tests` | `make_unit_tests` | `Debug` |
| System tests | `make build_system_tests` | `make_system_tests` | `Release` |
The `make` commands are to be executed from within the `build-cmake` directory.
The unit tests automatically include compiler flags for code coverage reports.
After building them with `Debug` flags and executing them, you can
retrieve code coverage information using the
[`gcovr`](https://gcovr.com/index.html) utility.
### Further Help
[Open an issue](https://ts-gitlab.iup.uni-heidelberg.de/dorie/dorie/issues/new), or write to the [DORiE developer mailing list](mailto:dorieteam@iup.uni-heidelberg.de).
# File for module specific CMake tests.
# find all required packages
FIND_PACKAGE (HDF5 REQUIRED)
if(NOT HDF5_IS_PARALLEL)
......@@ -24,3 +22,6 @@ list (APPEND DUNE_LIBS
${HDF5_LIBRARIES}
${YAML_CPP_LIBRARIES})
MESSAGE(STATUS "DUNE Libraries: ${DUNE_LIBS}")
# Add DORiE testing functions
include(DorieTesting)
# Add the unit test build target and test command
add_custom_target(build_unit_tests)
add_custom_target(unit_tests
COMMAND ctest --output-on-failure --tests-regex ^ut.+$
)
# Add the system test build target and test command
add_custom_target(build_system_tests)
add_custom_target(system_tests
COMMAND ctest --output-on-failure --exclude-regex ^ut.+$
)
#
# .. cmake_function:: add_coverage_links
#
# This function adds the appropriate compiler and linker flags for creating
# a coverage report from the resulting object files of the specified targets.
# Signature:
# `add_coverage_links(<target>...)`
#
function(add_coverage_links)
foreach(target ${ARGV})
target_compile_options(${target} PRIVATE --coverage)
target_link_libraries(${target} PRIVATE --coverage)
endforeach()
endfunction()
#
# .. cmake_function:: dorie_add_unit_test
#
# .. cmake_param:: NAME
# :single:
# :required:
#
# The name of the resulting test executable and target.
#
# .. cmake_param:: TARGET
# :single:
#
# The target this test applies to. This is only required if no SOURCES
# are specified.
#
# This function serves as wrapper around the function `dune_add_test` which
# registers test for existing targets or adds new test executables from the
# given source files. This function additionally registers the tests as unit
# tests within DORiE and adds flags for coverage reports. Notice that
# `dune_add_test` requires more parameters than this function alone.
#
# Use this function exactly like `dune_add_test`.
#
function(dorie_add_unit_test)
set(SINGLE NAME TARGET)
cmake_parse_arguments(UNIT_TEST "" "${SINGLE}" "" ${ARGN})
# use name prefix for test
if(NOT UNIT_TEST_NAME)
message(SEND_ERROR "No unit test name specified!")
string(PREPEND UNIT_TEST_NAME ut-)
# forward to dune function
dune_add_test(NAME ${UNIT_TEST_NAME}
${UNIT_TEST_UNPARSED_ARGUMENTS})
# get (build) target name if no target was given
if(NOT UNIT_TEST_TARGET)
set(UNIT_TEST_TARGET ${UNIT_TEST_NAME})
endif()
# add to build target and employ compile options
add_coverage_links(${UNIT_TEST_TARGET})
add_dependencies(build_unit_tests ${UNIT_TEST_TARGET})
endfunction()
#
# .. cmake_function:: dorie_add_metaini_test
#
# .. cmake_param:: UNIT_TEST
# :option:
#
# Registers the created tests as unit tests, including coverage flags.
# If not specified, the tests are registered as system tests.
#
# .. cmake_param:: TARGET
# :single:
#
# The existing target to apply these tests to. This is incompatible to
# the option `UNIT_TEST` and the parameter `BASENAME`, because the base
# name of the tests will automatically be set to the target name.
#
# .. cmake_param:: METAINI
# :single:
# :required:
#
# The meta-ini _input_ file for this test.
#
# .. cmake_param:: SCRIPT
# :single:
#
# The Python script to call for this test. The script has to be installed
# into the CMake `virtualenv`. Defaults to `dune_execute.py` for unit
# tests and `test_dorie.py` for system tests.
#
# .. cmake_param:: BASENAME
# :single:
#
# The basename for tests created from source files. This option is ignored
# (by `dune_add_system_test`) if `TARGET` is specified.
#
# .. cmake_param:: CREATED_TARGETS
# :single:
#
# The variable to hold the created CMake targets for post-processing.
#
# This function serves as wrapper around the function `dune_add_system_test`
# which registers test for existing targets or adds new test executables from
# the given source files by expanding meta ini files.
# This function can register the tests as unit or as system tests within
# DORiE. Notice that `dune_add_system_test` requires more parameters
# than this function alone.
#
# Use this function like `dune_add_system_test`, considering the options
# given above.
#
function(dorie_add_metaini_test)
set(OPTIONS UNIT_TEST)
set(SINGLE TARGET METAINI SCRIPT BASENAME CREATED_TARGETS)
cmake_parse_arguments(SYSTEM_TEST "${OPTIONS}" "${SINGLE}" "" ${ARGN})
if(NOT SYSTEM_TEST_METAINI)
message(SEND_ERROR "No meta ini file given!")
endif()
# configure meta ini file or just copy.
get_filename_component(metaini-name ${SYSTEM_TEST_METAINI} NAME_WE)
get_filename_component(metaini-extension ${SYSTEM_TEST_METAINI} EXT)
if(metaini-extension EQUAL ".mini.in")
configure_file(${SYSTEM_TEST_METAINI} ${metaini-name}.mini)
set(SYSTEM_TEST_METAINI "${metaini-name}.mini")
else()
configure_file(${SYSTEM_TEST_METAINI} ${SYSTEM_TEST_METAINI})
endif()
if(SYSTEM_TEST_TARGET AND SYSTEM_TEST_UNIT_TEST)
message(SEND_ERROR "Specifying TARGET is incompatible to option UNIT_TEST!")
endif()
# Set at least the prefix as basename
if(NOT SYSTEM_TEST_TARGET)
if(SYSTEM_TEST_UNIT_TEST)
string(PREPEND SYSTEM_TEST_BASENAME ut-)
else()
string(PREPEND SYSTEM_TEST_BASENAME st-)
endif()
endif()
# default script for system tests
if(NOT SYSTEM_TEST_SCRIPT)
if(NOT SYSTEM_TEST_UNIT_TEST)
set(SYSTEM_TEST_SCRIPT test_dorie.py)
endif()
endif()
# forward to DUNE function
dune_add_system_test(
${SYSTEM_TEST_UNPARSED_ARGUMENTS}
TARGET ${SYSTEM_TEST_TARGET}
BASENAME ${SYSTEM_TEST_BASENAME}
INIFILE ${CMAKE_CURRENT_BINARY_DIR}/${SYSTEM_TEST_METAINI}
SCRIPT ${SYSTEM_TEST_SCRIPT}
CREATED_TARGETS created_targets
)
# report created targets to parent scope
set(${SYSTEM_TEST_CREATED_TARGETS} ${created_targets} PARENT_SCOPE)
# add dependencies and flags
if(SYSTEM_TEST_UNIT_TEST)
add_coverage_links(${created_targets})
add_dependencies(build_unit_tests ${created_targets})
else()
add_dependencies(build_system_tests ${created_targets})
endif()
endfunction()
......@@ -271,10 +271,9 @@ adding an empty line, make text **bold** or ``monospaced``.
</parameter>
<parameter name="interpolation">
<definition> Sets the interpolation behavior when querying parameter field values
at a certain grid cell. Higher-order interpolation smoothes the parameter field,
but comes at a computational cost. </definition>
<values> nearest, linear, cubic </values>
<definition> DEPRECATED: Sets the interpolation behavior when querying parameter field values
at a certain grid cell. </definition>
<values> nearest </values>
<suggestion> nearest </suggestion>
</parameter>
</category>
......
......@@ -9,11 +9,12 @@ ARG CXX=g++
WORKDIR /opt/dune
ADD . /opt/dune/dorie/
RUN MAKE_FLAGS="-j ${PROCNUM}" \
CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=${CC} -DCMAKE_CXX_COMPILER=${CXX} -DDUNE_PYTHON_VIRTUALENV_SETUP=True -DDUNE_PYTHON_ALLOW_GET_PIP=True" \
./dune-common/bin/dunecontrol --only=dorie all \
RUN CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=${CC} -DCMAKE_CXX_COMPILER=${CXX} -DDUNE_PYTHON_VIRTUALENV_SETUP=True -DDUNE_PYTHON_ALLOW_GET_PIP=True" \
./dune-common/bin/dunecontrol --only=dorie configure \
&& MAKE_FLAGS="-j ${PROCNUM}" \
./dune-common/bin/dunecontrol --only=dorie make dorie-rfg dorie
&& ./dune-common/bin/dunecontrol --only=dorie exec \
"rm build-cmake/dune/dorie/impl/libdorie-impl.a build-cmake/dune/dorie/impl/CMakeFiles/dorie-impl.dir/*.cc.o"
"rm build-cmake/dune/dorie/impl/libdorie-impl.a build-cmake/dune/dorie/impl/CMakeFiles/dorie-impl.dir/*.cc.o"
ENV PATH="/opt/dune/dorie/build-cmake/bin:${PATH}"
WORKDIR /sim
ENTRYPOINT ["/opt/dune/dorie/build-cmake/bin/dorie"]
\ No newline at end of file
......@@ -46,7 +46,7 @@ RUN git clone https://gitlab.dune-project.org/staging/dune-uggrid.git -b release
&& git clone https://gitlab.dune-project.org/staging/dune-functions.git -b releases/2.6 \
&& git clone https://gitlab.dune-project.org/pdelab/dune-pdelab.git -b releases/2.6 \
&& git clone https://gitlab.dune-project.org/staging/dune-typetree.git -b releases/2.6 \
&& git clone https://gitlab.dune-project.org/quality/dune-testtools.git -b master
&& git clone https://gitlab.dune-project.org/quality/dune-testtools.git -b releases/2.6
WORKDIR /opt/dune
RUN MAKE_FLAGS="-j ${PROCNUM}" \
......
......@@ -37,7 +37,7 @@ public:
/// Do nothing.
/** \return Boolean if operators have to be updated
*/
virtual bool adapt_grid (Grid& grid, GV& gv, GFS& gfs, const Param& param, const Boundary& boundary, const RF time, U& uold, U& unew) { return false; }
virtual bool adapt_grid (Grid& grid, GV& gv, GFS& gfs, const Param& param, const Boundary& boundary, const RF time, U& u) { return false; }
};
/// Specialized SimulationBase class providing functions and members for adaptive grid refinement
......@@ -113,8 +113,7 @@ public:
* \param gv Leaf grid view of the grid
* \param gfs Solution GridFunctionSpace
* \param param Parameter handler
* \param uold Solution vector
* \param unew Solution vector
* \param u Solution vector
* \return Boolean if grid operators have to be set up again (true if grid changed)
*/
bool adapt_grid (
......@@ -124,8 +123,7 @@ public:
const Param& param,
const Boundary& boundary,
const RF time,
U& uold,
U& unew) override
U& u) override
{
Dune::Timer timer2;
float t2;
......@@ -158,7 +156,7 @@ public:
timer3.reset();
// Compute error estimate eta
estgo.residual(uold,eta);
estgo.residual(u,eta);
t_est = timer3.elapsed();
timer3.reset();
......@@ -209,7 +207,7 @@ public:
t_mark = timer3.elapsed();
timer3.reset();
Dune::PDELab::adapt_grid(grid, gfs, uold, unew, 2*order);
Dune::PDELab::adapt_grid(grid, gfs, u, 2*order);
t_adapt = timer3.elapsed();
timer3.reset();
......
......@@ -84,10 +84,11 @@ protected:
using KFUDGF = Dune::PDELab::DiscreteGridFunction<KFGFS,KFU>;
/// Adapter for translating water content back into matric head
using HeadDGF = Dune::Dorie::MatricHeadAdapter<Traits,KFUDGF,KFGV,Parameters>;
/// Discrete Grid Function of solution
using UDGF = Dune::PDELab::DiscreteGridFunction<typename Base::GFS,typename Base::U>;
/// Adapter for translating matric head solution vector into water content
using WaterDGF = Dune::Dorie::WaterContentAdapter<Traits,Parameters,UDGF>;
/// Matric head
using GFMatricHead = typename Base::GFMatricHead;
/// Water content
using GFWaterContent = typename Base::GFWaterContent;
KFGV kfgv; //!< GridView for KnoFuInterface
KFGFS kfgfs; //!< GFS for KnoFuInterface
......@@ -109,9 +110,9 @@ public:
void solution_to_water_content ()
{
UDGF udgf(*this->gfs,*this->unew);
WaterDGF waterdgf(this->gv,*this->param,udgf);
Dune::PDELab::interpolate(waterdgf,kfgfs,kfu);
GFMatricHead udgf(this->gfs,this->unew);
// GFWaterContent waterdgf(this->gv,*this->param,udgf);
// Dune::PDELab::interpolate(waterdgf,kfgfs,kfu);
}
void water_content_to_solution ()
......
#ifndef DUNE_DORIE_OUTPUT_WRITER_HH
#define DUNE_DORIE_OUTPUT_WRITER_HH
#include <string>
#include <memory>
#include <type_traits>
#include <dune/common/exceptions.hh>
#include <dune/common/parametertree.hh>
#include <dune/grid/io/file/vtk/vtksequencewriter.hh>
#include <dune/grid/io/file/vtk/subsamplingvtkwriter.hh>
#include <dune/pdelab/gridfunctionspace/gridfunctionspaceutilities.hh>
#include "../solver/util_vtk_adapters.hh"
namespace Dune{
namespace Dorie{
/// Dummy Output Writer class. Does nothing.
template<typename Traits>
class OutputWriterBase
{
private:
using RF = typename Traits::RF;
public:
OutputWriterBase () = default;
virtual ~OutputWriterBase () = default;
/// Do nothing
virtual void write_vtk_output (const RF time) {};
};
/// Default VTK Output Writer.
/** \tparam Traits BaseTraits struct
* \tparam GFS Solution GFS
* \tparam Param Parameter class
* \tparam U Solution Vector
*/
template<typename Traits, typename GFS, typename Param, typename U>
class OutputWriter : public OutputWriterBase<Traits>
{
private:
using RF = typename Traits::RF;
using GV = typename Traits::GV;
using VTKWriter = Dune::VTKSequenceWriter<GV>;