Example #1
0
	def lmp_structure(self):
		ribbon=graphene(dict(latx=self.gnrx,laty=self.gnry,latz=1,gnrtype=self.gnrtype)).lmp_structure()
		gnt=GNT(dict(latx=self.latx,laty=self.laty,latz=1,type=self.gnttype))
		atoms=gnt.lmp_structure()
		self.center_box(atoms)
		
		self.center_box(ribbon)
		ribbon.rotate('z',self.angle)
		r=gnt.radius+self.bond
		for atom in ribbon:
			atom.position=gnt.trans(atom.position,r=r)
		max=atoms.positions[:,0].max()
		min=atoms.positions[:,0].min()
		del ribbon[ribbon.positions[:,0]>max]
		del ribbon[ribbon.positions[:,0]<min]
		ribbon.translate([0,0,-r])
		atoms.extend(ribbon)
		atoms.center(vacuum=10)
		
		return atoms

	

			
		
Example #2
0
	def lmp_structure(self):
		ribbon=graphene(dict(latx=self.gnrx,laty=self.gnry,latz=1,gnrtype=self.gnrtype)).lmp_structure()
		gnt=GNT(dict(latx=self.latx,laty=self.laty,latz=1,type=self.gnttype))
		atoms=gnt.lmp_structure()
		self.center_box(atoms)
		
		self.center_box(ribbon)
		ribbon.rotate('z',self.angle)
		r=gnt.radius+self.bond
		for atom in ribbon:
			atom.position=gnt.trans(atom.position,r=r)
		max=atoms.positions[:,0].max()
		min=atoms.positions[:,0].min()
		del ribbon[ribbon.positions[:,0]>max]
		del ribbon[ribbon.positions[:,0]<min]
		ribbon.translate([0,0,-r])
		atoms.extend(ribbon)
		atoms.center(vacuum=10)
		
		return atoms

	

			
		
Example #3
0
 def ori_structure(self):
     atoms = graphene(dict(latx=self.latx, laty=self.laty,
                           latz=self.latz)).lmp_structure()
     self.center_box(atoms)
     for atom in atoms:
         atom.position = self.trans(atom.position)
     pair = atoms.copy()
     if self.tripair:
         pair.rotate('y', pi)
         pair.translate([0, 0, -4])
         gnt = GNT(dict(latx=4, laty=10, xp=0)).lmp_structure()
         self.center_box(gnt)
         gnt.translate([0, 0, -2])
         atoms.extend(gnt)
         atoms.extend(pair)
         self.swap(atoms, 1)
         atoms.rotate('x', pi / 2)
     else:
         pair.rotate('z', pi / 2)
         pair.rotate('y', pi)
         pair.translate([0, 0, 10])
         atoms.extend(pair)
         self.swap(atoms, 1)
     dx = 7
     xlo = atoms.positions[:, 0].min() + dx
     xhi = atoms.positions[:, 0].max() - dx
     ylo = atoms.positions[:, 1].min() + dx
     yhi = atoms.positions[:, 1].max() - dx
     zlo = atoms.positions[:, 2].min() + dx
     zhi = atoms.positions[:, 2].max() - dx
     right0 = atoms.positions[:, 2] > zhi
     right1 = atoms.positions[:, 2] < zlo
     if self.tripair:
         right0 = atoms.positions[:, 1] > yhi
         right1 = atoms.positions[:, 1] < ylo
     self.x1z1 = np.arange(len(atoms), dtype='int')[np.logical_and(
         atoms.positions[:, 0] > xhi, right0)] + 1
     self.x1z0 = np.arange(len(atoms), dtype='int')[np.logical_and(
         atoms.positions[:, 0] > xhi, right1)] + 1
     self.x0y1 = np.arange(len(atoms), dtype='int')[np.logical_and(
         atoms.positions[:, 0] < xlo, atoms.positions[:, 1] > yhi)] + 1
     self.x0y0 = np.arange(len(atoms), dtype='int')[np.logical_and(
         atoms.positions[:, 0] < xlo, atoms.positions[:, 1] < ylo)] + 1
     self.fmag = self.strain / float(len(self.x1z1))
     g = self.angle / 2.0
     d = self.angle1 / 2.0
     r0 = [cos(g), 0.0, sin(g)]
     r1 = [cos(g), 0.0, -sin(g)]
     if self.tripair:
         r0 = [cos(g), sin(g), 0.0]
         r1 = [cos(g), -sin(g), 0.0]
     self.posx1z1 = np.array((50, 50, 50)) + 500 * np.array(r0)
     self.posx1z0 = np.array((50, 50, 50)) + 500 * np.array(r1)
     self.posx0y1 = np.array(
         (50, 50, 50)) + 500 * np.array([-cos(d), sin(d), 0.0])
     self.posx0y0 = np.array(
         (50, 50, 50)) + 500 * np.array([-cos(d), -sin(d), 0.0])
     atoms.center(vacuum=50)
     return atoms
