用户工具

站点工具

本页面的其他翻译:
  • zh

adf:creatregioninpython

PLAMS中如何设置region

this can be done by adding the corresponding suffix to the atom properties. You could use the following snippet to append this functionality to the Molecule class. It can by called via

myMolecule.set_region({"region1": range(1,6), "region2": range(6, 12)})

or in cases where all atoms are assigned to the same region:

myMolecule.set_region("regionAll")
 
 
@add_to_class(Molecule)
def set_region(self, region):
if type(region) == dict:
for region_name, region_range in region.items():
for i in region_range:
self[i].properties.suffix = "Region="+region_name
elif type(region) == str:
for a in self:
a.properties.suffix = "Region="+region
adf/creatregioninpython.txt · 最后更改: 2022/09/05 17:01 由 liu.jun

© 2014-2022 费米科技(京ICP备14023855号