espresso
espresso copied to clipboard
Remove time_step global
~~and derived values~~. The time step should be parameter of the integration command.
The time_step
global is used in various places. Here is the list with proposed solutions:
- integrators
- passing the time step by argument is trivial
- the
Correlator
class constructor- add a callback mechanism for observables: changing the time step during accumulation should throw an error
- for example, we could store a shared pointer to the observables
- the
thermalized_bond_set_params
setter- set it to some undefined value: the
thermalized_bond_init()
callback iterates over all bonded interactions to update thermalized bonds with the current time step
- set it to some undefined value: the
- the DPD thermostat
- set it to some undefined value: the
dpd_init()
callback updates the DPD struct with the current time step
- set it to some undefined value: the
- LB GPU and EK GPU
- the time step needs to be copied to the GPU parameter structs
- will be removed in 4.3
- LB CPU and IBM
- it should be possible to pass the time step by argument through the callback chain, with enough patience
- will be removed in 4.3
- H5MD
As a first step in 4.2, we could gather the integrator global variables (sim time, time step, force cap, etc.) into a global struct IntegratorState
. The current integrator could be stored in a variant field of that struct, so as to avoid passing the time step by argument in too many places. This would also remove numerous switch statements.
This was achieved by #4820. Closing.