예제 #1
0
		def __init__(self):
			#do everything in the constructor.
			#this way, when we instantiate the object below, the whole
			#simulation will automatically run
			
			print "Initializing simulation"
			self.sim = CustomSimulation(rng)
			self.sim.setTemperature(0.5)
			#self.sim.setDragCoefficient(2.5)
			#self.sim.setTimestep(0.05)
			tpsgraphics.pefield(self.sim, tn, -3., 3.0, -1.5, 3.5, 0, 2, 0.150)
			tn.write("scale by 0.5\n")
			tn.write("rotate x by -20\n")
			tn.write("mol new\n")
			
			self.sim.setParticlePosition(-1, 0)

			print "Done Initializing simulation"

			q1 = TpsTestPeSurf2dOrderParamX(3)
			q2 = TpsTestPeSurf2dOrderParamY(3)
			q = TpsOrderParameterAggregate()
			q.addOrderParameter(q1)
			q.addOrderParameter(q2)

			trj = TpsTrajectoryUniformStep(self.sim, 500, 5)
			self.tpe = TpsTrajectoryEnsemble(trj)
			working_traj = self.tpe.getTrajectory(-1)
			self.sim.setPathEnsemble(self.tpe)
			
			print "Initializing"
			self.sim.show = 1
			TpsAlgorithmBruteForce.__init__(self, self.tpe, rng, q)
			#writer.analyze(self.tpe.getLastTrajectory())

			self.sim.setTemperature(0.15)
			self.nstep = 0
			print "starting path sampling:"
			for i in range(1, 501):
				print i
				self.doStep()
				
			var = raw_input("Return/Enter to EXIT ")
			tn.write("exit\n")
			exit(1)
예제 #2
0
        def __init__(self):
            #do everything in the constructor.
            #this way, when we instantiate the object below, the whole
            #simulation will automatically run

            print "Initializing simulation"
            self.sim = CustomSimulation(rng)
            self.sim.setTemperature(0.5)
            #self.sim.setDragCoefficient(2.5)
            #self.sim.setTimestep(0.05)
            tpsgraphics.pefield(self.sim, tn, -3., 3.0, -1.5, 3.5, 0, 2, 0.150)
            tn.write("scale by 0.5\n")
            tn.write("rotate x by -20\n")
            tn.write("mol new\n")

            self.sim.setParticlePosition(-1, 0)

            print "Done Initializing simulation"

            q1 = TpsTestPeSurf2dOrderParamX(3)
            q2 = TpsTestPeSurf2dOrderParamY(3)
            q = TpsOrderParameterAggregate()
            q.addOrderParameter(q1)
            q.addOrderParameter(q2)
            init = TpsInitializerBruteForce()

            trj = TpsTrajectoryUniformStep(self.sim, 500, 5)
            self.tpe = TpsTrajectoryEnsemble(trj)
            working_traj = self.tpe.getTrajectory(-1)
            self.sim.setPathEnsemble(self.tpe)

            print "Initializing"
            self.sim.show = 0
            TpsAlgorithmTPS.__init__(self, self.tpe, rng, q, init)
            writer.analyze(self.tpe.getLastTrajectory())

            #dv = TpsTimesliceModifierPerturbVelocities(0.0001, 1.0, 1, 1)
            self.shift = TpsTrialMoveShift(50, 400)
            self.fshot = TpsTrialMoveShotForward()
            self.bshot = TpsTrialMoveShotBackward()
            self.shot = TpsTrialMoveShot()
            self.flex = TpsTrialMoveShotFlexible(500)
            self.ashot = TpsTrialMoveShotAimless(5)

            self.addTrialMove(self.ashot)
            #self.addTrialMove(fshot)
            #self.addTrialMove(bshot)
            #self.addTrialMove(shift)

            self.sim.setTemperature(0.15)
            self.sim.show = 0
            self.nstep = 0
            print "starting path sampling:"
            for i in range(1, 501):
                print i
                self.doStep()

            for i in range(1, 1000):
                self.doStepCustom()

            var = raw_input("Return/Enter to EXIT ")
            tn.write("exit\n")
            exit(1)
예제 #3
0
		def __init__(self):
			#do everything in the constructor.
			#this way, when we instantiate the object below, the whole
			#simulation will automatically run
			
			print "Initializing simulation"
			self.sim = CustomSimulation(rng)
			self.sim.setTemperature(0.5)
			#self.sim.setDragCoefficient(2.5)
			#self.sim.setTimestep(0.05)
			tpsgraphics.pefield(self.sim, tn, -3., 3.0, -1.5, 3.5, 0, 2, 0.150)
			tn.write("scale by 0.5\n")
			tn.write("rotate x by -20\n")
			tn.write("mol new\n")
			
			self.sim.setParticlePosition(-1, 0)

			print "Done Initializing simulation"

			q1 = TpsTestPeSurf2dOrderParamX(3)
			q2 = TpsTestPeSurf2dOrderParamY(3)
			q = TpsOrderParameterAggregate()
			q.addOrderParameter(q1)
			q.addOrderParameter(q2)
			init = TpsInitializerBruteForce()

			trj = TpsTrajectoryUniformStep(self.sim, 500, 5)
			self.tpe = TpsTrajectoryEnsemble(trj)
			working_traj = self.tpe.getTrajectory(-1)
			self.sim.setPathEnsemble(self.tpe)
			
			print "Initializing"
			self.sim.show = 0
			TpsAlgorithmTPS.__init__(self, self.tpe, rng, q, init)
			writer.analyze(self.tpe.getLastTrajectory())

			#dv = TpsTimesliceModifierPerturbVelocities(0.0001, 1.0, 1, 1)
			self.shift = TpsTrialMoveShift(50, 400)
			self.fshot = TpsTrialMoveShotForward()
			self.bshot = TpsTrialMoveShotBackward()
			self.shot = TpsTrialMoveShot()
			self.flex = TpsTrialMoveShotFlexible(500)
			self.ashot = TpsTrialMoveShotAimless(5)
			
			self.addTrialMove(self.ashot)			
			#self.addTrialMove(fshot)
			#self.addTrialMove(bshot)
			#self.addTrialMove(shift)
			
			self.sim.setTemperature(0.15)
			self.sim.show = 0
			self.nstep = 0
			print "starting path sampling:"
			for i in range(1, 501):
				print i
				self.doStep()

			for i in range(1, 1000):
				self.doStepCustom()
				
			var = raw_input("Return/Enter to EXIT ")
			tn.write("exit\n")
			exit(1)