[lammps-users] Periodic boundary with SMD

Dear lammps users,

When I use SMD with cvel mode, I got a problem. In my case, the driving spring is tethered to a rigid body and moving in z direction, and the position of the tether point in z is the initial mass center of the rigid body in z. It could work for a while, but once the mass center was driven to cross the boundary in z direction, there is a jump of the position in z for the mass center because of the applied periodic boundary condition. So I got the spring force having an abrupt dramatic change and the system blows up.

Can anyone tell me how to handle the smd with periodic boundary condition?

Any suggestion would be most appreciated.

Best
Yajie

Dear lammps users,

dear yajie,

thank you so much for the report.

When I use SMD with cvel mode, I got a problem. In my case, the
driving spring is tethered to a rigid body and moving in z direction,
and the position of the tether point in z is the initial mass center
of the rigid body in z. It could work for a while, but once the mass
center was driven to cross the boundary in z direction, there is a
jump of the position in z for the mass center because of the applied
periodic boundary condition. So I got the spring force having an
abrupt dramatic change and the system blows up.

Can anyone tell me how to handle the smd with periodic boundary
condition?

this is an "undocumented feature" in the code. it is not designed to
work across periodic boundaries the way you are using it. right now
you would have to translate your initial coordinates so that the
spring will never cross periodic boundaries.
adding support for periodic boundaries would require changing the
code and careful checking, so that it does not break existing inputs.

i'll look into it ASAP and will let you know when i have a corrected
version.

cheers,
   axel.

Dear Axel,

Thank you very much for your reply. I think I have to look for other ways or adjust my initial coordinates as you suggested.

Looking forward to your corrected version.

Best
Yajie

I am filling in for Steve and Paul this week, so I am going to try and reply to every message, just so they know I was not derelict in my duties. However, since Axel wrote the SMD package, he better qualifie than anyone to reply. I will just express a couple of opinions.

-There is probably no fundamental difficulty with providing PBC-support for SMD
-As Axel rightly said, doing it properly will require a substantial amount of thought and testing on his part, which may not be warranted.
-LAMMPS makes it is easy for the user to move the location of the periodic boundaries in LAMMPS. Just modify xlo/xhi in the data file.
-I am guessing that a well-posed SMD simulation will never move the tether point more than 1 periodic cell length, so it might be better just to update the documentation accordingly, and possibly put some checks in the code.
-If the location of the group center of mass is not known precisely to the user, it would be convenient but not strictly necessary to allow the group to cross periodic boundaries.

aidan

I am filling in for Steve and Paul this week, so I am going to try and
reply to every message, just so they know I was not derelict in my
duties. However, since Axel wrote the SMD package, he better qualifie
than anyone to reply. I will just express a couple of opinions.

-There is probably no fundamental difficulty with providing
PBC-support for SMD
-As Axel rightly said, doing it properly will require a substantial
amount of thought and testing on his part, which may not be warranted.

the following should correct the problem for the case
of using "couple" mode. please give it a try and let
me know if it works or not.

for "tether" mode, it will require more programming as
the code currently includes some optimizations that
cannot be used with "couple". and i'm not sure i want
to do this. since tether point is not moving, it would
be better to move the system accordingly in the first place.

cvs diff: Diffing USER-SMD
Index: USER-SMD/fix_smd.cpp
--- USER-SMD/fix_smd.cpp 2 Aug 2008 16:44:19 -0000 1.1.1.2
+++ USER-SMD/fix_smd.cpp 14 Jun 2009 22:35:20 -0000
@@ -277,6 +277,9 @@
     
     dx -= xn*r_old;
     dy -= yn*r_old;
     dz -= zn*r_old;
+ // the reference point cannot be further away
+ // than half a box length from the target.
+ domain->minimum_image(dx,dy,dz);

     if (!xflag) dx = 0.0;
     if (!yflag) dy = 0.0;

-LAMMPS makes it is easy for the user to move the location of the
periodic boundaries in LAMMPS. Just modify xlo/xhi in the data file.
-I am guessing that a well-posed SMD simulation will never move the
tether point more than 1 periodic cell length, so it might be better
just to update the documentation accordingly, and possibly put some
checks in the code.

i agree completely. i'll look into updating/revising the documentation
along those lines. for "couple" the situation is a bit different,
because both atoms/groups may diffuse around, so the code from above
makes sense to include. i'll have a look into adding a check for
"tether" as soon as i get some more time.

cheers,
   axel.

Hi Axel and Yajie,

I took a look at fix_smd.cpp, and it seems that the existing code should handle periodic boundaries just fine (except with rigid bodies). That is because the function Group::xcm() actually unwraps that atom coordinates for you. For this reason, applying minimum image to the unwrapped coordinates is unnecessary, and in some cases may not produce the intended result.

The real problem lies with the rigid body fix, which modifies the periodic image flags of the atoms. There is probably no easy code-solution to this one. User-solutions are:

-Avoid having the rigid body cross a periodic boundary
-Do not use rigid body for the group

Aidan