Commit 8642d67a authored by Santiago Ospina's avatar Santiago Ospina
Browse files

[Richards] Use a variable to decide about flux reconstruction

parent 49b96222
......@@ -22,7 +22,8 @@ RichardsSimulation<Traits>::RichardsSimulation (
Traits::dim,Traits::GridGeometryType)),
mbe_tlop(1),
time_before(0.0),
dt_before(0.0)
dt_before(0.0),
enable_fluxrc_dy(_inifile.get<bool>("numerics.fluxReconstruction"))
{
// --- Grid Function Space ---
this->_log->trace("Setting up GridFunctionSpace");
......@@ -92,9 +93,9 @@ RichardsSimulation<Traits>::RichardsSimulation (
this->_log->info("Setup complete");
bool fluxrc = inifile.get<bool>("numerics.fluxReconstruction");
if (fluxrc and not enable_fluxrc)
this->_log->warn("Flux reconstruction is not available for this configuration. Option will be ignored.");
if (enable_fluxrc_dy and not enable_fluxrc_st)
this->_log->warn("Flux reconstruction is not available for this "
"configuration. Option will be ignored.");
}
template<typename Traits>
......@@ -134,8 +135,8 @@ void RichardsSimulation<Traits>::operator_setup()
gfs->update();
if constexpr (enable_fluxrc)
if (inifile.get<bool>("numerics.fluxReconstruction"))
if constexpr (enable_fluxrc_st)
if (enable_fluxrc_dy)
waterfrgf = std::make_shared<GFWaterFluxReconstruction>(*go0);
}
......@@ -252,8 +253,8 @@ void RichardsSimulation<Traits>::update_adapters () const
condgf = std::make_shared<GFConductivity>(gv, fparam);
waterdgf = std::make_shared<GFWaterContent>(udgf, gv, fparam);
satdgf = std::make_shared<GFSaturation>(udgf, gv, fparam);
if constexpr (enable_fluxrc)
if (inifile.get<bool>("numerics.fluxReconstruction"))
if constexpr (enable_fluxrc_st)
if (enable_fluxrc_dy)
waterfrgf->update(*u);
}
......@@ -270,18 +271,20 @@ void RichardsSimulation<Traits>::write_data () const
vtkwriter->template addVertexData<GFConductivity>(condgf,"K_0");
vtkwriter->template addVertexData<GFWaterContent>(waterdgf,"theta_w");
vtkwriter->template addVertexData<GFSaturation>(satdgf,"Theta");
if constexpr (enable_fluxrc)
if (inifile.get<bool>("numerics.fluxReconstruction"))
vtkwriter->template addVertexData<GFWaterFluxReconstruction>(waterfrgf,"flux RT" + std::to_string(flux_order));
if constexpr (enable_fluxrc_st)
if (enable_fluxrc_dy)
vtkwriter->template addVertexData<GFWaterFluxReconstruction>
(waterfrgf,"flux RT" + std::to_string(flux_order));
} else {
vtkwriter->template addCellData<GFMatricHead>(udgf,"head");
vtkwriter->template addCellData<GFWaterFlux>(fluxdgf,"flux");
vtkwriter->template addCellData<GFConductivity>(condgf,"K_0");
vtkwriter->template addCellData<GFWaterContent>(waterdgf,"theta_w");
vtkwriter->template addCellData<GFSaturation>(satdgf,"Theta");
if constexpr (enable_fluxrc)
if (inifile.get<bool>("numerics.fluxReconstruction"))
vtkwriter->template addCellData<GFWaterFluxReconstruction>(waterfrgf,"flux RT" + std::to_string(flux_order));
if constexpr (enable_fluxrc_st)
if (enable_fluxrc_dy)
vtkwriter->template addCellData<GFWaterFluxReconstruction>
(waterfrgf,"flux RT" + std::to_string(flux_order));
}
try{
......
......@@ -157,7 +157,7 @@ private:
static constexpr int dim = Traits::dim;
static constexpr int order = Traits::order;
static constexpr int flux_order = Traits::flux_order;
static constexpr bool enable_fluxrc = Traits::enable_fluxrc;
static constexpr bool enable_fluxrc_st = Traits::enable_fluxrc;
using RF = typename Traits::RF;
using Grid = typename Traits::Grid;
using GV = typename Traits::GV;
......@@ -275,7 +275,7 @@ protected:
std::shared_ptr<U> u;
mutable std::shared_ptr<GFMatricHead> udgf;
mutable std::shared_ptr<GFWaterFlux> fluxdgf;
mutable std::shared_ptr<GFWaterFlux> fluxdgf;
mutable std::shared_ptr<GFConductivity> condgf;
mutable std::shared_ptr<GFWaterContent> waterdgf;
mutable std::shared_ptr<GFSaturation> satdgf;
......@@ -286,6 +286,8 @@ protected:
RF time_before;
RF dt_before;
const bool enable_fluxrc_dy;
public:
/*------------------------------------------------------------------------*//**
......
Supports Markdown
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