本文整理汇总了Python中pylada.vasp.Vasp.lplane方法的典型用法代码示例。如果您正苦于以下问题:Python Vasp.lplane方法的具体用法?Python Vasp.lplane怎么用?Python Vasp.lplane使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pylada.vasp.Vasp
的用法示例。
在下文中一共展示了Vasp.lplane方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from pylada.vasp import Vasp [as 别名]
# 或者: from pylada.vasp.Vasp import lplane [as 别名]
def main():
from boost.mpi import world
from scipy.optimize import fmin as scipy_simplex
from pylada.vasp import Extract, ExtractGW, Vasp, Specie
from pylada.vasp.specie import nlep as nlep_parameters, U as u_parameters
from pylada.vasp.incar import Standard, NBands
from sys import exit
indir = "SnO2"
dft_in = Extract(directory=indir, comm=world)
dft_in.OUTCAR = "OUTCAR_pbe"
dft_in.CONTCAR = "POSCAR"
gw_in = ExtractGW(directory=indir, comm=world)
gw_in.OUTCAR = "OUTCAR_gw"
gw_in.CONTCAR = "POSCAR"
# Creates species with nlep parameters to optimize
species = Specie\
(
"Sn",
path="pseudos/Sn",
U=[nlep_parameters(type="Dudarev", l=i, U0=0e0) for i in ["s", "p", "d"]]
),\
Specie\
(
"O",
path="pseudos/O",
U=[nlep_parameters(type="Dudarev", l=i, U0=0e0) for i in ["s", "p"]]
)
# add U to Sn atoms.
species[0].U.append( u_parameters(type="Dudarev", U=2e0, l=2) )
# creates vasp launcher
vasp = Vasp\
(
kpoints = lambda x: "Automatic generation\n0\ngamma\n6 6 10\n0 0 0",
precision = "accurate",
smearing = "bloechl",
ediff = 1e-5,
relaxation = "ionic",
encut = 1, # uses ENMAX * 1, which is VASP default
species = species
)
# adds some extra parameters.
vasp.nbands = Standard("NBANDS", 64)
vasp.lorbit = Standard("LORBIT", 10)
vasp.npar = Standard("NPAR", 2)
vasp.lplane = Standard("LPLANE", ".TRUE.")
vasp.addgrid = Standard("ADDGRID", ".TRUE.")
del vasp.fftgrid
# creates objective function.
objective = Objective(vasp, dft_in, gw_in)
x0, f0, iter, funcalls, warnflag = scipy_simplex(objective, objective.x, maxfun=150, full_output=1, xtol=0.2)
world.barrier()
if world.rank == 0:
print "minimum value:", f0
print "for: ", x0 * units
print "after %i iterations and %i function calls." % (iter, funcalls)
print "with warning flag: ", warnflag
print final(x0)