Commit 6b59520d authored by Lukas Riedel's avatar Lukas Riedel

Merge branch '11-add-subsampling-vtk-writer' into 'master'

Resolve "add subsampling VTK writer"

Closes #11

See merge request !68
parents a6b89056 a5bf7375
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
## Unreleased ## Unreleased
### Added ### Added
* DORiE now employs a `SubsamplingVTKWriter` for higher output precision.
Subsampling levels are controlled via the new key `output.subsamplingLevel`.
* Automatic deployment of `devel` and stable DORiE Docker Images to Docker Hub * Automatic deployment of `devel` and stable DORiE Docker Images to Docker Hub
* Automatic update of the DUNE environment Docker Image for `master` builds * Automatic update of the DUNE environment Docker Image for `master` builds
* CI pipeline now also compiles a Debug build with the LLVM Clang compiler * CI pipeline now also compiles a Debug build with the LLVM Clang compiler
...@@ -23,6 +25,11 @@ ...@@ -23,6 +25,11 @@
* Decentralization of the header system so that in most of the header files are * Decentralization of the header system so that in most of the header files are
independent of each other independent of each other
### Deprecated
* `output.subsamplingLevel` is optional and defaults to 0 if not given
explicitly in the config file. The key will become mandatory in future
versions.
### Fixed ### Fixed
* The source code is now compatible to the Clang LLVM compiler. * The source code is now compatible to the Clang LLVM compiler.
DORiE can now be compiled with the onboard compiler on macOS. DORiE can now be compiled with the onboard compiler on macOS.
......
...@@ -61,6 +61,18 @@ adding an empty line, make text **bold** or ``monospaced``. ...@@ -61,6 +61,18 @@ adding an empty line, make text **bold** or ``monospaced``.
<suggestion> false </suggestion> <suggestion> false </suggestion>
</parameter> </parameter>
<parameter name="subsamplingLevel">
<definition> Plot VTK files with virtually refined grids. VTK only
supports bilinear triangulations and displays higher-order solutions
inappropriately. Use level 0 for order 1, and level N+1 for order N.
For level &gt; 0, the printed grid does not resemble the actual grid.
This parameter defaults to 0 if not given in the config file. Notice
that subsampling significantly increases the output file size!
</definition>
<values> int </values>
<suggestion> 0 </suggestion>
</parameter>
<parameter name="asciiVtk"> <parameter name="asciiVtk">
<definition> Defines whether VTK files should be written as ASCII (``true``) <definition> Defines whether VTK files should be written as ASCII (``true``)
or binary (``false``). ASCII is easier to parse in case you want to write or binary (``false``). ASCII is easier to parse in case you want to write
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <dune/common/parametertree.hh> #include <dune/common/parametertree.hh>
#include <dune/grid/io/file/vtk/vtksequencewriter.hh> #include <dune/grid/io/file/vtk/vtksequencewriter.hh>
#include <dune/grid/io/file/vtk/subsamplingvtkwriter.hh>
#include <dune/pdelab/gridfunctionspace/gridfunctionspaceutilities.hh> #include <dune/pdelab/gridfunctionspace/gridfunctionspaceutilities.hh>
...@@ -46,6 +47,7 @@ private: ...@@ -46,6 +47,7 @@ private:
using GV = typename Traits::GV; using GV = typename Traits::GV;
using VTKWriter = Dune::VTKSequenceWriter<GV>; using VTKWriter = Dune::VTKSequenceWriter<GV>;
using SubVTK = Dune::SubsamplingVTKWriter<GV>;
using UDGF = Dune::PDELab::DiscreteGridFunction<GFS,U>; using UDGF = Dune::PDELab::DiscreteGridFunction<GFS,U>;
using FluxDGF = Dune::Dorie::GradientFluxAdapter<GFS,U,Param>; using FluxDGF = Dune::Dorie::GradientFluxAdapter<GFS,U,Param>;
using ConDGF = Dune::Dorie::ConductivityAdapter<Traits,Param>; using ConDGF = Dune::Dorie::ConductivityAdapter<Traits,Param>;
...@@ -72,11 +74,12 @@ public: ...@@ -72,11 +74,12 @@ public:
*/ */
OutputWriter (Dune::ParameterTree& _inifile, GV& gv, GFS& gfs, Param& param, U& unew) OutputWriter (Dune::ParameterTree& _inifile, GV& gv, GFS& gfs, Param& param, U& unew)
: OutputWriterBase<Traits>(), : OutputWriterBase<Traits>(),
vtkwriter(gv, vtkwriter(std::make_shared<SubVTK>(gv,
Dune::refinementLevels(_inifile.get<int>(
"output.subsamplingLevel", 0))),
_inifile.get<std::string>("output.fileName"), _inifile.get<std::string>("output.fileName"),
_inifile.get<std::string>("output.outputPath"), _inifile.get<std::string>("output.outputPath"),
"./", "./"),
Dune::VTK::nonconforming),
udgf(gfs,unew), udgf(gfs,unew),
fluxdgf(gfs,unew,param,udgf), fluxdgf(gfs,unew,param,udgf),
condgf(gv,param), condgf(gv,param),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment