コード例 #1
0
def si(cmd=None):
    cwd = os.getcwd()
    if cmd == None:
        cmd = os.path.join(cwd, 'lmp_serial')
    os.environ['LAMMPS_COMMAND'] = cmd
    os.chdir(os.path.dirname(os.path.abspath(__file__)))
    parameters = {
        'pair_style': 'meam',
        'pair_coeff': ['* * library.meam Si Si.meam Si']
    }
    files = ['library.meam', 'Si.meam']
    calc = LAMMPS(parameters=parameters, files=files)
    os.chdir(cwd)
    return calc
コード例 #2
0
print "struct: ", struct
print "lp: ", lp
if struct == 'hcp':
    print "catoi: ", catoi
print "ecoh: ", esub
print "surf: ", surf
print "size: ", mysize
print "vacuum: ", vac

import model
from model import pick_elements
species = [el1]
pick_elements(model, species)

from ase.calculators.lammps import LAMMPS
calc = LAMMPS(parameters=model.parameters, files=model.files)

from ase.lattice.surface import *

if surf == "10m10":
    myorth = True
else:
    myorth = False

if el1 != 'Mg':
    atoms = surface(el1,
                    struct,
                    surf,
                    size=mysize,
                    a=lp,
                    c=None,
コード例 #3
0
ファイル: GB-Fe100.py プロジェクト: swangi/Cook-GB
while Sigma % 2 == 0:
    Sigma = Sigma / 2
DSC = (GB_cor_up[1, 0] ** 2 + GB_cor_up[1, 1] ** 2 + GB_cor_up[1, 2] ** 2)

xinc = 1. / grid_x / DSC
zinc = 1. / grid_z
overlapdist = np.arange(0.275, 0.705, 0.005) * a0
lable = 'S%d_%d%d%d_' % (Sigma, GB_plane[0], GB_plane[1], GB_plane[2])
traj_name = 'Fe_GB_' + lable
el1 = "Fe"
el2 = "H"
species = [el1, el2]
import potpara
print potpara.parameters
#, keep_tmp_files=False)
lammps_cal = LAMMPS(
    parameters=potpara.parameters, specorder=species, tmp_dir=tmp_dir)
mm_pot = Potential(calculator=lammps_cal)
f = open('GB_result_S%d_%d%d%d_.txt' %
         (Sigma, GB_plane[0], GB_plane[1], GB_plane[2]), 'w')
f.write('%s %s %s %s %s %s %s %s %s %s\n' %
       ('Angle', 'Count', 'del_cri', 'RBT_X', 'RBT_Z', 'Bulk_pe_GB', 'N_atoms', 'Surface_e', 'GB_e', 'GB_coh_e'))
f.close()
# create unit cell for GB#################
unit_GB_up = create_unit_GB(GB_cor_up, a0)
unit_GB_down = create_unit_GB(GB_cor_down, a0)
# view(unit_GB)
unit_GB_up = Atoms(unit_GB_up, fortran_indexing=False)
unit_GB_up.set_calculator(mm_pot)
print('Minimising GB_up unit cell...')
potpara.parameters["fix"] = "relax all box/relax y 0 vmax 0.001"
potpara.parameters["minimize"] = "%s %s 10000 10000" % (eng_tol, force_tol)
コード例 #4
0
    if argc < 4:
        print 'usage:', sys.argv[0], 'Mg hcp octa/tetr/dump lp catoi'
        sys.exit(1)
    else:
        catoi = float(sys.argv[4])

species = [el1]
import model
from model import pick_elements

pick_elements(model, species)

from ase.calculators.lammps import LAMMPS

calc = LAMMPS(parameters=model.parameters,
              files=model.files,
              specorder=species)

if str == "fcc":
    from ase.lattice.cubic import FaceCenteredCubic
    atoms = FaceCenteredCubic(symbol=el1, latticeconstant=lp, size=(5, 5, 5))
elif str == "bcc":
    from ase.lattice.cubic import BodyCenteredCubic
    atoms = BodyCenteredCubic(symbol=el1, latticeconstant=lp, size=(5, 5, 5))
elif str == "dia":
    from ase.lattice.cubic import Diamond
    atoms = Diamond(symbol=el1, latticeconstant=lp, size=(3, 3, 3))
elif str == "hcp":
    from math import sqrt
    a = lp
    b = sqrt(3.) * lp