Create_atoms command for atom/molecule mixture

Dear all
I try to build a simulation box mixing 1 atome type and a mole cule
I write.
molecule Gly glycerol_753.txt
region mybox block 0 50 0 50 0 30
create_box 4 mybox
create_atoms 4 random 50 78913542 mybox overlap 3.0 maxtry 50
create_atoms offset mol Gly random 5 24897364 mybox overlap 3.0 maxtry 50

I read in the manual:

  • type = atom type (1-Ntypes) of atoms to create (offset for molecule creation)
    so I used offset as type

But I got the following error, meaning aan integer is required for type ?:

D:\MD\Pt-Glycerol> lmp -in Pt-Gly_GAS.in
LAMMPS (28 Mar 2023 - Development)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
Loaded 1 plugins from C:\Users\pascal.brault\AppData\Local\LAMMPS 64-bit 2023-04-10-MSMPI\plugins
Loaded 1 plugins from C:\Users\pascal.brault\AppData\Local\LAMMPS USER-REBOMOS Plugin 28Mar2023-MSMPI
Loaded 1 plugins from C:\Users\pascal.brault\AppData\Local\LAMMPS ML-PACE Plugin 28Mar2023-MSMPI
Loaded 1 plugins from C:\Users\pascal.brault\AppData\Local\LAMMPS USER-AEAM Plugin 28Mar2023-MSMPI
units real
dimension 3
boundary p p p
atom_style charge

log logPtGlynvt.lammps
molecule Gly glycerol_753.txt
Read molecule template Gly:
1 molecules
0 fragments
14 atoms with max type 3
0 bonds with max type 0
0 angles with max type 0
0 dihedrals with max type 0
0 impropers with max type 0
region mybox block 0 50 0 50 0 30
create_box 4 mybox
Created orthogonal box = (0 0 0) to (50 50 30)
1 by 1 by 1 MPI processor grid
create_atoms 4 random 50 78913542 mybox overlap 3.0 maxtry 50
Created 50 atoms
using lattice units in orthogonal box = (0 0 0) to (50 50 30)
create_atoms CPU = 0.001 seconds
create_atoms offset mol Gly random 5 24897364 mybox overlap 3.0 maxtry 50
ERROR: Expected integer parameter instead of ‘offset’ in input script or data file (src/create_atoms.cpp:92)
Last command: create_atoms offset mol Gly random 5 24897364 mybox overlap 3.0 maxtry 50
PS D:\MD\Pt-Glycerol>

I do not find what is wrong in my script ?
Thanks a lot in advance
Pascal

Hello,
‘offset’ must be an integer, its the number by which the atom ids in the molecule template must be shifted.
Best,
Simon

Thanks a lot
This is what I do not understand;
I have 4 atom
type 1 2 3 are for those of the molecules and stands for C H O real atoms.
And type 4 stands for Pt atom which is randomly placed in the box.
if offset is one, I understand that types 1 2 3 become 2 3 4 ? And do not understand the meaning of these renumbered types ?
Thanks a lot for your help.

If the indexes in the molecule file already correspond to the final expected indexes, then you can use an offset of 0. Would that work for you ?

Unfortunately no when replacing offset by 0 I got the error following message
create_atoms 0 mol Gly random 5 24897364 mybox overlap 3.0 maxtry 50
ERROR: Unknown create_atoms command option mol (src/create_atoms.cpp:137)
Last command: create_atoms 0 mol Gly random 5 24897364 mybox overlap 3.0 maxtry 50
PS D:\MD\Pt-Glycerol>

Indeed the command is still wrong, you have to pick a style first. ‘mol’ is a keyword, and it comes after the style.

Here you can just bring ‘random 5 24897364’ before ‘mol Gly’.

Yes. Thanks a lot I was just seeing the same when re-reading the manual.
Thanks again. And all is always in the manual :slight_smile:

Great it works when the ordering t is the good one.
Thanks again @simongravelle