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,6 +57,8 @@ RichardsSimulation<Traits>::RichardsSimulation (Dune::MPIHelper& _helper, std::s
operator_setup();
// --- Utility Class Setup --- //
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,
......@@ -66,6 +68,7 @@ RichardsSimulation<Traits>::RichardsSimulation (Dune::MPIHelper& _helper, std::s
inifile.get<std::string>("output.fileName"),
inifile.get<std::string>("output.outputPath"),
"./");
}
AdaptivityHandlerFactory adaptivity_fac(inifile,*grid);
adaptivity = adaptivity_fac.create();
......@@ -163,6 +166,8 @@ void RichardsSimulation<Traits>::run ()
{
const auto time = controller->getTime();
const RF dt = controller->getDT();
if constexpr (Traits::write_output)
write_data(time);
while(controller->doStep()) {
......@@ -170,6 +175,7 @@ void RichardsSimulation<Traits>::run ()
continue;
}
if constexpr (Traits::write_output)
write_data(controller->getTime());
if(controller->doStep()
......
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