| 5 | 1/1 | 返回列表 |
| 查看: 2397 | 回復: 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/755
+5/275
+1/92
+1/86
+1/80
+1/34
+1/33
+1/26
+1/21
+1/13
+1/9
+1/9
+1/8
+1/8
+1/8
+1/6
+1/5
+1/4
+1/2
+1/2
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 291分獸醫(yī)專碩 一志愿華中農 +3 | 種大大太陽 2026-03-05 | 3/150 |
|
|---|---|---|---|---|
|
[考研] 一志愿河海大學085900土木水利專碩279求調劑不挑專業(yè) +3 | SunWwWwWw 2026-03-10 | 3/150 |
|
|
[考研] 材料371求調劑 +7 | 鱷魚? 2026-03-11 | 9/450 |
|
|
[考研] 0703求調劑 +4 | jtyq001 2026-03-10 | 4/200 |
|
|
[考研] 材料工程,326分,求調劑 +3 | KRSLSR 2026-03-10 | 3/150 |
|
|
[考研] 調劑 +5 | 調劑的考研學生 2026-03-09 | 5/250 |
|
|
[考研] 一志愿中科大材料與化工。353分能調劑到哪? +4 | MayUxw1 2026-03-08 | 6/300 |
|
|
[考研] 一志愿天大化工(085600)調劑總分338 +5 | 蔡大美女 2026-03-09 | 5/250 |
|
|
[考研] 材料與化工 一志愿山大 321分 求調劑 +6 | 每天散步 2026-03-09 | 7/350 |
|
|
[考研]
|
簡木ChuFront 2026-03-09 | 4/200 |
|
|
[考研] 一志愿南大化學339分求調劑,四六級已過,有比賽,有文章 +7 | Gallantzhou 2026-03-07 | 7/350 |
|
|
[考研] 0703求調劑 +10 | c297914 2026-03-06 | 11/550 |
|
|
[考研] 0856求調劑 +3 | squirtle11 2026-03-07 | 3/150 |
|
|
[考博] 26申博自薦 +9 | 烷基八氮- 2026-03-06 | 11/550 |
|
|
[考研] 083000環(huán)境科學與工程調劑 +5 | 加油呀fxy 2026-03-07 | 6/300 |
|
|
[考研] 求調劑推薦 +4 | 微辣不吃 2026-03-06 | 4/200 |
|
|
[考研] 求調劑 +4 | 呼呼?~+123456 2026-03-06 | 4/200 |
|
|
[考研] 271求調劑 +7 | 月色c 2026-03-05 | 8/400 |
|
|
[考研] 材料學碩080500復試調劑294 +3 | 四葉zjz 2026-03-04 | 3/150 |
|
|
[考研] 286 +6 | ksncj 2026-03-04 | 6/300 |
|