rerun with fix reax/c/species command

Dear LAMMPS users

I want to get species information(computed by the ReaxFF potential) from lammpstrj file.

So, I used rerun command with fix reax/c/species command but I could only get 0 byte species. out file.

There is no error with fix reax/c/species command and rerun command works well with other fix ave/atom or ave/time commands.

Also, this fix reax/c/species command works well with ‘run’ command.

LAMMPS package that I use is the stable version and recent version(16 Feb 2016).

Commands that I used are as below;

fix species all reax/c/species 1 1 1000 species.out
rerun data.lammpstrj dump x y z vx vy vz format native

How can I solve the problem?

kind regards,
Woo Cheol Jeon

Try with a nfreq of 1 because fix reax/c/species only outputs every nfreq steps.

E.g. fix species all reax/c/species 1 1 1 species.out

Ray

Dear Ray,

Thank you for your kind response.

I tried with fix command with a nfreq of 1 but it still doesn’t work.

Maybe this is because atomic information was recored on the lammpstrj file per 1000 steps of simulation.

Lammpstrj file includes atomic information like atomic positions(x,y,z) and velocities(vx,vy,vz).

Is it enough for fix reax/c/species?

Dear Ray,

I still have problem using rerun and fix species command together.

Could you answer my question which I sent you on March 11th, please?

kind regards,
Woo Cheol Jeon

Dear Ray,

I still have problem using rerun and fix species command together.

Could you answer my question which I sent you on March 11th, please?

​it is near impossible to provide help with descriptions like "it doesn't​
work" outside of "then you aren't doing it right".

please provide detailed descriptions and/or input files to quickly
reproduce the issue, and people will be able to have a look.

axel.

Dear Axel,

Thank you for your careful look.

I’m sorry but I didn’t attatch my inputfile in previous mail because I described the details in the first mail.

The problem is that species output from ReaxFF simulation doesn’t come out with rerun command.

My inputfile is as follows.

#================================ Simulation Setting ================================

units real
boundary p p p #s means shrink-wrapped
atom_style charge

read_restart restart2.reaxff

pair_style reax/c NULL checkqeq yes safezone 1.5 mincap 100
pair_coeff * * NM.ff C H N O
fix fqeq all qeq/reax 1 0.0 10.0 1e-6 reax/c

compute reax all pair reax/c
variable eb equal c_reax[1] # bond energy
variable ea equal c_reax[2] # atom energy
variable elp equal c_reax[3] # lone-pair energy
variable emol equal c_reax[4] # molecule energy (always 0.0)
variable ev equal c_reax[5] # valence angle energy
variable epen equal c_reax[6] # double-bond valence angle penalty
variable ecoa equal c_reax[7] # valence angle conjugation energy
variable ehb equal c_reax[8] # hydrogen bond energy
variable et equal c_reax[9] # torsion energy
variable eco equal c_reax[10] # conjugation energy
variable ew equal c_reax[11] # van der Waals energy
variable ep equal c_reax[12] # Coulomb energy
variable efi equal c_reax[13] # electric field energy (always 0.0)
variable eqeq equal c_reax[14] # charge equilibration energy

fix species all reax/c/species 1 1 1000 out.species3 element C H N O

fix fnveB31 all nve

thermo 1000
thermo_style custom step cpuremain temp epair etotal enthalpy press &
v_eb v_ea v_elp v_emol v_ev v_epen v_ecoa &
v_ehb v_et v_eco v_ew v_ep v_efi v_eqeq

rerun data.d1064_2500K.lammpstrj dump x y z q vx vy vz format native

unfix fnveB31
unfix species
unfix fqeq

print “all done”

input_reaxff_rerun (1.92 KB)

Can you attach the full input deck, i.e., with all the necessary restart and data file?

Ray

ray,

you can use the attached two inputs on the RDX example.
i could reproduce the issue and there is also a memory leak…

axel.

in.reaxc.rerun (1.27 KB)

in.reaxc.run (1.28 KB)

Thanks, Axel, for the input files.

Woo, I was able to find the cause of fix reax/c/species not printing output during a rerun, but I have not figured out a general solution to the problem. This is because rerun is pseudo-dynamics and does not integrate equations of motion but merely calculates energy/force based on information from the dump file. Fix reax/c/species is a fix that is called after time-integration, so their clock is always offset by “nfreq”. I believe the same problem would occur for similar fixes such as fix ave/time, etc.

Fix reax/c/species determines whether it should perform species analysis based on a variable “nvalid”. A quick fix for your problem would be to change one line of code in fix_reaxc_species.cpp:

289c289

< nvalid = update->ntimestep+nfreq;

Thanks, Axel, for the input files.

Woo, I was able to find the cause of fix reax/c/species not printing
output during a rerun, but I have not figured out a general solution to the
problem. This is because rerun is pseudo-dynamics and does not integrate
equations of motion but merely calculates energy/force based on information
from the dump file. Fix reax/c/species is a fix that is called after
time-integration, so their clock is always offset by "nfreq". I believe
the same problem would occur for similar fixes such as fix ave/time, etc.

​please see the attached patch for a solution to this issue. it also makes
it compatible with the origin nfreq setting, so no changing to 1 is
required (or will work).
this patch also plugs a couple of memory leaks that i found in the process
of implementing the solution.

axel.

lammps-reaxc-rerun-leaks-fixes.diff.gz (731 Bytes)

Dear Ray and Axel,

I’m sorry for late response but I had been sick so I can’t use computer a few days.

I changed the code of fix_reaxc_species.cpp and applied the patch to fix_reaxc_species.cpp and fix_qeq_reax.cpp. Then, I could get the wanted output file.

Thank you very much for your thoughtful advices.

Best regards,
Woo Cheol Jeon