| 查看: 2400 | 回复: 3 | |||
| 【有奖交流】积极回复本帖子,参与交流,就有机会分得作者 cnzs 的 7 个金币 ,回帖就立即获得 1 个金币,每人有 1 次机会 | |||
| 当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖 | |||
[交流]
VASP数据使用ovito官网脚本分析voronio
|
|||
|
1.能不能用ovito处理AIMD的XDATCAR文件? 2.如果可以为什么我用官网提供的Python脚本只能得出第一个离子步的数据? 3.有没有大佬可以帮忙改进一下Python脚本? # Import OVITO modules. from ovito.io import * from ovito.modifiers import * from ovito.pipeline import * # Import NumPy module. import numpy # Load a simulation snapshot of a Cu-Zr metallic glass. pipeline = import_file("D:/ovito/400/XDATCAR",multiple_frames = True) # Set atomic radii (required for polydisperse Voronoi tessellation). atom_types = pipeline.source.data.particles['Particle Type'].types atom_types[0].radius = 1.28 # atomic radius (atom type 1 in input file) atom_types[1].radius = 1.55 # atomic radius (atom type 2 in input file) # Set up the Voronoi analysis modifier. voro = VoronoiAnalysisModifier( compute_indices = True, use_radii = True, edge_threshold = 0.1 ) pipeline.modifiers.append(voro) # Let OVITO compute the results. data = pipeline.compute() # Access computed Voronoi indices. # This is an (N) x (M) array, where M is the maximum face order. voro_indices = data.particles['Voronoi Index'] # This helper function takes a two-dimensional array and computes a frequency # histogram of the data rows using some NumPy magic. # It returns two arrays (of equal length): # 1. The list of unique data rows from the input array # 2. The number of occurences of each unique row # Both arrays are sorted in descending order such that the most frequent rows # are listed first. def row_histogram(a): ca = numpy.ascontiguousarray(a).view([('', a.dtype)] * a.shape[1]) unique, indices, inverse = numpy.unique(ca, return_index=True, return_inverse=True) counts = numpy.bincount(inverse) sort_indices = numpy.argsort(counts)[::-1] return (a[indices[sort_indices]], counts[sort_indices]) # Compute frequency histogram. unique_indices, counts = row_histogram(voro_indices) # Print the ten most frequent histogram entries. for i in range(10): print("%s\t%i\t(%.1f %%)" % (tuple(unique_indices), counts, 100.0*float(counts)/len(voro_indices))) result: (0, 0, 0, 2, 8, 4, 0, 0) 11 (5.5 %) (0, 0, 0, 3, 6, 4, 0, 0) 7 (3.5 %) (0, 0, 0, 0, 12, 0, 0, 0) 6 (3.0 %) (0, 0, 0, 1, 10, 3, 0, 0) 5 (2.5 %) (0, 0, 0, 2, 8, 1, 0, 0) 5 (2.5 %) (0, 0, 0, 4, 6, 4, 0, 0) 5 (2.5 %) (0, 0, 0, 2, 8, 5, 0, 0) 5 (2.5 %) (0, 0, 0, 1, 10, 2, 0, 0) 5 (2.5 %) (0, 0, 0, 2, 8, 0, 0, 0) 4 (2.0 %) (0, 0, 0, 4, 4, 6, 0, 0) 3 (1.5 %) |
» 猜你喜欢
帮我的英语口语老师找学生
已经有4人回复
计算三阶力常数用thirdorder扩胞时参数如何选择?临近原子数怎么取值
已经有7人回复
物理学I论文润色/翻译怎么收费?
已经有79人回复
2026年循环经济功能材料国际会议(ICFMCE 2026)
已经有0人回复
2026年第五届电气、电子与信息工程国际会议(ISEEIE 2026)
已经有0人回复
哈尔滨理工大学物理系招收物理学考研调剂
已经有3人回复
0702一志愿吉大B区求调剂
已经有5人回复
求调剂
已经有0人回复
0702一志愿吉大B区求调剂有论文
已经有0人回复
请问还有没有用Latex写文章的小伙伴们?
已经有0人回复
» 抢金币啦!回帖就可以得到:
招收苏州国家实验室和苏州大学联合培养博士(2026年9月入学)
+1/83
有机化- 陆红健课题组诚招2026级、2027级博士研究生及博士后
+1/80
东营诚征结婚对象
+1/71
2026年重庆工商大学管理科学与工程专业学术硕士招生调剂,风景总在柳暗花明处
+1/40
生殖医学与子代健康全国重点实验室遗传学课题组招收研究生(长期有效)
+1/36
青岛科技大学高分子学院李明杰老师招收高分子材料方向硕博士研究生,欢迎联系!
+1/34
纺织科学与工程、材料化工方向招收研究生
+1/34
【沈阳农业大学机械专硕调剂】
+2/30
招博士,申请考核制,环境化学、理论计算、环境毒理/健康方向
+1/15
中国科学院苏州纳米所院士团队博士后岗位招聘
+1/15
中国科学院过程工程研究所院士团队诚聘博士后,高分子等方向。
+1/12
重庆大学诚招2026年生物材料方向博士生
+1/5
英国兰卡斯特大学(Lancaster University)大模型、计算机视觉PhD招生
+1/4
湖南大学2026博士招生-人工智能安全方向
+1/3
徐工-环境工程学院-招收调剂硕士
+1/1
五邑大学环境与化学化工学院欢迎化学、化工、材料背景考生报考
+1/1
矿业工程招收硕士研究生
+1/1
中科院天津工业生物技术所与哈尔滨工业大学联合博士招生2026
+1/1
材料294求调剂
+1/1
北京高校副校长团队招收机械类,环境类学硕和专硕
+1/1
4楼2022-06-22 14:07:45
简单回复
2020-09-16 14:37
回复
cnzs(金币+1): 谢谢参与
1 发自小木虫IOS客户端













回复此楼