Ejemplo n.º 1
0
# !!! NOTE !!!
# This script DOES NOT automatically start running
# the batch scripts. It only generates the input files
# and batch scripts which the user runs by themselves
# !!! NOTE !!!

import pyemto
import os
import numpy as np

# It is recommended to always use absolute paths
folder = os.getcwd()  # Get current working directory.
latpath = "/wrk/hpleva/structures"  # Folder where the structure output files are.
emtopath = folder + "/cocrfemnni_fcc"  # Folder where the calculations will be performed.

cocrfemnni = pyemto.System(folder=emtopath)

sws = np.linspace(2.50, 2.70,
                  11)  # 11 different volumes from 2.5 Bohr to 2.7 Bohr

# Set KGRN and KFCD values using a for loop.
# Use write_input_file functions to write input files to disk:

for i in range(len(sws)):
    cocrfemnni.bulk(
        lat='fcc',
        jobname='cocrfemnni',
        latpath=latpath,
        atoms=['Co', 'Co', 'Cr', 'Cr', 'Fe', 'Fe', 'Mn', 'Mn', 'Ni', 'Ni'],
        splts=[-1.0, 1.0, -1.0, 1.0, -1.0, 1.0, -1.0, 1.0, -1.0, 1.0],
        sws=sws[i],
Ejemplo n.º 2
0
#which_mode = 'analyze'

folder = os.getcwd()  # Get current working directory.
emtopath = folder + "/ti_hcp"  # Folder where the calculation take place.
latpath = emtopath  # Folder where the structure files are located.

ncpu = 16
slurm_options = [
    '#SBATCH -n {0}'.format(ncpu), '#SBATCH --ntasks-per-node=4',
    '##SBATCH --qos=short', 'ulimit -s unlimited',
    'module load compiler/intel/16 intel-mkl/16 openmpi/2.0',
    'export OMP_NUM_THREADS=${SLURM_NTASKS_PER_NODE}',
    'export OMP_STACKSIZE=400m'
]

ti_hcp = pyemto.System(
    folder=emtopath, EMTOdir='/home/minds/jianwang/vasptool/EMTO/5.8.1/build')

# Initialize the bulk system using the bulk() function:
ti_hcp.bulk(
    lat='hcp',
    latpath=latpath,
    atoms=['Ti'],
    sws=3.0,
    amix=0.02,
    efmix=0.9,
    #expan='M',
    sofc='Y',
    xc='P07',  # Use PBEsol
    nky=31,  # k-points
    nkz=19,  # k-points
    runtime='24:00:00',  # Allow large enough timelimit for SLURM
Ejemplo n.º 3
0
#!/usr/bin/python

# Test the functionality of the Bmdl, Kstr and Shape classes

import pyemto
import os
import numpy as np

# It is recommended to use absolute paths
folder = os.getcwd()
latpath = folder
emtopath = folder

structure = pyemto.System(folder=emtopath)

# Create BMDL, KSTR and SHAPE files and run them

#deltas = np.linspace(0.0,0.05,6)

structure.lattice.set_values(latpath=latpath,
                             kappaw=[0.0, -20.0])  # Double Taylor-expansion

#dmaxs = [2.52,2.49,2.455,2.43,2.4,2.4] # Orthorhombic distortion for c/a = 1.603
#dmaxs = [2.51,2.51,2.51,2.49,2.51,2.49] # Monoclinic distortion for c/a = 1.603

#jobnames = ['bcco0','bcco1','bcco2','bcco3','bcco4','bcco5'] # bcc ortho
#jobnames = ['bccm0','bccm1','bccm2','bccm3','bccm4','bccm5'] # bcc mono

#jobnames = ['fcco0','fcco1','fcco2','fcco3','fcco4','fcco5'] # fcc ortho
#jobnames = ['fccm0','fccm1','fccm2','fccm3','fccm4','fccm5'] # fcc mono
Ejemplo n.º 4
0
        if not os.path.lexists(apath):
            os.makedirs(apath)

        # Construct base jobname
        jobname = ""

        for i in range(len(nlist)):
            if jobname == "":
                pass
            else:
                jobname = jobname + "_"
            jobname = jobname + nlist[i].lower() + "%4.2f" % (clist[i])
        finalname = jobname + "_final"

        # BCC first
        alloy = pyemto.System(folder=apath)
        initialsws = initial_sws[0]  # We need some clever way to get this
        alloy.bulk(lat='bcc',
                   jobname=jobname + "_bcc",
                   atoms=s,
                   concs=c,
                   latpath=latpath,
                   sws=initialsws,
                   xc='PBE')
        swsrange = np.linspace(initialsws - 0.1, initialsws + 0.1,
                               7)  # A list of 7 different volumes
        #alloy.lattice_constants_batch_generate(sws=swsrange)
        sws0, B0, e0 = alloy.lattice_constants_analyze(sws=swsrange, prn=False)
        sc_res.append([e0, B0, sws0])
        alloy.bulk(lat='bcc',
                   jobname=finalname + "_bcc",
Ejemplo n.º 5
0
            # Copy QNA parameter file to each folder
            os.system("cp ./QNA_database.dat {0}".format(apath))

            # Construct base jobname
            jobname = ""

            for i in range(len(nlist)):
                if jobname == "":
                    pass
                else:
                    jobname = jobname + "_"
                jobname = jobname + nlist[i].lower() + "%4.2f" % (clist[i])

            # BCC first
            alloy = pyemto.System(folder=apath, EMTOdir=EMTOdir)
            initialsws = initial_sws[0]
            alloy.bulk(lat='bcc',
                       jobname=jobname + "_bcc",
                       latpath=latpath,
                       msgl=0,
                       sws=initialsws,
                       atoms=s,
                       concs=c,
                       splts=split,
                       afm=afm,
                       amix=0.02,
                       efmix=0.9,
                       expan='M',
                       sofc='Y',
                       xc='PBE',
Ejemplo n.º 6
0
Archivo: fe.py Proyecto: hpleva/pyemto
#!/usr/bin/python

# An example script of how to automatically
# calculate the equilibrium volume and
# bulk modulus of bulk bcc Fe using pyEMTO.

import os
import pyemto

emtopath = os.getcwd(
) + "/fe"  # Define a folder for our KGRN and KFCD input and output files.
latpath = os.getcwd(
) + "/fe"  # Define a folder where the BMDL, KSTR and KFCD input and output files
# will be located.

fe = pyemto.System(
    folder=emtopath)  # Create a new instance of the pyemto System-class.

# Let's calculate the equilibrium volume and bulk modulus of Fe.

# Initialize the system using the bulk.() function:

fe.bulk(
    lat='bcc',  # We want to use the bcc structure.
    latpath=latpath,  # Path to the folder where the structure files are located.
    afm='F',  # We want to do a ferromagnetic calculation.
    atoms=['Fe'],  # A list of atoms.
    splts=[2.0],  # A list of magnetic splittings.
    expan='M',  # We want to use the double-Taylor expansion.
    sofc='Y',  # We want to use soft-core approximation.
    xc='PBE',  # We want to use the PBE functional.
    amix=0.05,  # Density mixing.