Commit 655f1ae1 authored by Santiago Ospina's avatar Santiago Ospina

added exception to write_data, and added constrexpr to calls of write_data

Signed-off-by: default avatarSantiago Ospina <saospina@hugo.iwr.uni-heidelberg.de>
parent ed1c784f
......@@ -164,7 +164,8 @@ bool RichardsSimulation<Traits>::compute_time_step ()
template<typename Traits>
void RichardsSimulation<Traits>::run ()
{
write_data(controller->getTime());
if constexpr (Traits::write_output)
write_data(controller->getTime());
while(controller->doStep()) {
const auto time = controller->getTime();
......@@ -172,7 +173,8 @@ void RichardsSimulation<Traits>::run ()
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,
......@@ -220,6 +222,8 @@ void RichardsSimulation<Traits>::write_data (RF time)
DUNE_THROW(Dune::IOError,"Cannot write VTK output!");
}
vtkwriter->clear();
} else {
DUNE_THROW(Dune::IOError,"RichardsSimulation is not allowed to write output!")
}
}
......
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