| 查看: 2728 | 回复: 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 %) |
» 猜你喜欢
经费如何使用,花不完怎么办?
已经有5人回复
兼职
已经有12人回复
物理学I论文润色/翻译怎么收费?
已经有237人回复
海外Gustau Catalan课题组情况了解
已经有1人回复
中国机械工业科学技术奖含金量,好获奖吗?
已经有1人回复
日内瓦国际发明展没有转化,只有论文能报吗?必须线下参加吗?
已经有0人回复
想投稿的来!
已经有0人回复
2027博士申请
已经有1人回复
华中科技大学集成电路学院招2027年博士研究生
已经有0人回复
华中科技大学陈实教授招2027年博士研究生
已经有32人回复
求英文歌,谢谢您。
已经有0人回复
» 抢金币啦!回帖就可以得到:
pdf拆分,ai修复老照片等200+工具
+1/226
坐标广州,替办公室92年害羞小妹征男友
+1/137
中山大学(深圳)陈友课题组招收2027年学术型博士
+1/88
中科大+ 苏州国家实验室2027联合培养博士专项(材料、化学、化工、原位表征技术等)
+1/73
哈工程核学院 27年博士/硕士招生-先进核材料、材料辐照损伤、聚变材料
+1/73
【招聘】质子/离子传导膜研究员/副研究员
+1/63
四川大学物理学院 左老师课题组,招光学方向博士。
+1/58
征对象
+1/57
南科大薛亚辉课题组诚聘纳米离子学器件方向优秀生源博士生
+1/47
宁波大学招聘科研助理1名
+1/39
坐标郑州或者深圳:替我的拜把子兄弟,寻一个有缘人
+2/30
【招生】生态学、地理学、农林交叉方向招收联合培养博士研究生
+1/26
江苏大学/江苏科技大学施伟东教授课题组招收2027年博士生
+1/23
【招生】生态学、地理学方向招收联合培养博士研究生
+1/23
江苏大学/江苏科技大学施伟东教授课题组招收2027年博士生
+1/19
福州大学国家万人汤育欣组招收2027年“申请考核制”储能电池方向博士研究生一名
+1/16
北京化工大学化学学院潘军青课题组招收硬碳或者锂电回收博士生2名
+1/13
海南大学2027年博士招生
+1/6
国家纳米科学中心唐岑课题组招聘博士生
+1/6
英文专著|ISBN DOI 齐全
+1/1
4楼2022-06-22 14:07:45
简单回复
2020-09-16 14:37
回复
cnzs(金币+1): 谢谢参与
1 发自小木虫IOS客户端









回复此楼