| 查看: 2399 | 回复: 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论文润色/翻译怎么收费?
已经有136人回复
2026年循环经济功能材料国际会议(ICFMCE 2026)
已经有0人回复
2026年第五届电气、电子与信息工程国际会议(ISEEIE 2026)
已经有0人回复
哈尔滨理工大学物理系招收物理学考研调剂
已经有3人回复
0702一志愿吉大B区求调剂
已经有5人回复
求调剂
已经有0人回复
0702一志愿吉大B区求调剂有论文
已经有0人回复
请问还有没有用Latex写文章的小伙伴们?
已经有0人回复
» 抢金币啦!回帖就可以得到:
招收调剂生,动物医学、水产养殖、水产动物医学等专业
+1/86
华南师范大学(211)博士招生- 电子、自动化、机械、生物学、物理相关专业
+2/84
太原理工大学博士招生 电池负极材料 固态电解质方向 有工作经验者优先
+1/81
招硕士调剂生
+2/52
2026年上海大学王亮课题组招收电催化或光催化研究背景的博士生
+2/52
山东师范大学有机化学专业胡忠燕老师课题组招收2026届硕士研究生以及调剂生
+1/46
南开大学罗景山教授课题组招收2026年入学博士生(光/电催化方向)
+2/40
中科院生态环境研究中心国重实验室招聘客座研究生1-2名
+1/36
纺织科学与工程、材料化工方向招收研究生
+1/34
医学327分专硕调剂
+1/17
青岛科技大学0860 调剂招生
+1/13
青岛科技大学0860 一志愿./调剂 招生
+1/10
青岛科技大学高分子学院---生物大分子医学(BM3)团队---招收硕士生和博士生
+1/7
重庆大学药学院闫海龙课题组拟招收2026年申请考核制博士研究生数名
+1/7
上海师范大学化学与材料科学学院任新意副研究员招收调剂学生3-4名(有机化学专业)
+1/7
重庆大学药学院闫海龙课题组拟招收2026年申请考核制博士研究生
+1/6
南昌航空大学拟招收飞行器设计或计算空气动力学研究方向博士生 1名
+1/5
哈尔滨工业大学(深圳)绿色化学团队招收2026年秋季入学博士生
+1/2
339求调剂
+1/1
香港中文大学张立教授诚招RAP/PosDoc/Phd/RA(跨尺度医疗机器人和智能系统)
+1/1
4楼2022-06-22 14:07:45
简单回复
2020-09-16 14:37
回复
cnzs(金币+1): 谢谢参与
1 发自小木虫IOS客户端
psylhh3楼
2020-09-17 17:32
回复
cnzs(金币+1): 谢谢参与













回复此楼