| 查看: 2496 | 回复: 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年博士招生-吴昊研究员-磁学与自旋电子学
已经有0人回复
《电磁学》教材推荐
已经有1人回复
物理学I论文润色/翻译怎么收费?
已经有54人回复
【急招】合肥工大核聚变材料计算方向2026级工程博士生
已经有4人回复
大豆异黄酮分离
已经有0人回复
湖南大学材料学院急招2026年博士生,临时增加一名博士联培指标
已经有10人回复
天津理工大学晶体材料全国重点实验室刘红军教授课题组招收博士生1-2名
已经有1人回复
中国科学院物理研究所谌志国研究员团队招收2027年博士研究生
已经有3人回复
2026年中德博士后交流项目 - 新型量子和磁性材料:材料制备表征和中子散射研究
已经有12人回复
» 抢金币啦!回帖就可以得到:
征结婚对象,男找女,坐标【北京】【北京】【北京】
+5/250
中科院深圳先进技术研究院集成电路先进封装博士后招聘
+1/85
福州大学化工学院电子化学品团队博士招生,还有一个名额!
+1/84
武汉工程大学(省属一本)招聘师资博士后以及人才引进教师(事业编)
+1/83
山东第一医科大学泰山学者团队2026年招收副教授、博士后(不限专业)
+1/83
替投稿20天的论文祈福
+1/71
河南省医学科学院王宁利院士科研团队2026年博士、博后、硕士招聘
+1/40
江西理工大学稀土学院急招博士生(2026年9月入学)2名,稀土光功能材料方向,非诚勿扰
+1/31
南京农业大学工学院博士招生 1个名额
+1/30
招聘青年教师(有编制)——南京邮电大学柔性电子全国重点实验室徐申课题组
+1/29
11
+1/17
紧急招收2026年秋季入学博士生1名(湘潭大学 固体废弃物低碳利用湖南省工程研究中心)
+1/15
上海交通大学研究生招生咨询会,来了!
+1/12
英国UCL博士招生
+1/12
11
+1/12
上海理工大学-赵斌教授课题组招收申请考核制博士【新能源材料】
+1/11
江西理工大学稀土学院/国家稀土功能材料创新中心招收博士研究生
+1/6
海南大学博士研究生第二批招生 脑空间信息学团队(图像计算方向)
+1/5
首都医科大学药学院2026年申请考核制博士研究生招生/有机化学/药物化学 三年学制
+1/2
紧急招收2026年秋季入学博士生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): 谢谢参与












回复此楼