Event that is signaled every time the simulator has completed a a timestep.Register a callback with this event to do processing at the end of every timestep, for instance to do reporting.
- Note
- If you want to know the current timestep, the callback must also monitor the timer object which was passed to run().
struct Foo {
void bar () { cout << "Called!" << endl; }
};
SimulatorIncompTwophase sim (...);
Foo f;
sim.timestep_completed ().add <Foo, &Foo::bar> (f);
sim.run (...);
- Note
- Registered callbacks should call the sync() method before accessing the state that was passed into the run() method.
- See also
- Opm::SimulatorIncompTwophase::sync
#ifndef OPM_SIMULATORINCOMPTWOPHASE_HEADER_INCLUDED
#define OPM_SIMULATORINCOMPTWOPHASE_HEADER_INCLUDED
#include <memory>
#include <vector>
#include <iostream>
struct UnstructuredGrid;
struct Wells;
struct FlowBoundaryConditions;
{
class ParameterGroup;
class IncompPropertiesInterface;
class RockCompressibility;
class WellsManager;
class LinearSolverInterface;
class SimulatorTimer;
class TwophaseState;
class WellState;
struct SimulatorReport;
struct Event;
class SimulatorIncompTwophase
{
public:
const UnstructuredGrid& grid,
const IncompPropertiesInterface& props,
const RockCompressibility* rock_comp_props,
WellsManager& wells_manager,
const std::vector<double>& src,
const FlowBoundaryConditions* bcs,
LinearSolverInterface& linsolver,
const double* gravity);
SimulatorReport
run(SimulatorTimer& timer,
TwophaseState& state,
WellState& well_state);
Event& timestep_completed ();
private:
struct Impl;
std::shared_ptr<Impl> pimpl_;
};
}
#endif // OPM_SIMULATORINCOMPTWOPHASE_HEADER_INCLUDED