Exemplo n.º 1
0
         nsw=30,
         ediff=1e-8,
         ibrion=2,
         kpts=[3, 3, 3])

# Set the calculation mode first.
# Full structure optimization in this case.
# Not all calculators have this type of internal minimizer!
calc.set(isif=3)

print("Running initial optimization ... ", end=' ')
print("Residual pressure: %.3f bar" %
      (cryst.get_isotropic_pressure(cryst.get_stress())))

# Clean up the directory
calc.clean()

# Switch to cell IDOF optimizer
calc.set(isif=2)

# Elastic tensor by internal routine
Cij, Bij = cryst.get_elastic_tensor(n=5, d=0.2)
print("Cij (GPa):", Cij / units.GPa)

# Now let us do it (only c11 and c12) by hand
# with 3rd order polynomial fitting the points.
sys = []
for d in linspace(-0.2, 0.2, 10):
    sys.append(cryst.get_cart_deformed_cell(axis=0, size=d))
r = ParCalculate(sys, cryst.calc)
ss = []
Exemplo n.º 2
0
MgO = crystal(['Mg', 'O'], [(0, 0, 0), (0.5, 0.5, 0.5)], spacegroup=225,
               cellpar=[a, a, a, 90, 90, 90])

##################################
# Provide your own calculator here
##################################
calc=ClusterVasp(nodes=1,ppn=8)
# The calculator must be runnable in an isolated directory
# Without disturbing other running instances of the same calculator
# They are run in separate processes (not threads!)

MgO.set_calculator(calc)
calc.set(prec = 'Accurate', xc = 'PBE', lreal = False, isif=2, nsw=20, ibrion=2, kpts=[1,1,1])

print("Residual pressure: %.3f GPa" % (MgO.get_pressure()/GPa))
calc.clean()

banner('Volume scan on MgO (+/- 5%)')

systems=[]
for av in numpy.linspace(a*0.95,a*1.05,5):
    systems.append(crystal(['Mg', 'O'], [(0, 0, 0), (0.5, 0.5, 0.5)], spacegroup=225,
               cellpar=[av, av, av, 90, 90, 90]))

pcalc=ClusterVasp(nodes=1,ppn=8)
pcalc.set(prec = 'Accurate', xc = 'PBE', lreal = False, isif=2, nsw=20, ibrion=2, kpts=[1,1,1])
res=ParCalculate(systems,pcalc)

v=[]
p=[]
for s in res :