parameters: (self, sys, OPLS)
docstring: Create the torsion terms
docstring_summary: Create the torsion terms
docstring_tokens: Create the torsion terms
function: def _addPeriodicTorsionsToSystem(self, sys, OPLS):
          """Create the torsion terms
          """
          if OPLS:
              periodic = mm.CustomTorsionForce('f * cos(n * theta - phi0)')
              periodic.addPerTorsionParameter('n')
              periodic.addPerTorsionParameter('phi0')
              periodic.addPerTorsionParameter('f')
          else:
              periodic = mm.PeriodicTorsionForce()
          sys.addForce(periodic)
  
          q = """SELECT p0, p1, p2, p3, phi0, fc0, fc1, fc2, fc3, fc4, fc5, fc6
          FROM dihedral_trig_term INNER JOIN dihedral_trig_param
          ON dihedral_trig_term.param=dihedral_trig_param.id"""
  
          for (fcounter,conn,tables,offset) in self._localVars():
              for p0, p1, p2, p3, phi0, fc0, fc1, fc2, fc3, fc4, fc5, fc6 in conn.execute(q):
                  p0 += offset
                  p1 += offset
                  p2 += offset
                  p3 += offset
                  for order, fc in enumerate([fc0, fc1, fc2, fc3, fc4, fc5, fc6]):
                      if fc == 0:
                          continue
                      if OPLS:
                          periodic.addTorsion(p0, p1, p2, p3, [order, phi0*degree, fc*kilocalorie_per_mole])
                      else:
                          periodic.addTorsion(p0, p1, p2, p3, order, phi0*degree, fc*kilocalorie_per_mole)
function_tokens: def _addPeriodicTorsionsToSystem ( self , sys , OPLS ) : if OPLS : periodic = mm . CustomTorsionForce ( 'f * cos(n * theta - phi0)' ) periodic . addPerTorsionParameter ( 'n' ) periodic . addPerTorsionParameter ( 'phi0' ) periodic . addPerTorsionParameter ( 'f' ) else : periodic = mm . PeriodicTorsionForce ( ) sys . addForce ( periodic ) q = """SELECT p0, p1, p2, p3, phi0, fc0, fc1, fc2, fc3, fc4, fc5, fc6
          FROM dihedral_trig_term INNER JOIN dihedral_trig_param
          ON dihedral_trig_term.param=dihedral_trig_param.id""" for ( fcounter , conn , tables , offset ) in self . _localVars ( ) : for p0 , p1 , p2 , p3 , phi0 , fc0 , fc1 , fc2 , fc3 , fc4 , fc5 , fc6 in conn . execute ( q ) : p0 += offset p1 += offset p2 += offset p3 += offset for order , fc in enumerate ( [ fc0 , fc1 , fc2 , fc3 , fc4 , fc5 , fc6 ] ) : if fc == 0 : continue if OPLS : periodic . addTorsion ( p0 , p1 , p2 , p3 , [ order , phi0 * degree , fc * kilocalorie_per_mole ] ) else : periodic . addTorsion ( p0 , p1 , p2 , p3 , order , phi0 * degree , fc * kilocalorie_per_mole )