fix rigid/small & reax/c - segmentation fault

Lammps Users,

I am trying to figure out a way to keep certain chemical bonds fixed during heating for reax/c simulations. I have tried using fix restrain, but the addition of the fix bond energy on top of the reax/c bond energy caused my simulation box to expand into infinity. Thus, I am now trying to investigate other options.

Any idea if fix rigid/small and reax/c are compatible? I have tried using the combination for a single ethanol molecule to see if it works. What I get as a result is a segmentation fault. I should also mention that if I comment out the line with fix rigid/small, it works perfectly, so I assume the problem is coming from that line somehow. Any advice is appreciated.

Input script:
units real

atom_style charge
read_data data.1ethanol

pair_style reax/c lmp_control safezone 3.2 mincap 200
pair_coeff * * ffield.reax.chosi C H O Si H O C H O H O Si

neighbor 2 bin
neigh_modify every 10 delay 0 check yes

group fixedatoms id 1 2
fix 2 all qeq/reax 1 0.0 10.0 1e-6 reax/c
fix 1 fixedatoms rigid/small molecule langevin 298.0 298.0 100.0 12345

thermo_style multi
thermo 50
timestep 0.25
dump 1 all atom 50 dump.1ethanol
run 2000

Output:
[jddeetz@…4435… Single-EtOH]$ lmp_openmpi<in.single
LAMMPS (30 Aug 2013)
Reading data file …
orthogonal box = (-1 -1 -1) to (13 13 13)
1 by 1 by 1 MPI processor grid
9 atoms
Warning: changed valency_val to valency_boc for X
2 atoms in group fixedatoms
[leapfrog:28240] *** Process received signal ***
[leapfrog:28240] Signal: Segmentation fault (11)
[leapfrog:28240] Signal code: Address not mapped (1)
[leapfrog:28240] Failing at address: (nil)
[leapfrog:28240] [ 0] /lib64/libpthread.so.0 [0x3bf620eca0]
[leapfrog:28240] [ 1] lmp_openmpi(_ZN9LAMMPS_NS13FixRigidSmallC1EPNS_6LAMMPSEiPPc+0x2f5) [0x6502a5]
[leapfrog:28240] [ 2] lmp_openmpi(_ZN9LAMMPS_NS6Modify11fix_creatorINS_13FixRigidSmallEEEPNS_3FixEPNS_6LAMMPSEiPPc+0x44) [0x6e7784]
[leapfrog:28240] [ 3] lmp_openmpi(ZN9LAMMPS_NS6Modify7add_fixEiPPcS1+0xb7b) [0x6ef37b]
[leapfrog:28240] [ 4] lmp_openmpi(_ZN9LAMMPS_NS5Input15execute_commandEv+0x16e0) [0x6b7420]
[leapfrog:28240] [ 5] lmp_openmpi(_ZN9LAMMPS_NS5Input4fileEv+0x1cb) [0x6b42cb]
[leapfrog:28240] [ 6] lmp_openmpi(main+0x94) [0x6cccc4]
[leapfrog:28240] [ 7] /lib64/libc.so.6(__libc_start_main+0xf4) [0x3bf561d9c4]
[leapfrog:28240] [ 8] lmp_openmpi(_ZNSt8ios_base4InitD1Ev+0x41) [0x490929]
[leapfrog:28240] *** End of error message ***
Segmentation fault

Thank you,
Josh Deetz
PhD Candidate Student
Chemical Engineering
University of California, Davis

Hi Joshua,

the seg fault comes from the fact that fix rigid/small requires an atom style with molecule ID’s (such as full or molecular) while you’re using atom style charge in your script. Can you switch to atom style full, modify the data file accordingly, and give it another try?

Best,

-Trung

Steve: I suppose the check for molecule_flag (currently at lines 153-154)

if (atom->molecule_flag == 0)
error->all(FLERR,“Fix rigid/small requires atom attribute molecule”);

be performed before the array atom->molecule is accessed at line 109, in the constructor of FixRigidSmall.

Lammps Users,
I am trying to figure out a way to keep certain chemical bonds fixed during
heating for reax/c simulations. I have tried using fix restrain, but the
addition of the fix bond energy on top of the reax/c bond energy caused my
simulation box to expand into infinity. Thus, I am now trying to investigate
other options.

i find it hard to believe that fix restrain is the cause of that and
that using fix rigid would be the cure. are you sure there is no
deeper fundamental issue with your setup?

axel.

I agree with both these responses. fix restrain and fix rigid/small,
like most fixes, do not interact with the interaction potential.
Therefore you should be able to use either one, or possibly even just
exclude the two atoms of interest from the NVE dynamics. I think the
best choice is fix restrain, which you tried first. If fix restrain
is causing the simulation to blow-up, just reduce the spring force
until that doesn't happen.

1 Like

good catch - I’ll make the change - it will be in the next patch

Steve

Thank you Axel, Trung, and Aidan for your suggestions. They have been most helpful.

Best,
Josh