shirtsgroup / InterMol

Conversion tool for molecular simulations
MIT License
186 stars 53 forks source link

Reading Lammps data files (Number of Dihedral Coefficients gives errors) #348

Open JoshuaSBrown opened 5 years ago

JoshuaSBrown commented 5 years ago

It seems that Intermol expects a total of five coefficients for the improper harmonic dihedral. This creates a problem when reading a lammps file if only four are supplied. At least this link indicates there can be an arbitrary number of dihedral coefficients (ki).

https://lammps.sandia.gov/doc/dihedral_fourier.html

I'm guessing that a simple solution might be to set the coefficients to 0 if there are less than 5 for the remaining coefficients. However, I am not an expert with force fields so any feedback would be appreciated?

Here is the error:

File "/mnt/d/jbrown/Documents/Code/Python_Code/InterMol/intermol/forces/forcefunctions.py", line 142, in create_kwds_from_entries
    print entries[offset+i];
IndexError: list index out of range
JoshuaSBrown commented 5 years ago

I can fix this but I would like some feedback to ensure I understand the problem correctly?

ctk3b commented 5 years ago

Setting coefficients to 0 if unspecified looks correct.

You should be able to validate the energy output before and after using the --energy flag.

Thank you for looking into this!

JoshuaSBrown commented 5 years ago

@ctk3b thanks for the clarification.