| 查看: 2565 | 回复: 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 %) |
» 猜你喜欢
26申博推荐:南京航空航天大学国际前沿院光学方向招收博士生!
已经有1人回复
如何从铁电相到顺电相。
已经有1人回复
物理学I论文润色/翻译怎么收费?
已经有254人回复
各位大佬,求一份最新Wien2k版本作为学习用途
已经有0人回复
南科大活性流体和软物质课题组诚招2027级博士、硕士研究生和博后
已经有26人回复
瑞典林雪平大学博士后招聘|PEC Water Splitting 方向
已经有24人回复
PRB投稿,Acknowledgment sent to author状态十天了
已经有2人回复
PVA溶解
已经有1人回复
» 抢金币啦!回帖就可以得到:
中山大学医学院(深圳)招聘科研助理(生物信息学方向)
+1/91
中国医学科学院苏州系统医学研究所胡士斌课题组科研助理招聘
+1/44
澳门大学周胤宁课题组招收2027年8月入学博士生
+1/41
求助USP <1664> 2026版本 Assessdrproduct
+1/38
中国科学院赣江创新研究院李庭刚研究员团队招收与江西理工大学联合培养博士生
+1/29
北京师范大学(珠海)电催化方向招收2027年硕士研究生化学或材料方向
+1/27
华南理工大学电力学院雪映教授招收博士生(2027年秋季入学)
+2/22
北京师范大学珠海校区 李朝强团队招多名硕士博士
+1/8
南方科技大学医学院-神经胶质细胞课题组招收联培(客座)博士生
+1/6
同济大学化学科学与工程学院李本浩团队欢迎科研助理/硕士生/博士/博士后加入!
+1/6
2氯5甲基吡啶和2氯6三氯甲基吡啶大生产工艺需求
+1/5
2026 全免 APC!0 元发表,Scopus 收录,Biofunctional Materials(BM)投稿正当时!
+1/5
评职称 / 毕业赶进度,期刊发表选刊、审稿节奏问题可交流答疑
+1/4
浙江大学-化工学院刘平伟课题组-二维材料/功能聚合物开发-博后招聘
+1/3
圣路易斯华盛顿大学管建均教授课题组招聘博士后(2名)
+1/3
量子化学软件开发工程师-深圳
+1/2
国家纳米中心招聘项目聘用研究助理
+1/2
北师大(珠海)环境辐射与健康方向招聘博士后启事
+1/2
上市公司招聘固废裂解处理博士与人工智能博士,可接受应届,需入站
+1/1
武汉理工大学刘鹏飞院士团队招聘科研助理
+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): 谢谢参与











回复此楼