Commit 6ca7b0c7 authored by Santiago Ospina's avatar Santiago Ospina
Browse files

[Flux Reconstruction] Update flux in construction of model

parent 00efa8a0
......@@ -64,9 +64,21 @@ RichardsSimulation<Traits>::RichardsSimulation (
u = std::make_shared<U>(*gfs,.0);
Dune::PDELab::interpolate(*finitial,*gfs,*u);
// --- Operator Setup --- //
// --- Operator Setup ---
operator_setup();
// --- Update Flux Reconstruction ---
if constexpr (enable_fluxrc_st)
if (enable_fluxrc_dy)
try {
flux_rec_gf->update(*u);
} catch (Dune::Exception &e) {
this->_log->debug(" Flux Reconstruction failed");
this->_log->error(" Unexpected error in flux reconstruction: {}",
e.what());
DUNE_THROW(Dune::Exception, "Critical error in flux reconstruction");
}
// --- Utility Class Setup --- //
if (output_policy() != OutputPolicy::None)
{
......@@ -209,7 +221,7 @@ void RichardsSimulation<Traits>::step()
DUNE_THROW(Dune::Exception, "Critical error in Newton solver");
}
// Update flux reconstruction to the new solution
// --- Update Flux Reconstruction ---
if constexpr (enable_fluxrc_st)
if (enable_fluxrc_dy)
try {
......@@ -283,7 +295,7 @@ void RichardsSimulation<Traits>::write_data () const
if constexpr (enable_fluxrc_st)
if (enable_fluxrc_dy)
vtkwriter->template addVertexData<GFWaterFluxReconstruction>
(flux_rec_gf,"flux RT" + std::to_string(flux_order));
(flux_rec_gf,"flux_RT" + std::to_string(flux_order));
} else {
vtkwriter->template addCellData<GFMatricHead>(matric_head_gf,"head");
vtkwriter->template addCellData<GFWaterFlux>(flux_gf,"flux");
......@@ -293,7 +305,7 @@ void RichardsSimulation<Traits>::write_data () const
if constexpr (enable_fluxrc_st)
if (enable_fluxrc_dy)
vtkwriter->template addCellData<GFWaterFluxReconstruction>
(flux_rec_gf,"flux RT" + std::to_string(flux_order));
(flux_rec_gf,"flux_RT" + std::to_string(flux_order));
}
try{
......
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