Пример #1
0
 def update_energy(self, torschange, angchange, dict):
     QSimulation.k_Qpin = dict['k_Qpin']
     Simulation.nsigma2 = dict['nsigma2']
     Simulation.totnc = dict['totnc']
     SurfaceSimulation.update_energy(self, torschange, angchange, dict)
     self.newQ = energyfunc.nativecontact(self.r2new, Simulation.nativeparam, Simulation.nsigma2) / Simulation.totnc
     self.u1 += QSimulation.k_Qpin*(self.newQ - self.Qpin)**2
Пример #2
0
 def loadextend(self, extenddirec):
     self.coord = numpy.load('%s/coord%s.npy' % (extenddirec, self.suffix))
     self.setenergy()
     self.energyarray[0] = self.u0
     self.nc[0] = energyfunc.nativecontact(
         self.r2, Simulation.nativeparam,
         Simulation.nsigma2) / Simulation.totnc
Пример #3
0
 def setenergy(self):
     # sets the u0, r2, torsE, angE from the current configuration
     # called when restarting from a checkpoint
     Simulation.setenergy(self)
     self.Q = energyfunc.nativecontact(
         self.r2, Simulation.nativeparam,
         Simulation.nsigma2) / Simulation.totnc
     self.u0 += QSimulation.k_Qpin * (self.Q - self.Qpin)**2
Пример #4
0
def save(self):
    index = self.move / Simulation.save
    self.energyarray[index] = self.u0
    self.surfE_array[index, :] = self.surfE
    self.nc[index] = energyfunc.nativecontact(self.r2, Simulation.nativeparam,
                                              Simulation.nsigma2)
    self.z_array[index] = numpy.sum(
        self.mass * self.coord[:, 2]) / self.totmass
    if (Simulation.writetraj):
        f = open('%s/trajectory%i' % (self.out, int(self.T)), 'ab')
        numpy.save(f, self.coord)
        f.close()
    return self
Пример #5
0
 def save_state(self, dict):
     Simulation.save = dict['save']
     Simulation.nativeparam = dict['nativeparam']
     Simulation.nsigma2 = dict['nsigma2']
     Simulation.writetraj = dict['writetraj']
     Simulation.totnc = dict['totnc']
     self.energyarray[self.move / Simulation.save] = self.u0
     self.nc[self.move / Simulation.save] = energyfunc.nativecontact(
         self.r2, Simulation.nativeparam,
         Simulation.nsigma2) / Simulation.totnc
     if (Simulation.writetraj):
         f = open('%s/trajectory%s' % (self.out, self.suffix), 'ab')
         numpy.save(f, self.coord)
         f.close()
Пример #6
0
    def __init__(self, name, outputdirectory, coord, temp):
        self.name = name
        self.out = outputdirectory
        self.suffix = str(int(temp))  # affixed at end of file names
        self.coord = coord
        self.energyarray = numpy.empty(Simulation.totmoves / Simulation.save +
                                       1)
        self.nc = numpy.empty(Simulation.totmoves / Simulation.save +
                              1)  #native contacts
        self.move = 0
        self.T = temp
        self.maxtheta = numpy.array([
            5.,  # bend
            10.,  # torsion
            1. / self.T * 500,  # global crankshaft
            5.
        ])  # ParRot move
        self.maxtheta = self.maxtheta * numpy.pi / 180 * self.T**1.5 / 5250. * 50 / Simulation.numbeads
        self.setenergy()
        self.energyarray[0] = self.u0
        self.nc[0] = energyfunc.nativecontact(
            self.r2, Simulation.nativeparam,
            Simulation.nsigma2) / Simulation.totnc

        # Instantiate constants for move stats
        self.amoves = 0
        self.atmoves = 0
        self.gcmoves = 0
        self.pmoves = 0
        self.mdmoves = 0
        self.acceptedgc = 0
        self.acceptedp = 0
        self.acceptedmd = 0
        self.acceptedat = 0
        self.accepteda = 0
        self.pclosure = 0
        self.accepted = 0
        self.rejected = 0
        self.movetype = ''
Пример #7
0
 def setenergy(self):
     SurfaceSimulation.setenergy(self)
     self.Q = energyfunc.nativecontact(self.r2, Simulation.nativeparam, Simulation.nsigma2) / Simulation.totnc
     self.u0 += QSimulation.k_Qpin*(self.Q - self.Qpin)**2
Пример #8
0
    def setenergy(self):
	# sets the u0, r2, torsE, angE from the current configuration
	# called when restarting from a checkpoint
        Simulation.setenergy(self)
        self.Q = energyfunc.nativecontact(self.r2, Simulation.nativeparam, Simulation.nsigma2) / Simulation.totnc
        self.u0 += QSimulation.k_Qpin*(self.Q - self.Qpin)**2