How can I create multiple molecules with the create_atoms command?

I have these 2 commands in a lammps script:

molecule CH4mol molecules/H2.lmp molecules/CH4.lmp

create_atoms 0 random 1 $s mobileR mol CH4mol 55 overlap 0.3 maxtry 5000

Whenever create_atoms runs, only the hydrogen molecule seems to get created, but not the CH4 molecule. Is there a way to make this command work so that all molecules in the template get created?

This is documented behavior. Please see the “Restrictions” section of the documentation for the “create_atoms” command.

Thank you.

If I merge them all into one file, with both moleculees always have the same relative position, regardless of seed?

Why don’t you just try it out and see for yourself? :wink:

Please also note that when reporting issues like yours, you should always include information about which version of LAMMPS you are using and what platform you are running on.

It seems likely, that you are using an older version of LAMMPS, since both, the latest stable version of LAMMPS as well as the latest feature release version will print a warning message for inputs like yours. The corresponding change was added to LAMMPS over a year ago.