本文整理汇总了Python中abipy.core.structure.Structure.fcc方法的典型用法代码示例。如果您正苦于以下问题:Python Structure.fcc方法的具体用法?Python Structure.fcc怎么用?Python Structure.fcc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类abipy.core.structure.Structure
的用法示例。
在下文中一共展示了Structure.fcc方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: build_structure
# 需要导入模块: from abipy.core.structure import Structure [as 别名]
# 或者: from abipy.core.structure.Structure import fcc [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: __init__
# 需要导入模块: from abipy.core.structure import Structure [as 别名]
# 或者: from abipy.core.structure.Structure import fcc [as 别名]
def __init__(self, a_guess, struct_type, pseudo, ecut_list=None, pawecutdg=None, ngkpt=(8, 8, 8),
spin_mode="unpolarized", include_soc=False, tolvrs=1.e-10, smearing="fermi_dirac:0.001 Ha",
ecutsm=0.05, chksymbreak=0, workdir=None, manager=None):
"""
Build a :class:`Work` for the computation of the relaxed lattice parameter.
Args:
structure_type: fcc, bcc
pseudo: :class:`Pseudo` object.
ecut_list: Cutoff energy in Hartree
ngkpt: MP divisions.
spin_mode: Spin polarization mode.
toldfe: Tolerance on the energy (Ha)
smearing: Smearing technique.
workdir: String specifing the working directory.
manager: :class:`TaskManager` responsible for the submission of the tasks.
"""
super(RelaxWithGbrvParamsWork, self).__init__(workdir=workdir, manager=manager)
self_pseudo = pseudo
self.include_soc = include_soc
self.struct_type = struct_type
if struct_type == "bcc":
structure = Structure.bcc(a_guess, species=[pseudo.symbol])
elif struct_type == "fcc":
structure = Structure.fcc(a_guess, species=[pseudo.symbol])
# Set extra_abivars.
extra_abivars = dict(
pawecutdg=pawecutdg,
tolvrs=tolvrs,
prtwf=-1,
fband=3.0,
nstep=100,
ntime=50,
ecutsm=ecutsm,
dilatmx=1.1,
)
self.ecut_list = ecut_list
smearing = Smearing.as_smearing(smearing)
# Kpoint sampling: shiftk depends on struct_type
shiftk = {"fcc": [0, 0, 0], "bcc": [0.5, 0.5, 0.5]}.get(struct_type)
spin_mode = SpinMode.as_spinmode(spin_mode)
ksampling = KSampling.monkhorst(ngkpt, chksymbreak=chksymbreak, shiftk=shiftk,
use_time_reversal=spin_mode.nspinor==1)
relax_algo = RelaxationMethod.atoms_and_cell()
inp = abilab.AbinitInput(structure, pseudo)
inp.add_abiobjects(ksampling, relax_algo, spin_mode, smearing)
inp.set_vars(extra_abivars)
# Register structure relaxation task.
for ecut in self.ecut_list:
self.relax_task = self.register_relax_task(inp.new_with_vars(ecut=ecut))