本文整理汇总了Python中abipy.core.structure.Structure.rocksalt方法的典型用法代码示例。如果您正苦于以下问题:Python Structure.rocksalt方法的具体用法?Python Structure.rocksalt怎么用?Python Structure.rocksalt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类abipy.core.structure.Structure
的用法示例。
在下文中一共展示了Structure.rocksalt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: build_structure
# 需要导入模块: from abipy.core.structure import Structure [as 别名]
# 或者: from abipy.core.structure.Structure import rocksalt [as 别名]
def build_structure(self, ref="ae"):
"""
Returns the crystalline structure associated to this entry.
Use the optimized lattice parameters obtained from reference ref.
Returns None if no lattice parameter is available.
"""
# Get structure type and lattice parameters
stype, a = self.struct_type, getattr(self, ref)
# Handle missing value.
if a is None:
return None
if stype == "bcc":
return Structure.bcc(a, species=[self.symbol])
elif stype == "fcc":
return Structure.fcc(a, species=[self.symbol])
elif stype == "rocksalt":
return Structure.rocksalt(a, self.species)
elif stype == "ABO3":
return Structure.ABO3(a, self.species)
elif stype == "hH":
raise NotImplementedError()
#return Structure.hH(a, sites)
raise ValueError("Don't know how to construct %s structure" % stype)
示例2: work_for_pseudo
# 需要导入模块: from abipy.core.structure import Structure [as 别名]
# 或者: from abipy.core.structure.Structure import rocksalt [as 别名]
def work_for_pseudo(self, pseudo, ecut_list, pawecutdg=None, ngkpt=(8, 8, 8),
include_soc=False, workdir=None, manager=None):
"""
Returns a :class:`Work` object from the given pseudopotential.
Args:
pseudo: :class:`Pseudo` object.
ecut_list: List of cutoff energies in Hartree
pawecutdg: Cutoff energy of the fine grid (PAW only)
include_soc: True to include SOC.
workdir: Working directory.
manager: :class:`TaskManager` object.
"""
if pseudo.ispaw and pawecutdg is None:
raise ValueError("pawecutdg must be specified for PAW calculations.")
if pseudo.xc != self.xc:
raise ValueError(
"Pseudo xc differs from the XC used to instantiate the factory\n"
"Pseudo: %s, Factory: %s" % (pseudo.xc, self.xc))
if not ecut_list:
return None
# Build rocksalt structure.
db = raren_database(pseudo.xc)
a = db.table["ref"][pseudo.symbol]
species = [pseudo.symbol, "N"]
structure = Structure.rocksalt(a, species)
n_pseudo = db.get_n_pseudo(pseudo)
# Build input template.
template = abilab.AbinitInput(structure, pseudos=[pseudo, n_pseudo])
# Input for EuN Rocksalt
template.set_vars(
occopt=7,
tsmear=0.001,
ecutsm=0.5,
#kptopt=1,
ngkpt=ngkpt,
nshiftk=4,
shiftk=[0.0, 0.0, 0.5,
0.0, 0.5, 0.0,
0.5, 0.0, 0.0,
0.5, 0.5, 0.5],
fband=2,
nstep=60,
ionmov=2,
optcell=1,
dilatmx=1.14,
tolvrs=1.0E-16,
tolmxf=1.0E-06,
ntime=50,
prtden=0,
prteig=0,
prtwf=-1,
)
work = RocksaltRelaxationWork()
work._pseudo = pseudo
for ecut in ecut_list:
task = RelaxTask(template.new_with_vars(ecut=ecut))
#print(task.input)
work.register(task)
work.include_soc = include_soc
return work