| 查看: 2603 | 回复: 3 | |||
| 【有奖交流】积极回复本帖子,参与交流,就有机会分得作者 cnzs 的 7 个金币 ,回帖就立即获得 1 个金币,每人有 1 次机会 | |||
cnzs铁虫 (初入文坛)
|
[交流]
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 %) |
» 猜你喜欢
瑞典林雪平大学博士后招聘|PEC Water Splitting 方向
已经有130人回复
PRB投稿,Acknowledgment sent to author状态十天了
已经有3人回复
物理学I论文润色/翻译怎么收费?
已经有267人回复
PVA溶解
已经有2人回复
基金申请
已经有44人回复
CSC与新西兰维多利亚大学PhD奖学金项目
已经有0人回复
新西兰Robinson研究所 招聘CSC公派访问人员
已经有0人回复
帮我的英语口语老师找学生
已经有0人回复
什么时候开奖?
已经有6人回复
散金币祈福
已经有94人回复
» 抢金币啦!回帖就可以得到:
散金祈福
+5/4405
告别流水线爽文!108万字完结仙侠《女娲石之灵石奇缘(仙界篇)》值得细品
+1/4059
华西生物制药研究院招聘科研助理
+2/418
上海交通大学张航课题组招聘博士后(电化学储能)
+1/93
哈尔滨工业大学(校本部)电子与信息工程学院2027级博士招生
+1/68
面上基金祈福
+1/50
南京理工大学优青团队催化化学方向招收推免研究生
+1/49
上海交通大学张航课题组招聘博士后(电化学能量存储与转换)
+1/47
找女友
+1/18
坐标北京诚征男友
+1/17
pcold 原核表达载体
+1/12
2027环境工程博士申请
+1/9
南京医科大学-冯璋课题组-招收2027级生化与分子生物学专业博士和硕士研究生
+1/3
出全新蔡司 Plan?APOCHROMAT 20×/0.8 平场复消色差物镜
+1/3
北京理工大学-集成电路与电子学院杰青团队-招博士后
+1/3
清华大学环境课题组招聘环境工作专业客座生研究生2-3名(应用导向)
+1/2
河海大学海洋环境污染与生态毒理学研究组招收2027级硕士生 及博士研究生
+1/2
北理工集成电路杰青团队 | 诚招科助理
+1/2
清华大学环境课题组招聘环境工作专业客座生研究生2-3名(应用导向)
+1/1
【产品测评分享】体外转录产量不理想、dsRNA 副产物高?T7 RNA 聚合酶实测体验
+1/1
小火柴123
新虫 (正式写手)
- 应助: 0 (幼儿园)
- 金币: 2022.3
- 红花: 2
- 帖子: 410
- 在线: 117.3小时
- 虫号: 6981279
- 注册: 2017-07-23
- 专业: 理论和计算化学
4楼2022-06-22 14:07:45
简单回复
2020-09-16 14:37
回复
cnzs(金币+1): 谢谢参与
1 发自小木虫IOS客户端
psylhh3楼
2020-09-17 17:32
回复
cnzs(金币+1): 谢谢参与









回复此楼