ERROR: Unexpected end of molecule file

Hi all!

I am trying to eventually simulate nitrogen molecules impinging on a substrate using reax potential. For now, I am trying to make the data file for nitrogen molecule and I wrote a simple input script just to read it. However, I keep getting errors.

  1. Does it matter if the mass is specified in the input file or in the molecule data file?

  2. If I read the substrate co-ordinates using the read_data command, the mass is specified there with atom-ID ‘1’. If I later use the molecule command, since it atom is nitrogen, do I specify the atom id as ‘2’ in the molecule file?

3)Since I am using reax potential, do I need to specify bonds in the molecule file?

  1. In the lammps documentation for molecule data file, this is given

Bonds section:

  • one line per bond
  • line syntax: ID type atom1 atom2
  • type = bond type (1-Nbondtype)
  • atom1,atom2 = IDs of atoms in bond
    here, does type mean 1 for single bond, 2 for double bond and 3 for triple bond?

I am attaching my data and in* file. I get the error ‘Unexpected end of molecule file’ right now. I hope someone would please let me know what I am missing.

Thanks!

Hi all!

I am trying to eventually simulate nitrogen molecules impinging on a
substrate using reax potential. For now, I am trying to make the data file
for nitrogen molecule and I wrote a simple input script just to read it.
However, I keep getting errors.

1) Does it matter if the mass is specified in the input file or in the
molecule data file?

the Masses section is only needed for atom styles with per-atom
masses. for atom_style charge, the mass is defined over the atom type
and thus there should not be a Masses section. in any case, to be
syntactically correct, you'd have to have one entry per atom, and not
one entry per type.

2) If I read the substrate co-ordinates using the read_data command, the
mass is specified there with atom-ID '1'. If I later use the molecule
command, since it atom is nitrogen, do I specify the atom id as '2' in the
molecule file?

no.

3)Since I am using reax potential, do I need to specify bonds in the
molecule file?

no. you must not.

4) In the lammps documentation for molecule data file, this is given

Bonds section:

one line per bond
line syntax: ID type atom1 atom2
type = bond type (1-Nbondtype)
atom1,atom2 = IDs of atoms in bond

here, does type mean 1 for single bond, 2 for double bond and 3 for triple
bond?

no. bond type is the bond type-id that identifies the given bond_coeff
line in the input, which in turn is dependent on the bond style. reax
has not bond style. all bonds are implicit and computed on the fly.

I am attaching my data and in* file. I get the error 'Unexpected end of
molecule file' right now. I hope someone would please let me know what I am
missing.

there are two issues.

1) you are missing one line in the masses section
2) you are missing the empty line after some of the section headers

to make your input correct for use with reax (BTW: the fortran based
reax is obsolescent, you should move to reax/c instead) you also
should:
- set bonds to 0
- take out the Bonds section
- take out the Masses section

axel.

Thank you for you reply sir. What do you mean by “for atom_style charge, the mass is defined over the atom type
and thus there should not be a Masses section.” do you mean I should specify mass as I did in my input file? I tried making the changes that you suggested, but I am still getting this error. Am I getting this error because I am using pair style reax?Any suggestions?

Also, do I need to recompile lammps if I need to use reax/c? I changed the pair_style and got this error.

ERROR: Unknown pair style

I am attaching the corrected files.

Thank you.

in.sputter (321 Bytes)

nitrogen.dat (123 Bytes)

Thank you for you reply sir. What do you mean by "for atom_style charge, the
mass is defined over the atom type
and thus there should not be a Masses section." do you mean I should specify
mass as I did in my input file? I tried making the changes that you
suggested, but I am still getting this error. Am I getting this error
because I am using pair style reax?Any suggestions?

Also, do I need to recompile lammps if I need to use reax/c? I changed the
pair_style and got this error.

ERROR: Unknown pair style

Thank you for your reply.

Similar to using topo readlammpsdata for a given atom style, for a data file, is there a way to do so for molecule file in VMD?

Thanks.

Thank you for your reply.

