国产三级精品三级在线观看,国产高清无码在线观看,中文字幕日本人妻久久久免费,亚洲精品午夜无码电影网

解決個(gè)經(jīng)常困擾新手的問題,VMD如何顯示晶胞格子?

VMD是一款非常強(qiáng)大的分子動(dòng)力學(xué)后處理軟件,而在使用中有個(gè)問題經(jīng)常困擾新手,如何在周期性模型上加上晶胞格子使其看起來更“漂亮”一點(diǎn)呢?VMD默認(rèn)是不畫晶格的

但作為一個(gè)強(qiáng)大的軟件,能實(shí)現(xiàn)這個(gè)功能是肯定的,現(xiàn)在就有兩種方法可以在VMD軟件中畫出晶格,試試吧:

?

(1)VMD內(nèi)置的pbctool工具箱,可直接在vmd控制臺(tái)或者Tk控制臺(tái)(Main menu->Extensions->Tk Console)中輸入以下命令:

?

pbc set [list a b c alpha beta gamma]

?

pbc box -on

?

其中,a、b、c、alpha、beta、gamma是各個(gè)晶胞參數(shù),如下圖所示:

?

解決個(gè)經(jīng)常困擾新手的問題,VMD如何顯示晶胞格子?

?

還可以設(shè)置box的線型、線寬和顏色,分別通過以下命令:

?

pbc box -style lines|dashed|

pbc box -width 2

pbc box -color red

更多選項(xiàng)可查閱:

http://www.ks.uiuc.edu/Research/vmd/plugins/pbctools/

?

(2)tcl腳本:vmd_draw_unitcell。將下面內(nèi)容保存在名為vmd_draw_unitcell.tcl的文件,放在vmd安裝目錄下(如:C:Program FilesUniversity of IllinoisVMD)

# vmd extension procedure:
# provide a ‘draw unitcell’ command
#
# $Id: vmd_draw_unitcell.tcl,v 1.2 2005/01/11 13:05:12 akohlmey Exp $
# Time-stamp:
#
# Copyright (c) 2003-2005 by

# add a unitcell graphic to a molecule via a draw subcommand.
#
# options:
# cell (vmd|auto|[list ]), default: “vmd”
#? ?? ?? ? “vmd” will use the internal values,
#? ?? ?? ? “auto” will build an orthogonal unitcell from the result of
#? ?? ?? ???‘measure minmax’ plus 1 angstrom added in each direction.
#? ?? ?? ?else a list of a,b,c,alpha,beta,gamma will be assumed.
# origin ([list ]|auto), default: {0.0 0.0 0.0}, “auto” with ‘cell auto’
# style: (lines|dashed|rod) default: line
# width: default: 1.0
# resolution:? ?? ???default: 8
#

