InteractionFeature

class narupatools.imd.feature.InteractionFeature(dynamics: TDynamics)

Interactive Molecular Dynamics manager.

Inheritance

Inheritance diagram of InteractionFeature

Methods

__init__

Create a new interaction manager.

add_dynamic_interactions_source

Add a source for interactions which are polled before each dynamics step.

add_interaction

Add an interaction to the system.

close

Remove this ASEImdProvider from the dynamics it was applied to.

remove_dynamic_interactions_source

Remove a source for interactions which are polled before each dynamics step.

remove_interaction

Remove an interaction with the given key.

update_interaction

Update an interaction with the given key.

__init__(dynamics: TDynamics)

Create a new interaction manager.

Parameters

dynamics – SimulationDynamics object which notifies the ASEImdProvider when dynamics steps occur.

add_dynamic_interactions_source(source: narupatools.imd.interaction_source.InteractionsSource)None

Add a source for interactions which are polled before each dynamics step.

Parameters

source – Source of IMD interactions.

add_interaction(interaction: narupa.imd.particle_interaction.ParticleInteraction, *, key: Optional[str] = None)str

Add an interaction to the system.

Parameters
  • interaction – Interaction to add.

  • key – Key to store interaction as. If not provided, automatically generated.

Returns

Key that the interaction was assigned to.

close()None

Remove this ASEImdProvider from the dynamics it was applied to.

remove_dynamic_interactions_source(source: narupatools.imd.interaction_source.InteractionsSource)None

Remove a source for interactions which are polled before each dynamics step.

Parameters

source – Source of IMD interactions.

remove_interaction(key: str)TInteraction

Remove an interaction with the given key.

Parameters

key – Key of the interaction to remove.

Raises

KeyError – Interaction with the given key does not exist.

Returns

Interaction which was removed.

update_interaction(key: str, interaction: narupa.imd.particle_interaction.ParticleInteraction)None

Update an interaction with the given key.

Parameters
  • key – Key of the interaction to update.

  • interaction – ParticleInteraction containing data for the interaction.

Raises

KeyError – Interaction with the given key does not exist.

Attributes

current_interactions

Key-index set of interaction constraints currently applied to the system.

dynamics

Dynamics these IMD interactions are applied to.

imd_forces

Total interactive forces from all active interactions.

on_end_interaction

Event triggered when an interaction is removed from the system.

on_start_interaction

Event triggered when an interaction is first applied to the system.

potential_energy

Total potential energy from all active interactions.

total_work

Total work performed by all active interactions, in kilojoules per mole.

work_last_step

Total work performed last step by all active interactions.

current_interactions

Key-index set of interaction constraints currently applied to the system.

dynamics

Dynamics these IMD interactions are applied to.

imd_forces

Total interactive forces from all active interactions.

This returns a (N, 3) NumPy array, where N is the number of atoms in the system. The forces are in kilojoules per mole per nanometer.

on_end_interaction

Event triggered when an interaction is removed from the system.

on_start_interaction

Event triggered when an interaction is first applied to the system.

potential_energy

Total potential energy from all active interactions.

The returned work is in kilojoules per mole.

total_work

Total work performed by all active interactions, in kilojoules per mole.

This does not include interactions which have now finished.

work_last_step

Total work performed last step by all active interactions.

The returned work is in kilojoules per mole.