24小时热门版块排行榜    

查看: 6536  |  回复: 8

meizhixin

新虫 (小有名气)

[交流] ovito软件分析Voronoi

使用ovito分析Voronoi,输入参数后,怎么得到结果?不明白?有会的吗?

发自小木虫Android客户端
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

valenhou001

至尊木虫 (职业作家)

★ ★ ★ ★ ★ ★ ★ ★ ★ ★
meizhixin: 金币+10 2017-02-28 13:32:37
2楼2017-02-28 12:52:46
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

meizhixin

新虫 (小有名气)

引用回帖:
2楼: Originally posted by valenhou001 at 2017-02-28 12:52:46
采用python script来计算吧:
https://www.ovito.org/manual/python/introduction/examples.html#example-compute-voronoi-indices

明白了,谢谢大神

发自小木虫Android客户端
3楼2017-02-28 13:31:52
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

meizhixin

新虫 (小有名气)

引用回帖:
2楼: Originally posted by valenhou001 at 2017-02-28 12:52:46
采用python script来计算吧:
https://www.ovito.org/manual/python/introduction/examples.html#example-compute-voronoi-indices

老师好,我把路径改了,在ovito图形界面,run scripts,但是ovito图形界面只是闪了下,没报错,也没结果,啥也没有,是脚本的问题吗?我用的是vasp的POSAR文件,下面是ovito计算voro的脚本,我直接复制的,不知道对不对
# Import OVITO modules.
from ovito.io import *
from ovito.modifiers import *

# Import NumPy module.
import numpy