proc vmd_draw_unitcell {molid args} {

# parse arguments
foreach {flag arg} $args {
switch $flag {
cell? ?? ? { set cell? ?? ? “$arg” }
origin? ???{ set origin? ???“$arg” }
style? ?? ?{ set style? ?? ?“$arg” }
width? ?? ?{ set width? ?? ?“$arg” }
resolution { set resolution “$arg” }
default? ?{ puts “unknown option: $flag”; return }
}
}

if [info exists cell] {
if {![info exists origin] && $cell == “auto”} { set origin auto }
} else {
set cell vmd
}

if ![info exists origin]? ?? ?{ set origin? ???{0.0 0.0 0.0} }
if ![info exists style]? ?? ? { set style? ?? ? lines? ?? ???}
if ![info exists width]? ?? ? { set width? ?? ? 1? ?? ?? ?? ?}
if ![info exists resolution] { set resolution 8? ?? ?? ?? ?}
# FIXME: add some checks on the arguments here.

# handle auto keywords
if {$cell == “auto” || $origin == “auto” } {
set sel [atomselect $molid {all}]
set minmax [measure minmax $sel]
$sel delete
unset sel

if {$origin == “auto” } {set origin [vecsub [lindex $minmax 0] {1 1 1}]}
if {$cell == “auto”} {
set cell [vecadd [vecsub [lindex $minmax 1] [lindex $minmax 0]] {2 2 2}]
lappend cell 90.0 90.0 90.0
}
}

if {$cell == “vmd” } {set cell [molinfo $molid get {a b c alpha beta gamma}]}
global M_PI
set sa [expr sin([lindex $cell 3]/180.0*$M_PI)]
set ca [expr cos([lindex $cell 3]/180.0*$M_PI)]
set cb [expr cos([lindex $cell 4]/180.0*$M_PI)]
set cg [expr cos([lindex $cell 5]/180.0*$M_PI)]
set sg [expr sin([lindex $cell 5]/180.0*$M_PI)]

# set up cell vectors according to the VMD unitcell conventions.
# the a-vector is collinear with the x-axis and
# the b-vector is in the xy-plane.
set a [vecscale [lindex $cell 0] {1 0 0}]
set b [vecscale [lindex $cell 1] “$ca $sa 0”]
set c [vecscale [lindex $cell 2] “$cb [expr ($ca – $cb*$cg)/$sg] [expr sqrt((1.0 + 2.0*$ca*$cb*$cg – $ca*$ca – $cb*$cb – $cg*$cg)/(1.0 – $cg*$cg))]”]

# set up cell vertices
set vert(0) $origin
set vert(1) [vecadd $origin $a]
set vert(2) [vecadd $origin $b]
set vert(3) [vecadd $origin $a $b]
set vert(4) [vecadd $origin $c]
set vert(5) [vecadd $origin $a $c]
set vert(6) [vecadd $origin $b $c]
set vert(7) [vecadd $origin $a $b $c]
unset sa ca cb cg sg

set gid “”
switch $style {
rod {
# set size and radius of spheres and cylinders
set srad [expr $width * 0.003 * [veclength [vecadd $a $b $c]]]
set crad [expr 0.99 * $srad]

# draw spheres into the vertices …
for {set i 0} {$i < 8} {incr i} {
lappend gid [graphics $molid sphere $vert($i) radius $srad resolution $resolution]
}
# … and connect them with cylinders
foreach {i j} {0 1 0 2 0 4 1 5 2 3 4 6 1 3 2 6 4 5 7 3 7 5 7 6} {
lappend gid [graphics $molid cylinder $vert($i) $vert($j) radius $crad resolution $resolution]
}
}

lines {
set width [expr int($width + 0.5)]
foreach {i j} {0 1 0 2 0 4 1 5 2 3 4 6 1 3 2 6 4 5 7 3 7 5 7 6} {
lappend gid [graphics $molid line $vert($i) $vert($j) width $width style solid]
}
}

dashed {
set width [expr int($width + 0.5)]
foreach {i j} {0 1 0 2 0 4 1 5 2 3 4 6 1 3 2 6 4 5 7 3 7 5 7 6} {
lappend gid [graphics $molid line $vert($i) $vert($j) width $width style dashed]
}
}
default { puts “unknown unitcell style: $style” ; return }
}
# return list of graphics indices so that they can be saved and deleted later.
return $gid
}

############################################################
# Local Variables:
# mode: tcl
# time-stamp-format: “%u %02d.%02m.%y %02H:%02M:%02S %s”
# End:
############################################################

?

用記事本打開vmd安裝目錄下的vmd.rc文件,在最后添加一行:

source C:\Program Files (x86)\University of Illinois\VMD\vmd_draw_unitcell.tcl

然后在vmd控制臺(tái)或這tk控制臺(tái)即可輸入一下命令顯示晶胞格子:

draw unitcell cell [list a b c alpha beta gamma]

注意:a b c alpha beta gamma需要全部注明。

?

詳細(xì)說明請(qǐng)看下面一段英文表述:

# cell (vmd|auto|[list ]), default: “vmd”
#? ?? ?? ? “vmd” will use the internal values,
#? ?? ?? ? “auto” will build an orthogonal unitcell from the result of
#? ?? ?? ???‘measure minmax’ plus 1 angstrom added in each direction.
#? ?? ?? ?else a list of a,b,c,alpha,beta,gamma will be assumed.
# origin ([list ]|auto), default: {0.0 0.0 0.0}, “auto” with ‘cell auto’
# style: (lines|dashed|rod) default: line
# width: default: 1.0
# resolution:? ?? ???default: 8

本文轉(zhuǎn)載自xianggui7895,轉(zhuǎn)載目的在于知識(shí)分享,本文觀點(diǎn)不代表V-suan云平臺(tái)立場(chǎng)。

原創(chuàng)文章,作者:菜菜歐尼醬,如若轉(zhuǎn)載,請(qǐng)注明來源華算科技,注明出處:http://m.xiubac.cn/index.php/2023/12/01/ad9e647007/

(0)

相關(guān)推薦

陈巴尔虎旗| 澎湖县| 建昌县| 开鲁县| 通许县| 信阳市| 比如县| 扎鲁特旗| 察哈| 梁平县| 桃园县| 莱西市| 安宁市| 永昌县| 宁远县| 绥阳县| 常德市| 孝感市| 贵港市| 惠安县| 日喀则市| 健康| 安塞县| 寻乌县| 扶沟县| 绥中县| 永善县| 双桥区| 理塘县| 云和县| 怀化市| 甘肃省| 巴楚县| 肇东市| 耒阳市| 通江县| 长顺县| 邓州市| 七台河市| 灌南县| 潮安县|