Pair_style hybrid reaxff lj/class2/coul/cut

Dear all,

I wanted to simulate a nano indentation in a polymer while using ReaxFF for the polymer and an LJ potential for the indenter. But I am having issues getting it to run. So I thought I’d test the setup on one of the reaxff example files, but the error keeps appearing (double free or corruption).

Main part of the script:

read_data       data.CHO extra/atom/types 1

mass            4 12.0
create_atoms    4 single 0 0 5 group newatom

pair_style      hybrid reaxff lmp_control lj/class2/coul/cut 10
pair_coeff      * * reaxff ffield.reax.cho H C O NULL
pair_coeff      1*4 4 lj/class2/coul/cut 0.01 4.0
pair_modify     pair lj/class2/coul/cut mix sixthpower

However, if I do not create an atom of the LJ species, the script runs fine, despite being hybrid. Not sure if this is a problem with my script or sth else.

Any help or ideas are appreciated.

All files attached (ReaxFF CHO example, LAMMPS (30 Mar 2026 - Development - patch_30Mar2026-1540-g3bfc12b027))

test_reaxff_hybrid.zip (14.3 KB)

Regards

Wolfgang

This is a combustion force field and definitely not a good choice for modeling a polymer.

Is there a justification for using ReaxFF?

Please try to apply this change and let us know if that makes your input run instead of crash.

  diff --git a/src/REAXFF/reaxff_lookup.cpp b/src/REAXFF/reaxff_lookup.cpp
  index d9ee471caf..01e200cf1b 100644
  --- a/src/REAXFF/reaxff_lookup.cpp
  +++ b/src/REAXFF/reaxff_lookup.cpp
  @@ -185,8 +185,10 @@ namespace ReaxFF {
   
       for (i = 0; i < num_atom_types; ++i)
         existing_types[i] = 0;
  -    for (i = 0; i < system->n; ++i)
  -      existing_types[system->my_atoms[i].type] = 1;
  +    for (i = 0; i < system->n; ++i) {
  +      if (system->my_atoms[i].type >= 0)
  +        existing_types[system->my_atoms[i].type] = 1;
  +    }
   
       MPI_Allreduce(existing_types, aggregated, num_atom_types, MPI_INT, MPI_SUM, world);
   

no, there is no justification. And this is not the reaxff I intended to use. I simply wanted to reduce my problem and test it with one of the examples.

and yes, that resolved it. Thanks a lot.

That is just the “mechanical issue”. The bigger question is how can you set up charge equilibration consistently in such a hybrid system. I would rather suggest to try an all-ReaxFF setup and use fix indent or fix wall/region with a mobile region.

Thanks for the hint. Unfortunately, the people I simulate for want to see some attractive part on the indenter side. So I guess it should be pure reaxff or sth hybrid with LJ.

The indenter should be pure Si (not part of the reaxff), but the parameters for qeq are available. So, technically, I could run qeq on all atoms while maintaining hybrid /LJ . I’ll have to give it some thought, whether this is a good idea or not, and discuss it with colleagues.

Thanks for the advice, though.

Fix wall/region supports multiple Lennard-Jones variants and Morse: fix wall/region command — LAMMPS documentation

1 Like