本文整理匯總了Python中structure.Structure.write_xyz方法的典型用法代碼示例。如果您正苦於以下問題:Python Structure.write_xyz方法的具體用法?Python Structure.write_xyz怎麽用?Python Structure.write_xyz使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類structure.Structure
的用法示例。
在下文中一共展示了Structure.write_xyz方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: make_movie
# 需要導入模塊: from structure import Structure [as 別名]
# 或者: from structure.Structure import write_xyz [as 別名]
def make_movie(self,filename,filepath=None):
if 'structures' in self:
from structure import Structure
if filepath==None:
filepath = os.path.join(self.abspath,filename)
else:
filepath = os.path.join(filepath,filename)
#end if
movie = ''
structures = self.structures
aA = convert(self.input.system['celldm(1)'],'B','A')
cell = self.input.cell_parameters.vectors
for i in range(len(structures)):
s = structures[i]
struct = Structure(elem=s.atoms,pos=s.positions,axes=cell,scale=aA,units='A')
struct=struct.tile(2,2,2)
ss=struct.write_xyz()
movie += ss
open(filepath,'w').write(movie)