Commit 0a0e833f authored by Santiago Ospina's avatar Santiago Ospina

Added compile time decision about writing the output

Signed-off-by: default avatarSantiago Ospina <saospina@hugo.iwr.uni-heidelberg.de>
parent 3a37f211
......@@ -57,15 +57,18 @@ RichardsSimulation<Traits>::RichardsSimulation (Dune::MPIHelper& _helper, std::s
operator_setup();
// --- Utility Class Setup --- //
const int subsamling_lvl = _inifile.get<int>("output.subsamplingLevel", 0);
const auto subsamling_intervals = Dune::refinementLevels(subsamling_lvl);
auto sub_vtk = std::make_shared<Dune::SubsamplingVTKWriter<GV>>(gv,
subsamling_intervals);
vtkwriter = std::make_unique<Writer>(sub_vtk,
inifile.get<std::string>("output.fileName"),
inifile.get<std::string>("output.outputPath"),
"./");
if constexpr (Traits::write_output)
{
const int subsamling_lvl = _inifile.get<int>("output.subsamplingLevel", 0);
const auto subsamling_intervals = Dune::refinementLevels(subsamling_lvl);
auto sub_vtk = std::make_shared<Dune::SubsamplingVTKWriter<GV>>(gv,
subsamling_intervals);
vtkwriter = std::make_unique<Writer>(sub_vtk,
inifile.get<std::string>("output.fileName"),
inifile.get<std::string>("output.outputPath"),
"./");
}
AdaptivityHandlerFactory adaptivity_fac(inifile,*grid);
adaptivity = adaptivity_fac.create();
......@@ -163,14 +166,17 @@ void RichardsSimulation<Traits>::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,
......
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