ERROR: Coulomb cutoffs of pair hybrid sub-styles do not match

Dear users,

  I am using the pair style table to fit some potentials. I got some success using this command, but now I have tried to use the keyword RSQ (squared distances) for a better fitting.
  My issue happens when I asked to write the pair for debugging the fitted values. When I write:

pair_write 1 1 100000 r 0.4001 10.0 table.txt OO

  It works perfectly and I can plot the fitted and the original table for comparison. But when I type:

pair_write 1 1 100000 rsq 0.4001 10.0 table.txt OO

I got the following error:

ERROR: Coulomb cutoffs of pair hybrid sub-styles do not match (../pair_hybrid.cpp:935)
Last command: pair_write 1 1 100000 rsq 0.40012 10.0 table.txt OO

Which are the appropriate inner and outer cutoffs for rsq? I tryed the squared values and I got the same error.

  With best regards,

  Pedro

  Dear users,

  I am using the pair style table to fit some potentials. I got some
success using this command, but now I have tried to use the keyword
RSQ (squared distances) for a better fitting.
  My issue happens when I asked to write the pair for debugging the
fitted values. When I write:

pair_write 1 1 100000 r 0.4001 10.0 table.txt OO

  It works perfectly and I can plot the fitted and the original table
for comparison. But when I type:

pair_write 1 1 100000 rsq 0.4001 10.0 table.txt OO

I got the following error:

ERROR: Coulomb cutoffs of pair hybrid sub-styles do not match
(../pair_hybrid.cpp:935)
Last command: pair_write 1 1 100000 rsq 0.40012 10.0 table.txt OO

Which are the appropriate inner and outer cutoffs for rsq? I tryed the
squared values and I got the same error.

there must be some inconsistency in your input. i've looked at the
relevant code, and i don't see an obvious problem.

can you produce a set of (minimal) input decks sufficient to reproduce
it (just the pair_style and pair_coeff and pair_write commands with an
empty box)?

thanks,
     axel

Axel,

  in an empty box (no atoms), the potential (pair_coeff) will be applied to nothing. Then, LAMMPS will complain.

ERROR: Numeric index is out of bounds (../pair_hybrid_overlay.cpp:40)
Last command: pair_coeff * * coul/long

Can I do a minimum structure? Or, I misunderstood you. Then, please, give further explanation about what an empty box would be.

  Pedro

Citando Axel Kohlmeyer <[email protected]>:

  Axel,

  in an empty box (no atoms), the potential (pair_coeff) will be
applied to nothing. Then, LAMMPS will complain.

that is not correct. there are no checks at all for atoms being
present. the only thing that doesn't work with an empty system is the
automatic kspace parameter detection, so you just use kspace_modify
with a reasonable value from the real system. it doesn't matter for
testing/debugging the flow of control that is causing the error abort
you were mentioning.

example:

units real
atom_style charge
region box block -10 10 -10 10 -10 10
create_box 4 box

pair_style hybrid/overlay lj/cut 10.0 coul/long 10.0
pair_coeff * * lj/cut 0.0 4.0
pair_coeff 1 1 lj/cut 0.01 4.0
pair_coeff 4 4 lj/cut 0.02 4.0
pair_coeff * * coul/long

kspace_style ewald 1.0e-6
kspace_modify gewald 0.001

pair_write 4 4 100000 rsq 0.40012 10.0 table.txt OO 1.0 1.0

Axel, thanks for your answer.

  In attachment, there are the minimum files. I realized when I run with a potential table using R as the keyword, the mentioned error does not occur. Instead, the issue happens with a table using RSQ.

Citando Axel Kohlmeyer <[email protected]>:

table.rsq (87.5 KB)

table.r (85.5 KB)

input.test (509 Bytes)

  Axel, thanks for your answer.

  In attachment, there are the minimum files. I realized when I run
with a potential table using R as the keyword, the mentioned error
does not occur. Instead, the issue happens with a table using RSQ.

yes, because a) you don't specify an explicit cutoff with your
pair_coeff statements for pair style table, and b) your table has an
upper R of 100 (which becomes the default cutoff) and not 10. so the
complaint from pair style hybrid is valid and the error message
correct.

axel.