narupa.imd.imd_state module¶
Module providing methods for storing ParticleInteractions in a StateDictionary.
-
class
narupa.imd.imd_state.
ImdStateWrapper
(state_dictionary: narupa.state.state_dictionary.StateDictionary, velocity_reset_available=False)¶ Bases:
object
A wrapper around a StateDictionary that provides convenient methods for accessing and modifying ParticleInteractions.
Parameters: - state_dictionary – The state dictionary to wrap.
- velocity_reset_available – Whether the dynamics this service is being used in allows velocity reset.
-
active_interactions
¶ The current dictionary of active interactions, keyed by interaction id.
Returns: A copy of the dictionary of active interactions.
-
insert_interaction
(interaction_id: str, interaction: narupa.imd.particle_interaction.ParticleInteraction)¶
-
remove_interaction
(interaction_id: str)¶
-
velocity_reset_available
¶
-
narupa.imd.imd_state.
dict_to_interaction
(dictionary: Dict[str, Any]) → narupa.imd.particle_interaction.ParticleInteraction¶
-
narupa.imd.imd_state.
interaction_to_dict
(interaction: narupa.imd.particle_interaction.ParticleInteraction) → Dict[str, Union[None, str, int, float, bool, Iterable[Union[None, str, int, float, bool, Iterable[Any], Mapping[str, Any]]], Mapping[str, Union[None, str, int, float, bool, Iterable[Any], Mapping[str, Any]]]]]¶