espresso icon indicating copy to clipboard operation
espresso copied to clipboard

Remove time_step global

Open fweik opened this issue 4 years ago • 1 comments

~~and derived values~~. The time step should be parameter of the integration command.

fweik avatar Jun 23 '20 08:06 fweik

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
  • the DPD thermostat
    • set it to some undefined value: the dpd_init() callback updates the DPD struct with the current time step
  • 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.

jngrad avatar Feb 02 '21 10:02 jngrad

This was achieved by #4820. Closing.

jngrad avatar Jan 10 '24 16:01 jngrad