[lammps-users] fix shake problem

Hi,

I'm trying to use fix shake to fix the bond length in two tri-mers (see attached data and input files) and got the following error:

LAMMPS (11 Aug 2010)
Scanning data file ...
   1 = max bonds/atom
Reading data file ...
   orthogonal box = (-10 -10 -10) to (10 10 10)
   1 by 1 by 1 processor grid
   6 atoms
   4 bonds
Finding 1-2 1-3 1-4 neighbors ...
   2 = max # of 1-2 neighbors
   1 = max # of 1-3 neighbors
   1 = max # of 1-4 neighbors
   2 = max # of special neighbors
Finding 1-2 1-3 1-4 neighbors ...
   2 = max # of 1-2 neighbors
   1 = max # of 1-3 neighbors
   1 = max # of 1-4 neighbors
   2 = max # of special neighbors
Finding SHAKE clusters ...
*** Process received signal ***
Signal: Bus error (10)
Signal code: (2)
Failing at address: 0x4
[ 1] [0xbfffeae8, 0x00000004] (-P-)
[ 2] (_ZN9LAMMPS_NS8FixShakeC2EPNS_6LAMMPSEiPPc + 0x4d0) [0xbfffeb68, 0x000e9dd0]
[ 3] (_ZN9LAMMPS_NS6Modify7add_fixEiPPc + 0x17ce) [0xbfffebf8, 0x001283ee]
[ 4] (_ZN9LAMMPS_NS5Input15execute_commandEv + 0xda9) [0xbfffed48, 0x0010fc29]
[ 5] (_ZN9LAMMPS_NS5Input4fileEv + 0x333) [0xbffff5f8, 0x00111e83]
[ 6] (main + 0x60) [0xbffff628, 0x00118020]
[ 7] (start + 0x36) [0xbffff648, 0x00002736]
[ 8] [0x00000000, 0x00000001] (FP-)

Using backtracing in GDB, I got

...
Finding SHAKE clusters ...

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000004
0x000e7d1f in LAMMPS_NS::FixShake::find_clusters ()
(gdb) bt
#0 0x000e7d1f in LAMMPS_NS::FixShake::find_clusters ()
#1 0x000e9dd0 in LAMMPS_NS::FixShake::FixShake ()
#2 0x001283ee in LAMMPS_NS::Modify::add_fix ()
#3 0x0010fc29 in LAMMPS_NS::Input::execute_command ()
#4 0x00111e83 in LAMMPS_NS::Input::file ()
#5 0x00118020 in main ()

Am I missing something in the data file and input script? Or is there any singularity in the FixShake::find_clusters() function that my test system triggers?

(FYI, this error does not appear for dimers.)

Any suggestions/corrections are appreciated. If anyone has a simple working example of fix shake for tri-mers, could you kindly share it with me?

Thanks,

-Trung

in.shake (607 Bytes)

data.shake (298 Bytes)

find_clusters checks for an angle type when the number of SHAKE neighbors is exactly two. Since you don’t have any angle types, this is probably causing the code to crash.

Does it work if you create an angle type with a zero force constant?

–AEI

this is a bug - it shouldn't check angles if no angles
are defined. I'll post a patch later today.

Trung - I presume what you want to do is have to SHAKE
bonds in the trimer with a flexible angle? This should be
fine.

Steve

Thanks Ahmed and Steve.

Ahmed, I added angles and angle types into the data file, and it runs fine even without the declaration of angle_type and angle_coeff in the input script. Of course, the atom_style should be changed to other styles, like 'molecular', in this case.

Steve, yes, that's what I want.

Cheers,
-Trung

Quoting Steve Plimpton <[email protected]>: