| 4 | 1/1 | 返回列表 |
| 查看: 2396 | 回復(fù): 3 | |||
| 【有獎(jiǎng)交流】積極回復(fù)本帖子,參與交流,就有機(jī)會(huì)分得作者 cnzs 的 7 個(gè)金幣 ,回帖就立即獲得 1 個(gè)金幣,每人有 1 次機(jī)會(huì) | |||
[交流]
VASP數(shù)據(jù)使用ovito官網(wǎng)腳本分析voronio
|
|||
|
1.能不能用ovito處理AIMD的XDATCAR文件? 2.如果可以為什么我用官網(wǎng)提供的Python腳本只能得出第一個(gè)離子步的數(shù)據(jù)? 3.有沒有大佬可以幫忙改進(jìn)一下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 %) |
» 搶金幣啦!回帖就可以得到:
+3/784
+5/555
+1/90
+1/89
+1/83
+1/81
+5/60
+1/30
+1/25
+1/20
+1/20
+1/18
+1/11
+1/9
+1/5
+1/5
+1/5
+1/4
+1/3
+1/2
| 4 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 282分材料專業(yè)求調(diào)劑院校 +10 | 楓橋ZL 2026-03-09 | 13/650 |
|
|---|---|---|---|---|
|
[碩博家園] 2026級(jí)碩士研究生招生/調(diào)劑 +3 | 知足常樂的樂 2026-03-06 | 5/250 |
|
|
[考研] 材料調(diào)劑,307分 +8 | 張泳銘1 2026-03-09 | 8/400 |
|
|
[考研] 調(diào)劑 +4 | 調(diào)劑的考研學(xué)生 2026-03-09 | 4/200 |
|
|
[考研] 一志愿天津大學(xué),英一數(shù)二305分求調(diào)劑,四六級(jí)已過 +5 | 小小番的茄 2026-03-09 | 5/250 |
|
|
[考研] 求調(diào)劑,數(shù)一英一274分 +4 | 小菲會(huì)努力 2026-03-08 | 4/200 |
|
|
[考研] 337求調(diào)劑 +3 | 睡醒,。 2026-03-09 | 3/150 |
|
|
[考研] 材料工程330分求調(diào)劑,一志愿985 +3 | 小材化本科 2026-03-07 | 3/150 |
|
|
[考研] 22408 275分求調(diào)劑 +3 | 宇智波比 2026-03-03 | 4/200 |
|
|
[考研] 346分材料求調(diào)劑 +5 | snow_反季節(jié)版 2026-03-07 | 5/250 |
|
|
[考研] 一志愿211 化學(xué)305分求調(diào)劑 +3 | 0703楊悅305分 2026-03-05 | 3/150 |
|
|
[考研] 一志愿211 085600 280數(shù)二英二求調(diào)劑 +3 | 月山斜 2026-03-06 | 3/150 |
|
|
[考研] 267化工調(diào)劑求助 +7 | 聰少OZ 2026-03-04 | 7/350 |
|
|
[考研] 求調(diào)劑 +4 | 呼呼?~+123456 2026-03-05 | 5/250 |
|
|
[考研] 復(fù)試調(diào)劑 +7 | 呼呼?~+123456 2026-03-05 | 10/500 |
|
|
[考研] 282求調(diào)劑 +7 | 夕~日 2026-03-05 | 8/400 |
|
|
[考研] 347求調(diào)劑 +6 | 啊歐歐歐 2026-03-03 | 8/400 |
|
|
[考研] 264求調(diào)劑 +8 | 26調(diào)劑 2026-03-03 | 8/400 |
|
|
[考研] 一志愿中科大080500總分324求調(diào)劑 +3 | jorna 2026-03-03 | 6/300 |
|
|
[考研] 281求調(diào)劑 +3 | 我是小小蔥蔥 2026-03-03 | 5/250 |
|