Пример #1
0
    def create_slab(self, vacuum=12, thickness=10):
        """
        set the vacuum spacing, slab thickness and call sd_flags
        for top 2 layers

        returns the poscar corresponding to the modified structure
        """
        strt_structure = self.input_structure.copy()
        if self.from_ase:
            slab_struct = get_ase_slab(strt_structure,
                                       hkl=self.system['hkl'],
                                       min_thick=thickness,
                                       min_vac=vacuum)
        else:
            slab_struct = SlabGenerator(initial_structure=strt_structure,
                                        miller_index=self.system['hkl'],
                                        min_slab_size=thickness,
                                        min_vacuum_size=vacuum,
                                        lll_reduce=False,
                                        center_slab=True,
                                        primitive=False).get_slab()
        slab_struct.sort()
        sd = self.set_sd_flags(slab_struct)
        comment = 'VAC' + str(vacuum) + 'THICK' + str(thickness)
        return Poscar(slab_struct, comment=comment, selective_dynamics=sd)
Пример #2
0
 def __init__(self, strt, hkl=[1,1,1], min_thick=10, min_vac=10,
              supercell=[1,1,1], name=None, adsorb_on_species=None,
              adatom_on_lig=None, ligand=None, displacement=1.0,
              surface_coverage=None, scell_nmax=10,
              coverage_tol=0.25, solvent=None, 
              start_from_slab=False, validate_proximity=False,
              to_unit_cell=False, coords_are_cartesian=False,
              primitive=True, from_ase=False,
              x_shift=0, y_shift=0, rot=[0,0,0],
              center_slab=True):
     self.from_ase = from_ase
     vac_extension = 0
     if ligand is not None:
         vac_extension = ligand.max_dist
     if isinstance(strt, Structure) and not isinstance(strt, Slab):
         self.min_vac = min_vac + vac_extension
         if self.from_ase:
             strt = get_ase_slab(strt,
                                 hkl=hkl,
                                 min_thick=min_thick,
                                 min_vac=min_vac + vac_extension, 
                                 center_slab=center_slab)
         else:
             strt = SlabGenerator(strt, hkl, min_thick,
                                  min_vac + vac_extension,
                                  center_slab=center_slab,
                                  primitive = primitive).get_slab()
         strt.make_supercell(supercell)
     else:
         self.min_vac = min_vac
     Slab.__init__(self, strt.lattice, strt.species_and_occu,
                   strt.frac_coords,
                   miller_index=strt.miller_index,
                   oriented_unit_cell=strt.oriented_unit_cell,
                   shift=strt.shift, scale_factor=strt.scale_factor,
                   validate_proximity=validate_proximity,
                   to_unit_cell=to_unit_cell,
                   coords_are_cartesian=coords_are_cartesian,
                   site_properties=strt.site_properties,
                   energy=strt.energy )
     self.strt= strt
     self.name = name
     self.hkl = hkl
     self.min_thick = min_thick
     self.supercell = supercell
     self.ligand = ligand
     self.slab = strt
     self.displacement = displacement
     self.solvent = solvent
     self.surface_coverage = surface_coverage
     self.adsorb_on_species = adsorb_on_species
     self.adatom_on_lig = adatom_on_lig
     self.scell_nmax = scell_nmax
     self.coverage_tol = coverage_tol
     self.x_shift = x_shift
     self.y_shift = y_shift
     self.rot = rot
Пример #3
0
    def create_slab(self, vacuum=12, thickness=10):
        """
        set the vacuum spacing, slab thickness and call sd_flags
        for top 2 layers

        returns the poscar corresponding to the modified structure
        """ 
        strt_structure = self.input_structure.copy()
        if self.from_ase:
            slab_struct = get_ase_slab(strt_structure, hkl=self.system['hkl'],
                                        min_thick=thickness, min_vac=vacuum)
        else:
            slab_struct= SlabGenerator(initial_structure= strt_structure,
                                       miller_index= self.system['hkl'], 
                                       min_slab_size= thickness,
                                       min_vacuum_size=vacuum, 
                                       lll_reduce=False, center_slab=True,
                                       primitive=False).get_slab()
        slab_struct.sort()
        sd = self.set_sd_flags(slab_struct)
        comment = 'VAC'+str(vacuum)+'THICK'+str(thickness)
        return Poscar(slab_struct, comment=comment,
                      selective_dynamics=sd)    
Пример #4
0
 def __init__(self,
              strt,
              hkl=[1, 1, 1],
              min_thick=10,
              min_vac=10,
              supercell=[1, 1, 1],
              name=None,
              adsorb_on_species=None,
              adatom_on_lig=None,
              ligand=None,
              displacement=1.0,
              surface_coverage=None,
              scell_nmax=10,
              coverage_tol=0.25,
              solvent=None,
              start_from_slab=False,
              validate_proximity=False,
              to_unit_cell=False,
              coords_are_cartesian=False,
              primitive=True,
              from_ase=False,
              lll_reduce=False,
              center_slab=True,
              max_normal_search=None,
              force_normalize=False,
              x_shift=0,
              y_shift=0,
              rot=[0, 0, 0]):
     self.from_ase = from_ase
     vac_extension = 0
     if ligand is not None:
         vac_extension = ligand.max_dist
     if isinstance(strt, Structure) and not isinstance(strt, Slab):
         self.min_vac = min_vac + vac_extension
         if self.from_ase:
             strt = get_ase_slab(strt,
                                 hkl=hkl,
                                 min_thick=min_thick,
                                 min_vac=min_vac + vac_extension)
         else:
             slab = SlabGenerator(strt,
                                  hkl,
                                  min_thick,
                                  min_vac + vac_extension,
                                  center_slab=center_slab,
                                  lll_reduce=lll_reduce,
                                  max_normal_search=max_normal_search,
                                  primitive=primitive).get_slab()
             if force_normalize:
                 strt = slab.get_orthogonal_c_slab()
             else:
                 strt = slab
         strt.make_supercell(supercell)
     else:
         self.min_vac = min_vac
     Slab.__init__(self,
                   strt.lattice,
                   strt.species_and_occu,
                   strt.frac_coords,
                   miller_index=strt.miller_index,
                   oriented_unit_cell=strt.oriented_unit_cell,
                   shift=strt.shift,
                   scale_factor=strt.scale_factor,
                   validate_proximity=validate_proximity,
                   to_unit_cell=to_unit_cell,
                   coords_are_cartesian=coords_are_cartesian,
                   site_properties=strt.site_properties,
                   energy=strt.energy)
     self.strt = strt
     self.name = name
     self.hkl = hkl
     self.min_thick = min_thick
     self.supercell = supercell
     self.ligand = ligand
     self.slab = strt
     self.displacement = displacement
     self.solvent = solvent
     self.surface_coverage = surface_coverage
     self.adsorb_on_species = adsorb_on_species
     self.adatom_on_lig = adatom_on_lig
     self.scell_nmax = scell_nmax
     self.coverage_tol = coverage_tol
     self.x_shift = x_shift
     self.y_shift = y_shift
     self.rot = rot