Implementing active dumbbells in a solvent

Dear developers,
I am contemplating the ways to simulate a solvent with active dumbbells, mimicking a conformational varying enzymes. The active dumbbell is a simple pair of point masses held together by a spring. So, in my simulation, it is just a molecule with two atoms and a harmonic bond. I am trying to switch between two states of the dumbbells (open and closed) with two different natural lengths and stiffness (lo,lc; ko,kc) randomly during the run. For the switching between states, I have to calculate the pairwise distance of atoms in the dumbbells, if the distance justifies the condition then I switch to closed state from the open state. This I have to monitor for all the dumbbells in the simulation.
The tasks I have to perform are as such

  1. I need calculation of dr for pairs dynamically, for all dumbbells
  2. check the condition for all pairs, and if yes then set bond type to closed/open from open/closed

I request for suggestions how to achieve this. I know I can use variables which return per-atom vectors, and then I can check for the conditions.

The most straightforward approach would be writing a custom bond style.

@akohlmey I am considering the suggestion and will try writing the custom bond style. But do we have any documentation which will help me writing the bond_style? Do my bond_style have access to all the required information about the simulation time, particle’s coordinates, types, etc.?

I was thinking of achieving this as such:

  1. I calculated bond length using compute bond/local
  2. I equated the computed to vector style variable, V.
    But then I am not able to access the ith element of the V
  3. I thought of checking the condition for each element of V, and then simply set bond_style for the V[j] to the other bond_style.
    But I am confused whether the check (if condition) will be performed for each time step, as the compute will be executed for each time step.
    The idea is to calculate bond/local dist for each time step, and then do condition check at each time step, and then perform the setting as per the condition for each time step.

You can read the source code for other bond styles.

There is this: 3. Modifying & extending LAMMPS — LAMMPS documentation
and this: 4.8. Writing new styles — LAMMPS documentation

While the latter does not discuss a bond style, a lot of information is transferable in combination with the information about bond styles in the former.

This makes no sense. All such script commands would serialize the processing and thus slow down the simulation massively.

But is it possible?
I calculated bond/local and created a variable v vector c_ID. But then how to access the elements of the v? Or how I access the bond lengths?

I don’t have the habit of figuring out whether bad ideas can be implemented.

1 Like

Thanks, but I have found the way to do it eventually.

Did you really? Why this post then?

This activity was for a modelling of an enzyme in a colloidal dispersion. And It was composed of oscillating dumbbells. The other post is for a different kind of activity, which I am trying to add in a polymer.