OPM/opm-core — pull request #331 by rolk (2013-08-22 11:21:58+00:00)
Title: Provide protocol for exchanging state with client

This pull request is a follow-up to #242, which introduced `connect_timestep`.

The state that is passed to the simulator object is directly accessible without any encapsulation towards the client. After the notification callback was introduced, this allows the client to observe the state in the middle of a simulation.

However, it may be that the simulator has some internal state which is not reflected in the state object because there is a cost associated by flushing it into the `TwophaseState` format.

The notification is called back on every timestep, not just the ones that will do reporting. It may even be that reporting is done dynamically and is not known at the time of setup. (It is more like a condition variable).

Consequently, flushing the state in every timestep is a bad idea. This patch sets up a new method `sync` which it is expected that the notification will call if it needs the state for reporting purposes.

Currently it is a no-op. It just establishes a protocol that other, compatible implementations can also use.