| 查看: 2376 | 回复: 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 %) |
» 猜你喜欢
深圳大学2026年秋博士招生-物理学-活性胶体方向-高永祥课题组
已经有18人回复
论物质与能量的统一模型及物理现象解释
已经有0人回复
物理学I论文润色/翻译怎么收费?
已经有69人回复
基于基元I统一理论的数学相关应用推导
已经有0人回复
基元I统一理论:宇宙本质、层级演化与修炼文明的本源规律
已经有1人回复
基元I理论下三大核心空间现象精准推导与细节解析
已经有0人回复
基于基元 I 统一理论的反重力理论推导
已经有0人回复
基于基元I统一理论的量子力学本源推导
已经有1人回复
推荐一款可以AI辅助写作的Latex编辑器SmartLatexEditor,超级好用,AI润色,全免费
已经有20人回复
【EI|Scopus 双检索】第六届智能机器人系统国际会议(ISoIRS 2026)
已经有0人回复
2026年第四届电动车与车辆工程国际会议(CEVVE 2026)
已经有0人回复
» 抢金币啦!回帖就可以得到:
西湖大学拓扑光学、非厄米光学、太赫兹方向博士后招聘
+2/236
哈工大医康学院材料模拟计算方向人才招聘
+1/78
欢迎报考南京农业大学植物环境适应课题组课题组2026级博士生。
+1/75
北京-89175-事业单位-诚征女友
+1/67
坐标广州,征女友
+2/66
有没有人做过这种结构的顺式体向反式体的转化?
+1/34
湘潭大学“过程强化与绿色化工”创新团队补招2026年秋入学博士生
+2/22
香港城市大学范俊教授招博士生 2名 机器学习和仿真设计新的电池材料 仅限C9高校学生
+1/15
华南师范大学(211)- 光电科学与工程学院 - 申请审核制(2026年4-5月份面试考核)
+2/10
中国科学技术大学环境系招生
+1/9
国家“双一流”建设高校-南京林业大学-国家级青年人才团队 招2026级申请考核制博士
+1/9
全奖博士 英国利物浦大学 × 台湾清华大学 联合培养
+1/7
电子科技大学李世彬课题组招聘传感器方向博士及博士后
+1/7
宁波诺丁汉大学招收26年秋/27年春固废协同转化与低碳冶金方向全奖博士生
+1/7
都放假了嘛?
+1/6
广东省环境科学研究院招聘高分辨质谱方向博士一名
+1/6
【东南大学博士后、科研助理招聘】
+1/5
哈工大(深圳)国家级青年人才 钟颖教授课题组 新增26级博士名额!欢迎报名!
+1/5
【科研助理招聘-北京理工大学-集成电路与电子学院-国家杰青团队】
+1/3
美国密苏里大学“柔性电子”课题组诚聘博士研究生和博士后
+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): 谢谢参与













回复此楼