Example #4
0
	def ori_structure(self):
		atoms=graphene(dict(latx=self.latx,laty=self.laty,latz=self.latz)).lmp_structure()
		self.center_box(atoms)
		for atom in atoms:
			atom.position=self.trans(atom.position)
		pair=atoms.copy()
		if self.tripair:
			pair.rotate('y',pi)
			pair.translate([0,0,-4])
			gnt=GNT(dict(latx=4,laty=10,xp=0)).lmp_structure()
			self.center_box(gnt)
			gnt.translate([0,0,-2])
			atoms.extend(gnt)
			atoms.extend(pair)
			self.swap(atoms,1)
			atoms.rotate('x',pi/2)
		else:
			pair.rotate('z',pi/2)
			pair.rotate('y',pi)
			pair.translate([0,0,10])
			atoms.extend(pair)
			self.swap(atoms,1)
		dx=7
		xlo=atoms.positions[:,0].min()+dx
		xhi=atoms.positions[:,0].max()-dx
		ylo=atoms.positions[:,1].min()+dx
		yhi=atoms.positions[:,1].max()-dx
		zlo=atoms.positions[:,2].min()+dx
		zhi=atoms.positions[:,2].max()-dx
		right0=atoms.positions[:,2]>zhi
		right1=atoms.positions[:,2]<zlo
		if self.tripair:
			right0=atoms.positions[:,1]>yhi
			right1=atoms.positions[:,1]<ylo
		self.x1z1=np.arange(len(atoms),dtype='int')[np.logical_and(atoms.positions[:,0]>xhi , right0)]+1
		self.x1z0=np.arange(len(atoms),dtype='int')[np.logical_and(atoms.positions[:,0]>xhi , right1)]+1
		self.x0y1=np.arange(len(atoms),dtype='int')[np.logical_and(atoms.positions[:,0]<xlo , atoms.positions[:,1]>yhi)]+1
		self.x0y0=np.arange(len(atoms),dtype='int')[np.logical_and(atoms.positions[:,0]<xlo , atoms.positions[:,1]<ylo)]+1
		self.fmag=self.strain/float(len(self.x1z1))
		g=self.angle/2.0
		d=self.angle1/2.0
		r0=[cos(g),0.0,sin(g)]
		r1=[cos(g),0.0,-sin(g)]
		if self.tripair:
			r0=[cos(g),sin(g),0.0]
			r1=[cos(g),-sin(g),0.0]
		self.posx1z1=np.array((50,50,50))+500*np.array(r0)
		self.posx1z0=np.array((50,50,50))+500*np.array(r1)
		self.posx0y1=np.array((50,50,50))+500*np.array([-cos(d),sin(d),0.0])
		self.posx0y0=np.array((50,50,50))+500*np.array([-cos(d),-sin(d),0.0])
		atoms.center(vacuum=50)
		return atoms
Example #5
0
	def lmp_structure(self):
		atoms=Twist(dict(latx=self.latx,laty=self.laty,latz=1,gnrtype=self.gnrtype,twist=pi)).lmp_structure()
		self.writeatoms(atoms,'twist')
		r=atoms.cell[0,0]/2/pi
		gnt=GNT()
		self.center_box(atoms)
		atoms.rotate('z',pi/2)
		for atom in atoms:
			atom.position=gnt.trans(atom.position,r=r)
		#atoms.rotate('y',pi/2)
		atoms.center(vacuum=10)	
		return atoms


			
		
Example #6
0
	def lmp_structure(self):
		ribbon=graphene(dict(latx=self.gnrx,laty=self.gnry,latz=1,gnrtype=self.gnrtype)).lmp_structure()
		length=ribbon.cell[0][0]
		gnt=GNT(dict(latx=self.gntx,laty=self.gnty,latz=1,type=self.gnttype))
		atoms=gnt.lmp_structure()
		self.center_box(atoms)
		self.center_box(ribbon)
		atoms.rotate('z',pi/2)
		left=atoms.copy()

		r=gnt.radius+self.bond
		d=(length-2*pi*r)/2
		left.translate([-d/2,0,0])
		atoms.translate([d/2,0,0])
		for atom in ribbon:
			atom.position=self.trans(atom.position,r=r,d=d)
		atoms.extend(ribbon)
		atoms.extend(left)
		atoms.center(vacuum=10)
		
		return atoms
Example #7
0
    def lmp_structure(self):
        ribbon = graphene(
            dict(latx=self.gnrx, laty=self.gnry, latz=1,
                 gnrtype=self.gnrtype)).lmp_structure()
        length = ribbon.cell[0][0]
        gnt = GNT(
            dict(latx=self.gntx, laty=self.gnty, latz=1, type=self.gnttype))
        atoms = gnt.lmp_structure()
        self.center_box(atoms)
        self.center_box(ribbon)
        atoms.rotate('z', pi / 2)
        left = atoms.copy()

        r = gnt.radius + self.bond
        d = (length - 2 * pi * r) / 2
        left.translate([-d / 2, 0, 0])
        atoms.translate([d / 2, 0, 0])
        for atom in ribbon:
            atom.position = self.trans(atom.position, r=r, d=d)
        atoms.extend(ribbon)
        atoms.extend(left)
        atoms.center(vacuum=10)

        return atoms
Example #8
0
	def lmp_structure(self):
		atoms=GNT(dict(latx=self.latx,laty=self.laty,latz=1,gnrtype=self.gnrtype,phi=self.angle)).lmp_structure()
		r=atoms.cell[0,0]/self.phi
		gnt=GNT()
		self.center_box(atoms)
		atoms.rotate('z',pi/2)
		for atom in atoms:
			atom.position=gnt.trans(atom.position,r=r)
		#atoms.rotate('y',pi/2)
		atoms.center(vacuum=10)	
		return atoms


			
		
Example #9
0
 def lmp_structure(self):
     atoms = GNT(dict(latx=self.latx, laty=5, latz=1,
                      gnrtype=self.gnrtype)).lmp_structure()
     self.center_box(atoms)
     x = atoms.cell[0, 0] / 2
     c60 = molecule('C60', data=extra_molecules.data)
     c60.rotate('z', 2 * pi / 5)
     c60.rotate('y', -pi / 4)
     right = c60[c60.positions[:, 0] > c60.cell[0, 0] / 2].copy()
     del c60[c60.positions[:, 0] > c60.cell[0, 0] / 2]
     c60.translate([-x, 0, 0])
     right.translate([x, 0, 0])
     atoms.extend(c60)
     atoms.extend(right)
     atoms.center(vacuum=10)
     return atoms
Example #10
0
 def lmp_structure(self):
     atoms = GNT(
         dict(latx=self.latx,
              laty=self.laty,
              latz=1,
              gnrtype=self.gnrtype,
              phi=self.angle)).lmp_structure()
     r = atoms.cell[0, 0] / self.phi
     gnt = GNT()
     self.center_box(atoms)
     atoms.rotate('z', pi / 2)
     for atom in atoms:
         atom.position = gnt.trans(atom.position, r=r)
     #atoms.rotate('y',pi/2)
     atoms.center(vacuum=10)
     return atoms
Example #11
0
	def lmp_structure(self):
		atoms=GNT(dict(latx=self.latx,laty=5,latz=1,gnrtype=self.gnrtype)).lmp_structure()
		self.center_box(atoms)
		x=atoms.cell[0,0]/2
		c60=molecule('C60',data=extra_molecules.data)
		c60.rotate('z',2*pi/5)
		c60.rotate('y',-pi/4)
		right=c60[c60.positions[:,0]>c60.cell[0,0]/2].copy()
		del c60[c60.positions[:,0]>c60.cell[0,0]/2]
		c60.translate([-x,0,0])
		right.translate([x,0,0])
		atoms.extend(c60)
		atoms.extend(right)
		atoms.center(vacuum=10)	
		return atoms