Similar to using topo readlammpsdata for a given atom style, for a data
file, is there a way to do so for molecule file in VMD?

no. ... or rather: not yet.

but you can quickly create a readable data file containing just one
molecule with a minimal LAMMPS input.

axel.

John,
Here's an example of a data file and N2 molecule that I use for reax/c runs.
I'm looking at CHON systems, so my data file just specifies 4 atoms
(species) and their masses.
The molecule file for N2 identifies the total number of atoms (2),
coordinates, type, and charge.
In addition to not needing bonds or masses in your molecule file, you
are missing charge (required for reax). Also, the specification of
mass, which you could keep in the molecule file, but will produce a
warning, needs to be on a per-atom basis. There's no concept of
molecule for the model you're running.
Mark Fuller
Graduate Researcher
Brown University School of Engineering
85 Waterman St. #310
Providence, RI 02912
732-513-7119 (mobile)
[email protected]...

data.test_mass (93 Bytes)

molecule.n2 (128 Bytes)

John,
Here's an example of a data file and N2 molecule that I use for reax/c runs.
I'm looking at CHON systems, so my data file just specifies 4 atoms
(species) and their masses.
The molecule file for N2 identifies the total number of atoms (2),
coordinates, type, and charge.
In addition to not needing bonds or masses in your molecule file, you
are missing charge (required for reax). Also, the specification of

FYI. from the documentation of the molecule command:

Charges section:

one line per atom
line syntax: ID q
q = charge on atom
This section is only allowed for atom styles that support charge. If
this section is not included, the default charge on each atom in the
molecule is 0.0.

thus leaving out the Charges section or setting charges to 0.0 is the same.

axel.

Most atom styles (including charge) defined a mass for each

atom type, not for each atom. Thus all atoms of the same

type have the same mass. You define these Ntype masses

in the data file or via the mass command in an input script.

If you also have a molecule file, then you do not define

any masses in it, just the types of the atoms in the

molecule, which thus defines their mass.

Steve

Thank you so much for you reply. I edited my data file and changed atom types to 2 and I got it working.

On a side note, I was wondering, how you got the interatomic distance between the two nitrogen atoms? Could you please tell me your source and where to find it. Also, do you take into account the atomic radius of nitrogen which is 56pm? I did a simple google search to get ~1.9Å which i used as the distance between two atoms in x direction, but I notice that yours is 1.13Å.

Thanks

For that particular file, I grabbed the values from ASE (atomic
simulation environment): I asked for a nitrogen molecule and read out
the coordinates it uses for initialization.

For some better (optimized) values and a lot more information, the
NIST Comp. Chem. database is a good tool: http://cccbdb.nist.gov/
That says the radius should be 1.098 angstrom, so maybe I should
update my file...
Mark Fuller
Graduate Researcher
Brown University School of Engineering
85 Waterman St. #310
Providence, RI 02912
732-513-7119 (mobile)
[email protected]...

2016-01-19 13:57 GMT-05:00 John Smith <[email protected]...>:

When using the fix deposit command, the syntax is given as

fix ID group-ID deposit N type M seed keyword values

now what would the group id be for my case? I understand I should define ‘group type 2’ where 2 is nitrogen. But since I am trying to deposit a molecule, is this still correct? I could not find a way to define the molecule defined by molecule command into a group.

Thanks

When using the fix deposit command, the syntax is given as

fix ID group-ID deposit N type M seed keyword values

now what would the group id be for my case? I understand I should define
'group <name> type 2' where 2 is nitrogen. But since I am trying to deposit
a molecule, is this still correct? I could not find a way to define the
molecule defined by molecule command into a group.

the answer is in the documentation:

All atoms in the inserted particle are assigned to two groups: the
default group “all” and the group specified in the fix deposit command
(which can also be “all”).

in other words: if you want to have a group that contains *only* the
atoms added by fix deposit, you put it here, otherwise you just use
"all". please keep in mind that a deposited molecule is considered a
particle by fix deposit.

axel.