/builddir/build/BUILD/opm-simulators-release-2017.10-update1/opm/simulators/SimulatorIncompTwophase.hpp

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
/*
Copyright 2012 SINTEF ICT, Applied Mathematics.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_SIMULATORINCOMPTWOPHASE_HEADER_INCLUDED
#define OPM_SIMULATORINCOMPTWOPHASE_HEADER_INCLUDED
#include <memory>
#include <vector>
#include <iostream>
struct UnstructuredGrid;
struct Wells;
struct FlowBoundaryConditions;
namespace Opm
{
class ParameterGroup;
class IncompPropertiesInterface;
class RockCompressibility;
class WellsManager;
class LinearSolverInterface;
class SimulatorTimer;
class TwophaseState;
class WellState;
struct SimulatorReport;
struct Event;
class SimulatorIncompTwophase
{
public:
SimulatorIncompTwophase(const ParameterGroup& param,
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 ();
void sync ();
private:
struct Impl;
// Using shared_ptr instead of unique_ptr since unique_ptr requires complete type for Impl.
std::shared_ptr<Impl> pimpl_;
};
} // namespace Opm
#endif // OPM_SIMULATORINCOMPTWOPHASE_HEADER_INCLUDED