[Transport] Use same local operator for flux reconstruction

parent 08225554
......@@ -475,15 +475,24 @@ public:
assert(water_content_gf);
assert(water_flux_gf);
assert(sboundary);
auto diff_coeff = inifile.get<double>("parameters.molecularDiffusion");
// create local operator
auto _slop = std::make_unique<SLOP>(*sboundary,water_flux_gf,
water_content_gf,diff_coeff);
_slop->setTime(state.time);
// set time in local operator
try {
slop->setTime(state.time);
} catch (Dune::InvalidStateException& e) {
this->_log->error("Flux reconstruction cannot be generated:\n"
"Local operator is in invalid state at time {}\n"
"Detail: {}", state.time,e.what());
DUNE_THROW(Dune::InvalidStateException,
"Local operator not able to set time at " << state.time);
}
// update flux reconstruction (use current local operator)
gf_ptr->update( *(state.coefficients),
*(state.grid_function_space),
*_slop);
*slop);
// reset time in local operator
slop->setTime(current_time());
} else {
// update flux reconstruction
gf_ptr->update( *(state.coefficients),
......
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