[lammps-users] question about fix spring

I am trying to create a spring similar to that made by the fix spring command, but I want the ro value of the spring to change over the course of the simulation, slowly bringing the two atoms together, is this possible?

I am trying to create a spring similar to that made by the fix spring command, but I want the ro value of the spring to change over the course of the simulation, slowly bringing the two atoms together, is this possible?

yes. can run a loop and reset r0 and then run for a few steps
or you can use fix smd for that purpose.

note that there is one significant difference when using fix smd.
the use of R0 is different and it almost always needs to be set to 0,
i.e. you need to use something like this (with the proper selection of
values for K and the pulling speed according to the units that you use).

fix pull atom1 smd cvel 20.0 0.0001 couple atom2 auto auto auto 0.0

cheers,
    axel.

p.s.: fix smd is a user package and needs to be explicitly compiled in...

If you edit the source code of fix spring or make your own new fix,
you can do whatever you want.

Steve

Is there a simple way to output the distance between the particles as well
as the current R0 value using fix smd? Also, with the restriction that the
final R0 input is 0 do I need to just run for less steps at a specific
velocity to achieve the desired final distance? Thanks

Is there a simple way to output the distance between the particles as well
as the current R0 value using fix smd? Also, with the restriction that the

yes, you can get that information. quoting from the documentation of fix smd:

"This fix computes a vector list of 7 quantities, which can be
accessed by various output commands. The quantities in the vector are
in this order: the x-, y-, and z-component of the pulling force, the
total force in direction of the pull, the equilibrium distance of the
spring, the distance between the two reference points, and finally the
accumulated PMF (the sum of pulling forces times displacement). "

so the fifth or sixth number would be what you are looking for and
you can output them the usual way.

actually the fix will keep on moving (having it stop at a given target
distance is an enhancement in an upcoming new version of the fix)
for as long as you tell it to. but if you try to drag two atoms "through"
each other, your simulation may crash due to too high forces.

final R0 input is 0 do I need to just run for less steps at a specific
velocity to achieve the desired final distance? Thanks

yes. that is the recommended procedure. with SMD you can pull
or push in many different ways, so that i chose to first implement
it in the most generic way and am now trying to consolidate it into
what is needed most often and what is most useful when people
are using it, and make that easier to use.

cheers,
    axel.