# Load a simulation snapshot of a Co-B metallic glass.
node = import_file("E:/ovito/Co65B35/POSCAR"

# Set atomic radii (required for polydisperse Voronoi tessellation).
atypes = node.source.particle_properties.particle_type.type_list
atypes[0].radius = 1.25        # Co atomic radius (atom type 1 in input file)
atypes[1].radius = 0.82        # B  atomic radius (atom type 2 in input file)

# Set up the Voronoi analysis modifier.
voro = VoronoiAnalysisModifier(
    compute_indices = True,
    use_radii = True,
    edge_count = 6, # Length after which Voronoi index vectors are truncated
    edge_threshold = 0.1
)
node.modifiers.append(voro)
                     
# Let OVITO compute the results.
node.compute()

# Make sure we did not lose information due to truncated Voronoi index vectors.
if voro.max_face_order > voro.edge_count:
    print("Warning: Maximum face order in Voronoi tessellation is {0}, "
          "but computed Voronoi indices are truncated after {1} entries. "
          "You should consider increasing the 'edge_count' parameter to {0}."
          .format(voro.max_face_order, voro.edge_count))
    # Note that it would be possible to automatically increase the 'edge_count'
    # parameter to 'max_face_order' here and recompute the Voronoi tessellation:
    #   voro.edge_count = voro.max_face_order
    #   node.compute()

# Access computed Voronoi indices as NumPy array.
# This is an (N)x(edge_count) array.
voro_indices = node.output.particle_properties['Voronoi Index'].array

# 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)))
4楼2017-03-09 14:30:58
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

tongaigao

新虫 (初入文坛)


小木虫: 金币+0.5, 给个红包,谢谢回帖
引用回帖:
2楼: Originally posted by valenhou001 at 2017-02-28 12:52:46
采用python script来计算吧:
https://www.ovito.org/manual/python/introduction/examples.html#example-compute-voronoi-indices

你好,请问为什么用python脚本算出来的voronoi参数和在软件里直接一个一个输入算的不一样呢?我算的两者误差不小呢,请教大神这是怎么回事啊
5楼2017-05-18 15:49:20
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

gtssongchi

木虫 (小有名气)


小木虫: 金币+0.5, 给个红包,谢谢回帖
引用回帖:
4楼: Originally posted by meizhixin at 2017-03-09 14:30:58
老师好,我把路径改了,在ovito图形界面,run scripts,但是ovito图形界面只是闪了下,没报错,也没结果,啥也没有,是脚本的问题吗?我用的是vasp的POSAR文件,下面是ovito计算voro的脚本,我直接复制的,不知道对 ...

你好,请问你的问题解决了吗?
6楼2017-11-15 08:31:05
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

cuso4852cuoh

新虫 (小有名气)


小木虫: 金币+0.5, 给个红包,谢谢回帖
楼主您好,您这是在ovito里面写的程序还是另外的软件啊?
7楼2019-03-13 08:16:21
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

cuso4852cuoh

新虫 (小有名气)


小木虫: 金币+0.5, 给个红包,谢谢回帖
引用回帖:
5楼: Originally posted by tongaigao at 2017-05-18 15:49:20
你好,请问为什么用python脚本算出来的voronoi参数和在软件里直接一个一个输入算的不一样呢?我算的两者误差不小呢,请教大神这是怎么回事啊...

您好,我输进去也是闪了一下,没看到报错,但是没任何的结果,求指点下怎么用Python分析voronoi参数啊?十分感谢
8楼2019-04-17 19:13:01
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

cuso4852cuoh

新虫 (小有名气)

引用回帖:
4楼: Originally posted by meizhixin at 2017-03-09 14:30:58
老师好,我把路径改了,在ovito图形界面,run scripts,但是ovito图形界面只是闪了下,没报错,也没结果,啥也没有,是脚本的问题吗?我用的是vasp的POSAR文件,下面是ovito计算voro的脚本,我直接复制的,不知道对 ...

楼主,您好,请问您是怎么解决的,我的也是闪一下就没了,什么也没出,是什么原因啊?求楼主指点啊
9楼2019-04-17 19:13:52
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 meizhixin 的主题更新
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] E0414, 我的本子有没有希望? +7 布布和一二 2026-06-17 9/450 2026-06-21 19:29 by 布布和一二
[考研] 售T0P一区SCI文章,我:8O5.51.O.54,科目齐全,可+急 +3 9skg9htng1 2026-06-20 3/150 2026-06-21 19:18 by q1p9ixelzp
[教师之家] 售T0P一区SCI文章,我:8O5.51.O.54,科目齐全,可+急 +3 9skg9htng1 2026-06-20 3/150 2026-06-21 18:58 by q1p9ixelzp
[公派出国] 售T0P一区SCI文章,我:8O5.51.O.54,科目齐全,可+急 +3 9skg9htng1 2026-06-20 3/150 2026-06-21 18:00 by q1p9ixelzp
[考研] 售T0P一区SCI文章,我:8O5.51.O.54,科目齐全,可+急 +3 9skg9htng1 2026-06-20 4/200 2026-06-21 17:45 by q1p9ixelzp
[论文投稿] 售T0P一区SCI文章,我:8O5.51.O.54,科目齐全,可+急 +3 9skg9htng1 2026-06-20 3/150 2026-06-21 17:40 by q1p9ixelzp
[论文投稿] 售T0P一区SCI文章,我:8O5.51.O.54,科目齐全,可+急 +3 9skg9htng1 2026-06-20 3/150 2026-06-21 17:37 by q1p9ixelzp
[公派出国] 售T0P一区SCI文章,我:8O5.51.O.54,科目齐全,可+急 +4 vlfdw50o0u 2026-06-20 4/200 2026-06-21 17:25 by ky8v3skvft
[博后之家] 售T0P一区SCI文章,我:8O5.51.O.54,科目齐全,可+急 +4 vlfdw50o0u 2026-06-20 6/300 2026-06-21 17:05 by ky8v3skvft
[公派出国] 售T0P一区SCI文章,我:8O5.51.O.54,科目齐全,可+急 +4 vlfdw50o0u 2026-06-20 5/250 2026-06-21 17:00 by ky8v3skvft
[教师之家] 售T0P一区SCI文章,我:8O5.51.O.54,科目齐全,可+急 +5 vlfdw50o0u 2026-06-20 7/350 2026-06-21 16:57 by ky8v3skvft
[论文投稿] 售T0P一区SCI文章,我:8O5.51.O.54,科目齐全,可+急 +3 vlfdw50o0u 2026-06-20 5/250 2026-06-21 16:45 by ky8v3skvft
[教师之家] 售T0P一区SCI文章,我:8O5.51.O.54,科目齐全,可+急 +4 vlfdw50o0u 2026-06-20 7/350 2026-06-21 16:40 by ky8v3skvft
[论文投稿] 售T0P一区SCI文章,我:8O5.51.O.54,科目齐全,可+急 +4 vlfdw50o0u 2026-06-20 9/450 2026-06-21 16:37 by ky8v3skvft
[基金申请] 青A35岁以下通知答辩了吗 +3 暨阳一只柴 2026-06-17 3/150 2026-06-21 09:39 by kudofaye
[考博] 【全奖博士/科研助理/博后招生】新加坡南洋理工大学机械与航空航天学院 +3 robohaha 2026-06-15 4/200 2026-06-21 00:36 by lanbing1
[硕博家园] 一篇论文同时出现在两个期刊,一模一样,这算不算学术不端,请各位老师斧正。 +11 mahl005 2026-06-14 12/600 2026-06-18 17:01 by 770904134
[基金申请] 希望面上有个好结果 +7 碧水00 2026-06-16 7/350 2026-06-18 12:18 by wuke100666
[论文投稿] 三区计算机方向期刊推荐 +5 1457340941 2026-06-15 5/250 2026-06-17 13:16 by 会议编辑
[论文投稿] sci论文二审求助 +5 潘倍倍 2026-06-15 5/250 2026-06-16 10:15 by xs74101122
信息提示
请填处理意见