"platforms/reference/src/SimTKReference/PME.cpp" did not exist on "c66dd5a36057d0bc57024ee66aee1f4f4df34d8b"
Commit 3d863037 authored by peastman's avatar peastman
Browse files

Merge pull request #930 from swails/gmx_virtualsites

Raise exception when processing Gromacs molecule with virtual sites
parents 51b7141a e04283bb
......@@ -114,6 +114,7 @@ class GromacsTopFile(object):
self.exclusions = []
self.pairs = []
self.cmaps = []
self.has_virtual_sites = False
def _processFile(self, file):
append = ''
......@@ -247,6 +248,11 @@ class GromacsTopFile(object):
self._processPairType(line)
elif self._currentCategory == 'cmaptypes':
self._processCmapType(line)
elif self._currentCategory.startswith('virtual_sites'):
if self._currentMoleculeType is None:
raise ValueError('Found %s before [ moleculetype ]' %
self._currentCategory)
self._currentMoleculeType.has_virtual_sites = True
def _processDefaults(self, line):
"""Process the [ defaults ] line."""
......@@ -483,6 +489,8 @@ class GromacsTopFile(object):
if moleculeName not in self._moleculeTypes:
raise ValueError("Unknown molecule type: "+moleculeName)
moleculeType = self._moleculeTypes[moleculeName]
if moleculeCount > 0 and moleculeType.has_virtual_sites:
raise ValueError('Virtual sites not yet supported by Gromacs parsers')
# Create the specified number of molecules of this type.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment