def structure(self): latysmall,latExtend,latxsmall,latxbig,bond=[int(self.latysmall),int(self.latExtend),int(self.latxsmall),int(self.latxbig),float(self.bond)] if(latxsmall%2==0):latxsmall+=1; if(latxbig%2==1):latxbig+=1; atoms=self.agnr(latysmall,latxsmall+1,0); unit=self.agnr(latysmall-1+2*latExtend,latxbig,0) unit.translate([latxsmall*1.5,-(latExtend-0.5)*sqrt(3),0]) atoms.extend(unit) unit=self.agnr(latysmall,latxsmall+1,0); unit.translate([(latxsmall+latxbig-1)*1.5,0,0]) atoms.extend(unit) temp=Atoms() for i in range(self.seg): unit=atoms.copy() unit.translate([(latxsmall+latxbig-1)*1.5*i,0,0]) temp.extend(unit) atoms.extend(temp) atoms=get_unique_atoms(atoms) lx,ly=self.extent(atoms) atoms.set_cell([lx,ly,100]) atoms.set_cell([lx*bond,ly*bond,100],scale_atoms=True) atoms.set_pbc([1,1,1]) atoms.center(vacuum=10*bond) self.atoms=atoms self.write() print 'read_data structure'
def lmp_structure(self): if self.tilt: prototype=self.prototype_tilt else: prototype=self.prototype bond=self.bond if self.gnrtype=='armchair': col=prototype(self.latx,self.laty) elif self.gnrtype=='zigzag': col=prototype(self.laty,self.latx) """ col.rotate([1,1,0],pi,rotate_cell=True) cell=col.cell[[1,0,2]] cell[2]*=-1 col.set_cell(cell) """ self.swap(col,2) else: raise Exception('Unkown gnr type!') atoms=get_unique_atoms(col) col.set_pbc([self.xp,self.yp,self.zp]) cell=atoms.cell*bond atoms.set_cell(cell,scale_atoms=True) atoms.center() if self.pi3: if self.pi3==True: self.pi3=pi/3 atoms.rotate('z',self.pi3,rotate_cell=True) return atoms
def structure(self): latysmall, latExtend, latxsmall, latxbig, bond = [ int(self.latysmall), int(self.latExtend), int(self.latxsmall), int(self.latxbig), float(self.bond) ] if (latxsmall % 2 == 0): latxsmall += 1 if (latxbig % 2 == 1): latxbig += 1 atoms = self.agnr(latysmall, latxsmall + 1, 0) unit = self.agnr(latysmall - 1 + 2 * latExtend, latxbig, 0) unit.translate([latxsmall * 1.5, -(latExtend - 0.5) * sqrt(3), 0]) atoms.extend(unit) unit = self.agnr(latysmall, latxsmall + 1, 0) unit.translate([(latxsmall + latxbig - 1) * 1.5, 0, 0]) atoms.extend(unit) temp = Atoms() for i in range(self.seg): unit = atoms.copy() unit.translate([(latxsmall + latxbig - 1) * 1.5 * i, 0, 0]) temp.extend(unit) atoms.extend(temp) atoms = get_unique_atoms(atoms) lx, ly = self.extent(atoms) atoms.set_cell([lx, ly, 100]) atoms.set_cell([lx * bond, ly * bond, 100], scale_atoms=True) atoms.set_pbc([1, 1, 1]) atoms.center(vacuum=10 * bond) self.atoms = atoms self.write() print 'read_data structure'
def lmp_structure(self): col = self.unitcell(self.laty, self.latx) col.set_pbc([self.xp, self.yp, self.zp]) atoms = get_unique_atoms(col) cell = atoms.cell * self.bond atoms.set_cell(cell, scale_atoms=True) atoms.center() return atoms
def lmp_structure(self): col=self.unitcell(self.laty,self.latx) col.set_pbc([self.xp,self.yp,self.zp]) atoms=get_unique_atoms(col) cell=atoms.cell*self.bond atoms.set_cell(cell,scale_atoms=True) atoms.center() return atoms
def lmp_structure(self): prototype=self.prototype if self.gnrtype=='armchair': col=prototype(self.latx,self.laty) elif self.gnrtype=='zigzag': col=prototype(self.laty,self.latx) self.swap(col,2) else: raise Exception('Unkown gnr type!') col.center() atoms=get_unique_atoms(col) col.set_pbc([self.xp,self.yp,self.zp]) atoms.center() return atoms
def lmp_structure(self): if self.tilt: prototype=self.prototype_tilt else: prototype=self.prototype bond=self.bond if self.gnrtype=='armchair': col=prototype(self.latx,self.laty) elif self.gnrtype=='zigzag': col=prototype(self.laty,self.latx) self.swap(col,2) else: raise Exception('Unkown gnr type!') col.center() atoms=get_unique_atoms(col) col.set_pbc([self.xp,self.yp,self.zp]) cell=atoms.cell*bond atoms.set_cell(cell,scale_atoms=True) atoms.center() return atoms