本文整理汇总了Python中pymatgen.matproj.snl.StructureNL.data["_kpoints_density"]方法的典型用法代码示例。如果您正苦于以下问题:Python StructureNL.data["_kpoints_density"]方法的具体用法?Python StructureNL.data["_kpoints_density"]怎么用?Python StructureNL.data["_kpoints_density"]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pymatgen.matproj.snl.StructureNL
的用法示例。
在下文中一共展示了StructureNL.data["_kpoints_density"]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run_task
# 需要导入模块: from pymatgen.matproj.snl import StructureNL [as 别名]
# 或者: from pymatgen.matproj.snl.StructureNL import data["_kpoints_density"] [as 别名]
def run_task(self, fw_spec):
# Read structure from previous relaxation
relaxed_struct = fw_spec['output']['crystal']
# Generate deformed structures
d_struct_set = DeformedStructureSet(relaxed_struct, ns=0.06)
wf=[]
for i, d_struct in enumerate(d_struct_set.def_structs):
fws=[]
connections={}
f = Composition(d_struct.formula).alphabetical_formula
snl = StructureNL(d_struct, 'Joseph Montoya <[email protected]>',
projects=["Elasticity"])
if fw_spec["mpsnl"].data.get("_kpoints_density", None):
snl.data["_kpoints_density"] = fw_spec["mpsnl"].data.get("_kpoints_density")
kpoints_density = snl.data["_kpoints_density"]
else:
kpoints_density = None
tasks = [AddSNLTask()]
snl_priority = fw_spec.get('priority', 1)
spec = {'task_type': 'Add Deformed Struct to SNL database',
'snl': snl.as_dict(),
'_queueadapter': QA_DB,
'_priority': snl_priority}
if 'snlgroup_id' in fw_spec and isinstance(snl, MPStructureNL):
spec['force_mpsnl'] = snl.as_dict()
spec['force_snlgroup_id'] = fw_spec['snlgroup_id']
del spec['snl']
fws.append(Firework(tasks, spec,
name=get_slug(f + '--' + spec['task_type']),
fw_id=-1000+i*10))
connections[-1000+i*10] = [-999+i*10]
spec = snl_to_wf._snl_to_spec(snl,
parameters={'exact_structure':True})
spec = update_spec_force_convergence(spec, kpoints_density=kpoints_density)
spec['deformation_matrix'] = d_struct_set.deformations[i].tolist()
spec['original_task_id'] = fw_spec["task_id"]
spec['_priority'] = fw_spec['_priority']*2
#Turn off dupefinder for deformed structure
del spec['_dupefinder']
spec['task_type'] = "Optimize deformed structure"
fws.append(Firework([VaspWriterTask(), SetupElastConstTask(),
get_custodian_task(spec)],
spec,
name=get_slug(f + '--' + spec['task_type']),
fw_id=-999+i*10))
priority = fw_spec['_priority']*3
spec = {'task_type': 'VASP db insertion',
'_priority': priority,
'_allow_fizzled_parents': True,
'_queueadapter': QA_DB,
'elastic_constant':"deformed_structure",
'clean_task_doc':True,
'deformation_matrix':d_struct_set.deformations[i].tolist(),
'original_task_id':fw_spec["task_id"]}
fws.append(Firework([VaspToDBTask(), AddElasticDataToDBTask()], spec,
name=get_slug(f + '--' + spec['task_type']),
fw_id=-998+i*10))
connections[-999+i*10] = [-998+i*10]
wf.append(Workflow(fws, connections))
return FWAction(additions=wf)