From: Axel Kohlmeyer (akohlmey_at_gmail.com)
Date: Tue Mar 16 2021 - 13:30:53 CDT

The issue is not really a LAMMPS issue but a general issue for generating
output for molecular dynamics codes.
The same problem would apply if you would try to write out a pdf file for
use with NAMD or a gromacs topology file with TopoTools.

As John already mentioned, a quantum chemistry software has different
requirements for modeling than a classical MD code.
In quantum chemistry, in the most general case, you need to know the
positions and the elements of atoms. All remaining properties required for
the calculation are global settings of the software (choice of basis set,
type/method of calculation).
In a classical MD code atoms are in general *not* identified by their
elements, but by their atom type. Assigning the atom type (aka "atom
typing") and (partial) charge determines which force field parameters to
use for atoms and is an integral part of setting up force field
calculations.
Atom types and charges are subject to the "environment" of individual atoms
and reflect the "chemical nature" of those atoms. For a force field
calculation, there are differences between atoms in methyl-group or a
carbonyl-group or a phenyl-group and so on. Same for other elements.
The identification of atom types depends on the individual force field.
Some have some increment system that allows to do this semi-automatically,
but in most cases you have a database of molecule fragments or residues
which you can match with the input geometry. If you have proteins or
DNA/RNA, this procedure is rather straightforward, for as long as you use a
suitable file from the corresponding databases (e.g. PDB) that follow
specific conventions (and that have no unusual fragments or residues not
present in the database). for the rest things get complicated.
Thus most MD codes and their associated force fields have specific tools
for that.

Coming back to VMD/TopoTools and LAMMPS. VMD only "knows" the information
you provide. So if there is an input file without atom types, without
explicit bonds/angles/dihedrals, without simulation cell information, then
it is difficult to recover this information.
- If there is no simulation cell information, you can make an educated
guess using the measure minmax command. Mind you VMD doesn't store the cell
origin (that information is lost on writing) but only the box lengths and
angles. TopoTools makes an educated guess. For periodic boundary conditions
it should not make a difference anyway.
- If there is no information about bonds, VMD will make an educated guess
for visualization purposes. This is based on the atoms' names from which
covalent radii are guessed and can be misleading or incorrect in some
cases. Other bonded information like angles or dihedrals are not
reconstructed since they are not needed for visualization purposes. The
TopoTools plugin allows you to manually add/remove bonds or redo the bond
guessing (after manually adjusting the atom radii). It also has commands
included that can guess angle and dihedral definition from the bond
topology and some rather approximate method to guess improper dihedrals.
- Also there are no (partial) charges assigned, as needed by most classical
force fields. Those are usually derived as part of the atom typing.
- Atom typing is the biggest problem, since VMD knows nothing about the
chemistry and thus the chemical environment of the system you have loaded.
All it sees is a collection of positions with labels. And that lack of
information will propagate to the typing of bonded interactions, since
TopoTools will derive symbolic names for such interactions from the atom
type information available. Automatically guessed (by VMD) bonds have no
type information associated with them, so you need to "retype" those. But
the bottom line is, if you want to do meaningful simulations then you
either need to use a force field like ReaxFF that also identifies atom
types by their elements and *must not* have any bonded interactions
defined, or you need to look up and learn how to type the atoms and thus
assign atom types or generally force field types. While VMD handles those
with symbolic names, LAMMPS uses consecutive numbers starting from 1, so
you need to be very careful and conscious of the steps you are doing. The
best that TopoTools can do is to insert some comments into the generated
data file with helpful hints what entry corresponds to what symbolic name.

bottom line: it is impossible to recover information that is not there in a
fully automated fashion.

HTH,
     Axel.

On Tue, Mar 16, 2021 at 1:24 PM John Stone <johns_at_ks.uiuc.edu> wrote:

> Marco,
> Since GAMESS is quantum chemistry package, I would not normally
> expect that its models would include any explicit modeling of the
> bonds, angles, dihedrals, etc that a so-called molecular mechanics
> based molecular dynamics package like LAMMPS would require.
> I expect that you will have to assign appropriate LAMMPS atom types
> and define all of those force field terms for the structures you plan
> to simulate. Although VMD is able to perform very simple conversions
> from one file format to another when they provide/store the same
> types of information, it definitely does not automatically assign
> atom types or force field parameters, which requires the use of
> purpose-built tools that resolve those problems. Hopefully some LAMMPS
> users can suggest a good workflow for you to follow to achieve the
> modeling you're interested in performing.
>
> Best regards,
> John Stone
>
> On Tue, Mar 16, 2021 at 08:06:35AM +0000, marco di gennaro wrote:
> > Dear VMD users,
> > I have a GAMESS US output file and would like to export it into LAMMPS
> > data format.
> > I encounter the following error when using the vmd terminal:
> > vmd > topo writelammpsdata lammps.data
> > ERROR) writelammpsdata: need to have non-zero box sizes to write a
> data
> > file
> > ERROR) writelammpsdata: current box sizes: {0.000000 0.000000
> 0.000000}
> > I therefore tried to follow
> > this: [1]
> http://www.ks.uiuc.edu/Research/vmd/mailing_list/vmd-l/1355.html and
> > set:
> > molinfo top set a 30.0
> > molinfo top set b 30.0
> > molinfo top set c 30.0
> > molinfo top set alpha 90.0
> > molinfo top set beta 90.0
> > molinfo top set gamma 90.0
> > Which kind of made the trick: no error message and lammps.data
> produced.
> > Nevertheless there is neither angles nor dihedral angles in the
> > lammps.data file.
> > Could anyone tell me whether this is the right procedure for GAMESS
> files,
> > and how to improve it/make it properly?
> > Thank you
> > Best Regards
> > Marco Di Gennaro
> >
> > References
> >
> > Visible links
> > 1. http://www.ks.uiuc.edu/Research/vmd/mailing_list/vmd-l/1355.html
>
> --
> NIH Center for Macromolecular Modeling and Bioinformatics
> Beckman Institute for Advanced Science and Technology
> University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
> http://www.ks.uiuc.edu/~johns/ Phone: 217-244-3349
> http://www.ks.uiuc.edu/Research/vmd/
>
>

-- 
Dr. Axel Kohlmeyer  akohlmey_at_gmail.com  https://urldefense.com/v3/__http://goo.gl/1wk0__;!!DZ3fjg!u2Cdy1D86k4dJCHC3K1qUOGDE2SU9-ARddPpU7YfdK07oar-cWmUPXTnSa_sjtboqA$ 
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.