I think this may not be robust. Are we certain that every possible all-atom model will read the forces in the same order? What determines the order of forces? If we place bonds after angles in the top. Does it change the order internally?
self.Top = GromacsTopFile(Topfile,unitCellDimensions=self.Gro.getUnitCellDimensions()) self.system = self.Top.createSystem(nonbondedMethod=CutoffPeriodic,nonbondedCutoff=self.rcutoff) nforces = len(self.system.getForces()) for force_id, force in enumerate(self.system.getForces()): if nforces == 7: if force_id <=4: force.setForceGroup(force_id) self.forcesDict[self.forceNamesCA[force_id]] = force self.forceCount +=1 else: force.setForceGroup(30) elif nforces == 8: if force_id <=5: force.setForceGroup(force_id) self.forcesDict[self.forceNamesAA[force_id]] = force self.forceCount +=1 else: force.setForceGroup(30)
I think this may not be robust. Are we certain that every possible all-atom model will read the forces in the same order? What determines the order of forces? If we place bonds after angles in the top. Does it change the order internally?
self.Top = GromacsTopFile(Topfile,unitCellDimensions=self.Gro.getUnitCellDimensions()) self.system = self.Top.createSystem(nonbondedMethod=CutoffPeriodic,nonbondedCutoff=self.rcutoff) nforces = len(self.system.getForces()) for force_id, force in enumerate(self.system.getForces()): if nforces == 7: if force_id <=4: force.setForceGroup(force_id) self.forcesDict[self.forceNamesCA[force_id]] = force self.forceCount +=1 else: force.setForceGroup(30) elif nforces == 8: if force_id <=5: force.setForceGroup(force_id) self.forcesDict[self.forceNamesAA[force_id]] = force self.forceCount +=1 else: force.setForceGroup(30)