コード例 #1
0
def get_surface_restart_indiv(Optimizer, indiv):
    """
    Function to generate an structopt Individual class object containing 
        a surface structure from a previously existing structure
    Inputs:
        Optimizer = structopt Optimizer class
        indiv = ASE Atoms object containing the previously existing structure
    Outputs:
        individ = structopt Individual class object containing surface structure data
    """
    #Load surface structure
    surfs = read_xyz(Optimizer.surfacefile)
    cells = Optimizer.surfacecell
    surfs.set_cell(cells)
    surf.set_pbc([True,True,False])
    top,bulks=find_top_layer(indiv,Optimizer.surftopthick)
    individ=Individual(top)
    individ.bulki=bulks.copy()
    individ.bulko=bulks.copy()
    return individ
コード例 #2
0
def get_surface_indiv(Optimizer):
    """
    Function to generate an structopt Individual class object containing as surface structure.
    Inputs:
        Optimizer = structopt Optimizer class
    Outputs:
        individ = structopt Individual class object containing surface structure data
    """
    #Load surface structure
    surfs = read_xyz(Optimizer.surfacefile)
    cells = Optimizer.surfacecell
    surfs.set_cell(cells)
    surf.set_pbc([True, True, False])
    #Find top layer
    top, bulks = find_top_layer(surfs, Optimizer.surftopthick)
    mutopto = Optimizer.mutation_options
    Optimizer.mutation_options = ['lattice_alteration_rdrd']
    topind = top.copy()
    ind = moves_switch(topind, Optimizer)
    Optimizer.mutation_options = mutopto
    individ = Individual(ind)
    individ.bulki = bulks.copy()
    individ.bulko = bulks.copy()
    return individ
コード例 #3
0
ファイル: get_surface_indiv.py プロジェクト: uw-cmg/MAST
def get_surface_indiv(Optimizer):
    """
    Function to generate an structopt Individual class object containing as surface structure.
    Inputs:
        Optimizer = structopt Optimizer class
    Outputs:
        individ = structopt Individual class object containing surface structure data
    """
    #Load surface structure
    surfs = read_xyz(Optimizer.surfacefile)
    cells = Optimizer.surfacecell
    surfs.set_cell(cells)
    surf.set_pbc([True,True,False])
    #Find top layer
    top,bulks=find_top_layer(surfs,Optimizer.surftopthick)
    mutopto = Optimizer.mutation_options
    Optimizer.mutation_options = ['lattice_alteration_rdrd']
    topind = top.copy()
    ind = moves_switch(topind,Optimizer)
    Optimizer.mutation_options = mutopto
    individ = Individual(ind)
    individ.bulki = bulks.copy()
    individ.bulko = bulks.copy()
    return individ