diff --git a/dune/dorie/interface/richards_simulation.cc b/dune/dorie/interface/richards_simulation.cc index e1eac26a6095e037d8b5f677f0f9d73098f4bcea..0131da320a89243b0a301671621c4a0fa5dfb9b9 100644 --- a/dune/dorie/interface/richards_simulation.cc +++ b/dune/dorie/interface/richards_simulation.cc @@ -57,15 +57,18 @@ RichardsSimulation::RichardsSimulation (Dune::MPIHelper& _helper, std::s operator_setup(); // --- Utility Class Setup --- // - const int subsamling_lvl = _inifile.get("output.subsamplingLevel", 0); - const auto subsamling_intervals = Dune::refinementLevels(subsamling_lvl); - auto sub_vtk = std::make_shared>(gv, - subsamling_intervals); - - vtkwriter = std::make_unique(sub_vtk, - inifile.get("output.fileName"), - inifile.get("output.outputPath"), - "./"); + if constexpr (Traits::write_output) + { + const int subsamling_lvl = _inifile.get("output.subsamplingLevel", 0); + const auto subsamling_intervals = Dune::refinementLevels(subsamling_lvl); + auto sub_vtk = std::make_shared>(gv, + subsamling_intervals); + + vtkwriter = std::make_unique(sub_vtk, + inifile.get("output.fileName"), + inifile.get("output.outputPath"), + "./"); + } AdaptivityHandlerFactory adaptivity_fac(inifile,*grid); adaptivity = adaptivity_fac.create(); @@ -163,14 +166,17 @@ void RichardsSimulation::run () { const auto time = controller->getTime(); const RF dt = controller->getDT(); - write_data(time); + + if constexpr (Traits::write_output) + write_data(time); while(controller->doStep()) { if(!compute_time_step()){ continue; } - write_data(controller->getTime()); + if constexpr (Traits::write_output) + write_data(controller->getTime()); if(controller->doStep() && adaptivity->adapt_grid(*grid, gv, *gfs, *param, *fboundary,