Forum Navigation
You need to log in to create posts and topics.

Topology calculation for a complete LAMMPS data file export

Dear OVITO devs,

First a big thank you to Alexander and everyone involved with the OVITO project! It has been an invaluable tool in my work.

A couple of threads in the support forum have highlighted something that I have wanted for some time, the ability to read, generate, and write a LAMMPS data file with full topology (angles, dihedrals and impropers). I understand that there was a good reason to not include such a feature in the initial development of OVITO, but it seems that as OVITO works so well with LAMMPS, such an extension to include topology would feel very natural.

Capacity to handle the topology data for the reading and writing of LAMMPS data files, as well as a modifier for calculating these data based on particle properties would be greatly appreciated.

In my own work I typically define a particle species property, usually by guessing it from the  nearest integer of the particle mass.  Additionally, it would be nice to allow the create bonds modifier (which I presume would be the base of the topology calculation) to define cutoffs based on a species (or other) type of property.

Regards,

-Filip V.

Filip,

Thank you for describing your specific needs and expressing the general interest in this feature. I will try to work on this as soon as my time allows.

Let me ask you two more questions in order to better understand your needs:

You wrote that you define particle specifies in OVITO by guessing them from the particle mass. I am wondering why this is necessary in the first place. Is it because your LAMMPS data/dump files contain only the numeric atom type IDs and not the chemical element names?

Furthermore, I am wondering what your comment on the Create Bonds modifier of OVITO is referring to. That modifier already provides the option for you to specify individual cutoff radii for each pair of particle types in the system. Would like to have even more control of the bind creation, or would like the modifier to rather be smarter perhaps tomato the creation of bond topology easier?

-Alex

Hey Alex,

So the way I've been setting up fixed-topology simulations is that I use the LAMMPS 'atom-type' quantity to define atoms in unique chemical environments, and hence end up with many atom-types that pertain to single elements. e.g. I may have atom-types 1 through 20 be carbon, 21 and 24 as nitrogen, etc (and not necessarily ordered either). So what I end up with in a dump or data file is many atom-types and only a few elements. The result in OVITO is that I must set a large number of inter-particle cutoffs between the various types if I choose to use the create bonds functionality.

I just went back to the LAMMPS docs and it seems there is a way of outputting an 'element' string to the dump file... feel a bit silly now.

I realise there are smarter ways to visualise the trajectories with bonds OVITO, but the additional control of the create bonds modifier cutoffs may still be helpful  ¯\_(ツ)_/¯.

In short, I'm probably doing things the hard way.

Regards,

-Filip V.

Hey Filip,

I want to inform you that the latest development build of OVITO brings some support for extended molecule topology information (angles/dihedrals/impropers), which you have asked for above. The LAMMPS data file readers/writers now handle the corresponding sections of the file format. Operations in OVITO that remove atoms will update the topology information as needed to avoid dangling references, and the Replicate modifier duplicates also the topology information together with the particles.

Please give it a try and let me know if you run into any problems. Furthermore, you've mentioned that "calculating" the topology information within OVITO would be useful. Could you please elaborate on this aspect a bit more. Not being familiar with molecular force fields I am not sure what the typical workflows are and which additions to OVITO make sense. Thanks.

-Alex

Hey Alex,

Thank you for your efforts! These additions will most certainly be useful for me (and my colleagues). I'll give them a spin in the near future.

In regards to calculating molecular topology, I actually have some current work that would really benefit from this feature. A basic workflow I would use to generate a LAMMPS data file with the correct topology would be to generate a pdb file either graphically or manually, assigning particle types to atoms in unique chemical environments (C1,C2,C3,N1,N2,O1,H1,H2.... etc). Then the PDB file would be read into VMD and a topology would be calculated using the 'topotools' plugin, which will find angles and dihedrals (based on the bonding topology), and then would guess impropers based on the bonding along with some cutoff value. Then there will be angle, dihedral, and improper types for  all of the unique cases so that force field parameters may be set according to the elements and chemistry involved in the interaction. After this I can move back to OVITO for visualisation of the simulation trajectories but ideally I'd like to only use one visualiser for the entire workflow... and I prefer OVITO ;). I could just as easily start with a LAMMPS data file rather than a PDB, that part is fairly irrelevant. Please let me know if I should provide more specific details, either here or in via private message.

 

Regards,

-Filip V.