Invalid bond type in Bonds section of molecule file

Dear lammps users,

I am trying to import a molecule template in lammps (lammps-12dec2018) using molecule command.

Atom_style is set on “molecular”, bond, angle and dihedral style on “harmonic”.

My molecule file follow this format (described in ) :

Title line # skipped line

200 atoms
199 bonds
296 angles
196 dihedrals
0 impropers

Coords # atom_style is molecular

1 0.0 0.0 0.0
2 0.0 0.3 0.0
3 0.3 0.0 0.0

[skipped]

Types

1 1
2 2
3 1

[skipped diameters and masses section]

Bonds

1 1 1 2
2 1 3 4
3 1 5 6

[skipped]

Angles

1 1 1 3 5
2 1 3 5 7
3 1 5 7 9

[skipped]

Dihedrals

1 1 1 3 5 7
2 1 3 5 7 9
3 1 5 7 9 11

[skipped till EOF]

Lammps gives me this error message when I run my input script : Invalid bond type in Bonds section of molecule file (…/molecule.cpp:781)

When I remove Bonds section, I got an error message with Angles section and when Bonds, Angles and Dihedrals sections are removed, I got a message about the Types section, similar from the one cited above. Did I forget something before calling molecule command ? Regions and box are defined before I try to import my molecule. Same for units, boundary conditions and dimensions.

Thank you

signature.png

Molecule templates do not define bond types (or angle types, etc.). Each type must first be defined via a read_data or bond_coeff command, before it is referenced by a molecule command

signature.png

The number of available atom, bond and other types is locked in when the simulation box is created (either explicitly or implicitly). The corresponding commands have extra/xxx/types options to reserve additional entries.

When using a molecule file you have to make certain that you are not exceeding any limits. Please use the info command for displaying current settings.

Axel

signature.png

1 Like

Thank you for your reply.

I used info system command, that gives me :

[skipped]

Info-Info-Info-Info-Info-Info-Info-Info-Info-Info-Info
Printed on Wed Feb 20 09:21:06 2019

System information:
Units = nano
Atom style = molecular
Atom map = (null)
Molecule type = standard
Atoms = 0, types = 1, style = none
Bonds = 0, types = 0, style = harmonic
Angles = 0, types = 0, style = harmonic
Dihedrals = 0, types = 0, style = multi/harmonic
Impropers = 0, types = 0, style = none
Special bond factors lj = 0 0 0
Special bond factors coul = 0 0 0
Kspace style = none

Dimensions = 3
Orthogonal box = 81.3 x 105.6 x 198
Boundaries = p,p p,p f,f
xlo, xhi = 0, 81.3
ylo, yhi = 0, 105.6
zlo, zhi = 0, 198

Info-Info-Info-Info-Info-Info-Info-Info-Info-Info-Info

[skipped]

My molecule coordinates fit in the box.

Only one atom type does exist (I don’t understand which command created it … I used only units, boundary atom_style, bond_style, angle_style, dihedral_style, dimension, newton, variable, region, create_box commands before info command). Indeed there is no bond, angle and dihedral types. So I sought for create_bonds () or similar command but this one is creating bonds between two groups of atoms, which does not exist yet in my case.

So how can I create all missing atom, bond, angle and dihedral types before importing my molecule ?

Thank you

Charlotte

signature.png

Ok, sorry for the last message I sent it a bit too fast. I used bond/types, angle/types and dihedral/types keywords after create_box command, it seems to work now. I’ve understand that the create_box command also create a number of atom types that will be used in simulation box, I’ve change it.

Thank you

Charlotte

signature.png