Error in shake implementation for azide ion in water

Dear Lammps Users,

I want to do NVT simulation of azide ion (N-N-N)-1 in 107 water molecules

using lammps.I want to keep the azide molecule fixed at 180 degrees or at best

linear.I tried using fix shake for the azide and water molecule but I get the error

saying

ERROR: More than one fix shake (../fix_shake.cpp:307)

I tried using fix rigid/nvt/small but then it gives error   

ERROR: Invalid fix style (../modify.cpp:714)
Initial input file description is given below,any suggestion would be highly acknowledged.
dimension        3
units            real
boundary         p p p

kspace_style      ewald 1.0e-4 

kspace_modify    order 3
atom_style       full
pair_style       lj/cut/coul/long 9.0
bond_style       harmonic
angle_style      harmonic
pair_modify      mix arithmetic
 newton off
 read_data        azide.data 
#read_restart      restartfile
group azd        type 2 
group hyd        type 1
group oxy        type 3
group wtr        type 1 3
set atom 1 charge -0.9215
set atom 3 charge -0.9215

set group hyd  charge  0.41
set group oxy  charge -0.82
neighbor         3.0 bin
neigh_modify     delay 0 every 1 one 6000
minimize         1.0e-4 1.0e-6 100 1000
fix             1 wtr shake 0.0001 20 0 t 1 3  a 2 b 1 
fix             2 azd shake 0.0001 20 0 t 2    a 1 b 2 
#fix             2 azd  rigid/nvt/small group   temp 300.0 300.0 100.0
fix             3  all nvt temp  300.0 300.0 100.0 
#fix              2 all npt temp 300.0 300.0 100.0 iso 1.0 1.0 1000.0
# fix             2 all nve
# fix             3 all temp/rescale 5000 300.0 300.0 0.005 1.0
compute         ab all rdf 200 1 1 1 2 1 3  2 2 2 3 
compute         bc all msd  com yes
fix             4 all ave/time 100 1 100 c_ab file rdf.out mode vector 
fix             5 all ave/time 100 1 100 c_bc file msd.out mode vector     

timestep         1.00

thermo           10000
thermo_style     custom step pe ke etotal temp press vol 

restart          50000 z.restart

dump             2 all custom 1000 z1.output.dump id  type x y z
dump             3 all custom 1000 z2.output.dump id type fx fy fz

run              2500000

Dear Deepak,

If you send me your data file azide.dat (off-list), I can look into this.

Best regards,
Peter

The error regarding fix rigid probably means you did not install the rigid package. In your LAMMPS src-directory you can run

make yes-rigid

and then recompile to enable them.

And the SHAKE error follows what the doc page says:

For computational efficiency, there can only be one shake or rattle fix defined in a simulation.

Is there a reason you can’t define all the bonds, etc you want constrained

in one command?

Only allowing one fix shake commands prevents users from

trying to do something that won’t work, like having overlap

between the 2 sets of constrained bonds and thinking that would

get around the restriction that your SHAKE clusters cannot be

very large. Overlap meaning common atoms betwee two

fix shake commands.

Steve

Dear Sir,

Thanks for your informative answer,

What I intend to do is that simulate azide in water, I need to keep azide structure linear

and water in its V shaped form.In my lammps data file I have two bond angle kinds corresponding to N-N-N

and H-O-H angle.So I tried defining a group azd for three Nitrogen atoms and group wtr consisting of water molecules.

Finally I invoke fix shake for the two groups without mixing on description to lammps,

fix             1 wtr shake 0.0001 20 0 t 1 3  a 2 b 1 
fix             2 azd shake 0.0001 20 0 t 2    a 1 b 2 

as per as your suggestion I clubbed both the constraints in single fix-shake

 fix        1 all shake 0.0001 20 0 t 1 2 3  a 1 2 b 1 2 

however then the simulation crashes with the segmentation fault.Finally if I use just 

fix shake on water group
 fix             1 wtr shake 0.0001 20 0 t 1 3  a 2 b 1

it indeed ran smoothly.

Please let me know whatever is needed to be done.

Thanks again 


  

Dear Sir,

Thanks for your informative answer,
What I intend to do is that simulate azide in water, I need to keep azide
structure linear
and water in its V shaped form.In my lammps data file I have two bond angle
kinds corresponding to N-N-N
and H-O-H angle.So I tried defining a group azd for three Nitrogen atoms and
group wtr consisting of water molecules.

Finally I invoke fix shake for the two groups without mixing on description
to lammps,

the SHAKE constraint solver as implemented in LAMMPS cannot handle 180
degree angles.

so you'd *have* to use one of the fix rigid styles (or start
programming a suitable subroutine into fix shake that detects and
turns such 3 atomic linear constructs into a single bond constraint
between two virtual sites and then projects the results back to the
original atoms).

fix 1 wtr shake 0.0001 20 0 t 1 3 a 2 b 1
fix 2 azd shake 0.0001 20 0 t 2 a 1 b 2

as per as your suggestion I clubbed both the constraints in single fix-shake

fix 1 all shake 0.0001 20 0 t 1 2 3 a 1 2 b 1 2

however then the simulation crashes with the segmentation fault.Finally if I
use just

fix shake on water group
fix 1 wtr shake 0.0001 20 0 t 1 3 a 2 b 1

it indeed ran smoothly.

yes. water is fine. it is the azide anion that is trouble.

the best option is probably to make sure that all molecules have
unique molecule ids and then use one of the fix rigid/small styles to
do both the time integration and maintaining rigidity for both kinds
of molecules. same as for the shake fix, you want to keep the
communication overhead small and thus just use a single rigid fix.
(and one of the rigid/small styles, since those have optimized
communication for a system like yours with many small rigid objects).

axel.

You can’t use SHAKE to keep a triatomic molecule linear (this is a mathematical issue with the algorithm, not a problem with LAMMPS). There are a couple of possibilities:

  1. use a rigid integrator instead
  2. use SHAKE to keep the bonds fixed, and apply a potential to the angle to try to keep it linear (this will result in oscillations about linearity, but may be sufficient for your purposes)