Commit 2178ccd8 authored by Mikkel Strange's avatar Mikkel Strange
Browse files

test files of new gpw format (aff)

parent b639b34c
from ase.build import molecule
from gpaw import GPAW, PW, FermiDirac
from ase.constraints import FixAtoms
atoms = molecule('H2')
atoms.center(vacuum=2.0)
modes = [{'name': 'pw', 'ecut': 300}, 'fd', 'lcao']
for mode in modes:
calc = GPAW(mode=mode, txt='H2.txt', basis='dzp',spinpol=True,
occupations=FermiDirac(0.05))
atoms.calc = calc
atoms.set_constraint(FixAtoms(indices=[0]))
atoms.set_velocities([[1.0,0.0,0.0],[2.0,3.0,4.0]])
atoms.get_potential_energy()
atoms.get_forces()
if isinstance(mode, basestring):
mode = {'name': mode}
print(mode)
calc.write('H2_' + mode['name'] + '.gpw2')
from ase.build import bulk
from gpaw import GPAW, PW, FermiDirac
a = 5.43
si = bulk('Si', 'diamond', a)
modes = [{'name': 'pw', 'ecut': 300}, 'fd', 'lcao']
for mode in modes:
calc = GPAW(mode=mode, kpts=(4, 4,4), txt='Si.txt', basis='dzp')
si.calc = calc
si.get_potential_energy()
if isinstance(mode, basestring):
mode = {'name': mode}
print(mode)
calc.write('Si_' + mode['name'] + '.gpw2')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment