Commit c2c49692 authored by Santiago Ospina's avatar Santiago Ospina

Now Richards simulation fullfils requirements of output and adaptivity. (still...

Now Richards simulation fullfils requirements of output and adaptivity. (still missing mark grid method and ensuring that dt is not bigger than siggested dt)
Signed-off-by: default avatarSantiago Ospina <saospina@hugo.iwr.uni-heidelberg.de>
parent 30a82ba0
......@@ -5,6 +5,8 @@ namespace Dorie{
template<typename Traits>
RichardsSimulation<Traits>::RichardsSimulation (Dune::MPIHelper& _helper, std::shared_ptr<Grid> _grid, Dune::ParameterTree& _inifile) :
Dune::Dorie::SimulationBase(Traits::write_output ? OutputPolicy::EndOfStep : OutputPolicy::None,
Traits::adapt_grid ? AdaptivityPolicy::WaterFlux : AdaptivityPolicy::None),
helper(_helper), grid(_grid), inifile(_inifile), gv(grid->leafGridView()),
mbe_slop(estimate_mbe_entries<typename MBE::size_type>(Traits::dim,Traits::GridGeometryType)),
mbe_tlop(1),
......@@ -155,7 +157,7 @@ void RichardsSimulation<Traits>::step ()
step_succed = controller->validate(exception);
}
if (this->outputPolicy() == OutputPolicy::EndOfStep)
output->write_vtk_output(controller->getTime());
writeData();
}
template<typename Traits>
......@@ -169,9 +171,12 @@ void RichardsSimulation<Traits>::adaptGrid ()
{
double time = currentTime();
double eps = inifile.get<double>("time.minTimestep")/10.;
adaptivity->adapt_grid(*grid, gv, *gfs, *param, *fboundary,
if constexpr (Traits::adapt_grid)
adaptivity->adapt_grid(*grid, gv, *gfs, *param, *fboundary,
time-eps, // need "old" boundary condition TODO: check that this is right
*uold, *unew);
else
DUNE_THROW(NotImplemented,"Dorie does not implement adapticivity for this simulation object!");
}
template<typename Traits>
......@@ -180,5 +185,11 @@ void RichardsSimulation<Traits>::postAdaptGrid ()
operator_setup();
}
template<typename Traits>
void RichardsSimulation<Traits>::writeData ()
{
output->write_vtk_output(controller->getTime());
}
} // namespace Dorie
} // namespace Dune
\ No newline at end of file
......@@ -266,23 +266,30 @@ public:
*
* @return The time step.
*/
void step ();
void step () override;
/**
* @brief Writes the data.
*/
void virtual writeData() override;
/**
* @brief Mark the grid in order to improve the current model.
*/
virtual void markGrid();
virtual void markGrid() override;
/**
* @brief Adapt the grid together it every dependency of the
* grid (e.g. solution vector and grid function spaces).
*/
virtual void adaptGrid();
virtual void adaptGrid() override;
/**
* @brief Setup operators to fit the new grid.
*/
virtual void postAdaptGrid();
virtual void postAdaptGrid() override;
/**
* @brief Method that provides the begin time of the model.
......
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