コード例 #1
0
 def calculate(self, name, atoms):
     data = DeltaCodesDFTTask.calculate(self, name, atoms)
     try:
         steps = atoms.get_calculator().get_number_of_iterations()
     except (AttributeError, NotImplemented):
         steps = None
     data['calculator steps'] = steps
     return data
コード例 #2
0
            'ecut':ecut,
            'xc':'PBE',
            'pps':'fhi',
            'nstep':700,
            'diemac': 1000,
            'width':w,
            'kpts':kd,
            'chksymbreak':0,
            'ecutsm':0.05,
            'nsym':1,
}

calcfactory = Factory(Abinit, 'Abinit', 'label', **calcopts)

taskopts = {}

task = Task(
    calcfactory=calcfactory,
    tag=tag,
    fit=fit,
    use_lock_files=True,
    **taskopts)

if __name__ == '__main__':
    keys = task.collection.names
    for m in ['Mn']:
        keys.remove(m)  # EOS fails: reason unknown
    # run just only system to check if scripts work
    #task.run(keys)
    task.run(['Si'])
コード例 #3
0
 def __init__(self, **kwargs):
     DeltaCodesDFTTask.__init__(self, **kwargs)
コード例 #4
0
ファイル: pbe_gpaw_pw.py プロジェクト: eojons/gpaw-scme
fit = (5, 0.02)

w = 0.06

ecut = 1200
kd = 8.0

tag = 'dcdft_%s_gpaw_pw' % xc.lower()

task = Task(
    calcfactory=Factory(xc=xc,
                        mode=PW(ecut),
                        occupations=FermiDirac(w),
                        maxiter=250,
                        kptdensity=kd,
                        ),
    tag=tag,
    fit=fit,
    use_lock_files=True,
    )

if __name__ == '__main__':
    if element is None:
        keys = set(parameters.keys()).intersection(set(task.collection.names))
        for s in elements_slow:
            keys.remove(s)  # those are slow, run separately
    else:
        keys = [element]
    task.run(keys)
コード例 #5
0
        return calculator


calcopts = {
    "toldfe": 1.0e-7,
    "ecut": ecut,
    "xc": "PBE",
    "pps": "fhi",
    "nstep": 700,
    "diemac": 1000,
    "width": w,
    "kpts": kd,
    "chksymbreak": 0,
    "ecutsm": 0.05,
    "nsym": 1,
}

calcfactory = Factory(Abinit, "Abinit", "label", **calcopts)

taskopts = {}

task = Task(calcfactory=calcfactory, tag=tag, fit=fit, use_lock_files=True, **taskopts)

if __name__ == "__main__":
    keys = task.collection.names
    for m in ["Mn"]:
        keys.remove(m)  # EOS fails: reason unknown
    # run just only system to check if scripts work
    # task.run(keys)
    task.run(["Si"])
コード例 #6
0
        z = zipfile.ZipFile(name)
        try:  # new in 2.6
            z.extractall()
        except AttributeError:
            # http://stackoverflow.com/questions/7806563/how-to-unzip-a-zip-file-with-python-2-4
            for f in z.namelist():
                fd = open(f, "w")
                fd.write(z.read(f))
                fd.close()
        # AttributeError if unzip not found
    except (urllib2.HTTPError, AttributeError):
        raise NotAvailable('Retrieval of zip failed')
os.chdir('..')

task = Task(
    tag=tag,
    use_lock_files=True,
    )

# header
h = ['#element', 'V0', 'B0', 'B1']

if not os.path.exists('%s_raw.csv' % tag):
    # read calculated results from json file and write into csv
    task.read()
    task.analyse()

    f1 = open('%s_raw.csv' % tag, 'wb')
    csvwriter1 = csv.writer(f1)
    csvwriter1.writerow(h)

    for n in task.collection.names:
コード例 #7
0
                                 #'occupation':0.001, # 0.001
                                 #'maxsteps':None,
                                 #'maxtime':None
                                 #},
                                 ft=w,
                                 symmetry=True,
                                 spinpol=True, # must set explicitly
                                 calculate_stress=False,
                                 deletenc=True,  # start fresh every time
                                 kptdensity=kd,
                                 )

taskopts = {}

task = Task(
    calcfactory=calcfactory,
    tag=tag,
    fit=fit,
    use_lock_files=True,
    **taskopts)

if __name__ == '__main__':
    keys = set(psp.keys()).intersection(set(task.collection.names))
    for m in ['Be', 'Cr', 'Kr', 'Xe']:
        keys.remove(m)  # EOS fails: maybe need higher ecut?
    for m in ['Zn', 'Zr']:
        keys.remove(m)  # do not converge
    # run just only system to check if scripts work
    keys = ['Si']
    task.run(keys)
コード例 #8
0
        z = zipfile.ZipFile(name)
        try:  # new in 2.6
            z.extractall()
        except AttributeError:
            # http://stackoverflow.com/questions/7806563/how-to-unzip-a-zip-file-with-python-2-4
            for f in z.namelist():
                fd = open(f, "w")
                fd.write(z.read(f))
                fd.close()
        # AttributeError if unzip not found
    except (urllib.error.HTTPError, AttributeError):
        raise NotAvailable('Retrieval of zip failed')
os.chdir('..')

task = Task(
    tag=tag,
    use_lock_files=True,
)

# header
h = ['#element', 'V0', 'B0', 'B1']

if not os.path.exists('%s_raw.csv' % tag):
    # read calculated results from json file and write into csv
    task.read()
    task.analyse()

    f1 = open('%s_raw.csv' % tag, 'wb')
    csvwriter1 = csv.writer(f1)
    csvwriter1.writerow(h)

    for n in task.collection.names:
コード例 #9
0
ファイル: dcdft_pbe_pw.py プロジェクト: robwarm/gpaw-symm
 def __init__(self, inititer=0, **kwargs):
     DeltaCodesDFTTask.__init__(self, **kwargs)
     self.inititer = inititer
コード例 #10
0
 def __init__(self, inititer=0, **kwargs):
     DeltaCodesDFTTask.__init__(self, **kwargs)
     self.inititer = inititer