计算化学公社

 找回密码 Forget password
 注册 Register
Views: 9095|回复 Reply: 0
打印 Print 上一主题 Last thread 下一主题 Next thread

[VMD] 使用VMD构建上下两层板的channel结构

[复制链接 Copy URL]

516

帖子

1

威望

4703

eV
积分
5239

Level 6 (一方通行)

跳转到指定楼层 Go to specific reply
楼主
本帖最后由 tjuptz 于 2019-10-17 21:59 编辑

前面我整理了论坛中关于固体表面cluster/slab模型的问题讨论以及界面建模考虑表面弛豫或重构时考虑的层数问题讨论。MD中建立表面模型,可以用MS切面扩胞加真空管后直接使用,这样固体表面在盒子最底部;也可以在GROMACS中用editconf命令对盒子尺寸调整,默认情况下会把表面挪到盒子中间,这样适用于某些体系。有时候我们想建立类似三明治结构,两层表面模型中间真空用来填充一些分子,比如研究流体输运或材料剪切问题时。http://bbs.keinsci.com/thread-13806-1-1.html中有人问这种模型怎么建,我尝试写了个VMD脚本,如下:
  1. display rendermode GLSL
  2. display depthcue off
  3. display projection Orthographic

  4. mol new 1.gro
  5. pbc box
  6. rotate x by -90
  7. mol modstyle 0 top CPK 1.000000 0.300000 12.000000 12.000000

  8. puts "Use like 'transform 30 x 2'. The first value is the distance bewteen two slabs and the last value is for mode selection. 'x' and 'y' representing X and Y axis are equivalent in isotropic condition!"
  9. puts "The built model would be saved automatically into 2.gro. You should copy the coordinates from 10.gro to 2.gro manually!"
  10. puts "CAUTION:cut mode without manual operation after cut!"
  11. puts "CAUTION:split mode without manual operation after split!"

  12. proc transform {d {axis x} {isoXY 2}} {
  13. set dis {0 0}
  14. lappend dis $d
  15. set sel [atomselect top all]
  16. $sel writegro 10.gro
  17. set vec [measure center $sel]
  18. if {$isoXY==1} {
  19. #inversion mode:isotropic for X/Y direction
  20.         $sel moveby [vecinvert $vec]
  21.         $sel move [transaxis $axis 180]
  22.         $sel moveby $vec
  23.         $sel moveby $dis
  24.         $sel writegro 2.gro
  25. } elseif {$isoXY==0} {
  26. #inversion mode:anisotropic for X/Y direction
  27.         $sel moveby [vecinvert $vec]
  28.         $sel move [transaxis $axis 180]
  29.         $sel move [transaxis z 180]
  30.         $sel moveby $vec
  31.         $sel moveby $dis
  32.         $sel writegro 2.gro
  33. } else {
  34. #translation mode
  35.         $sel moveby $dis
  36.         $sel writegro 2.gro
  37. }
  38. }

  39. proc cut {d} {
  40. #cut mode
  41. set sel [atomselect top all]
  42. lassign [lindex [measure minmax $sel] 1] a b c
  43. set range "z<=($c-$d)/2 or z>=($c+$d)/2"
  44. mol modselect 0 top $range
  45. set model [atomselect top $range]
  46. $model writegro 2.gro
  47. }

  48. proc split {d} {
  49. #split mode
  50. set sel [atomselect top all]
  51. lassign [lindex [measure minmax $sel] 1] a b c
  52. set dis {0 0}
  53. lappend dis $d
  54. set range "z>=$c/2"
  55. set upper [atomselect top $range]
  56. $upper moveby $dis
  57. $sel writegro 2.gro
  58. }
复制代码

把脚本和改名为1.gro的原始模型放到VMD目录下使用。切完除了窗口显示以外,会自动保存到VMD自动目录下为2.gro。10.gro是原结构的副本,用于使用transfrom时与2.gro合并。

固体有不同情况,1.点阵点是单个原子的晶体如金属、单原子离子盐,2.点阵点是原子但共价连接的晶体如金刚石、硅,3.点阵点包含多个分子片段的晶体如碳酸盐、分子晶体,4.无规堆垛、无定形或短程有序长程无序的片层。该脚本给出了三个命令,功能上存在冗余,我是想到了多种情况就都写进来了,可认为适用于不同目的。split命令是在MS建好的带真空模型上把底层slab劈开并将上半部分挪到上层;cut命令是把建好的不带真空的厚厚slab切掉中间层;transform命令则是把底部slab变换成顶部slab,又分了几种情况:直接移动对应isoXY不等于0或1,倒置后再移动又分为XY向同性isoXY=1与异性isoXY=0。
注意:对于晶体而言,晶层经过重复总会有一个周期,所以不同命令可能建的模一样;对2.情况,使用cut和split需要恰当处理切除原子造成的悬挂键问题;对3.情况,使用cut或split,适当添加“same resid as……”语句保证片段完整性。MS建模时,Z尺寸应为d+2c,d是真空厚度,c是slab厚度。

用什么命令还是要看你想模拟什么情景。比如我对建好的底部slab最表面进行了嫁接改性,为了上表面也是如此而且不用再做一遍,用transform就好了,至于XY异性时到底让上下板呈镜面还是倒反另考虑。

PS:tcl语言对空格太敏感了,格式困扰了好久

评分 Rate

参与人数
Participants 1
eV +10 收起 理由
Reason
sobereva + 10

查看全部评分 View all ratings

本版积分规则 Credits rule

手机版 Mobile version|北京科音自然科学研究中心 Beijing Kein Research Center for Natural Sciences|京公网安备 11010502035419号|计算化学公社 — 北京科音旗下高水平计算化学交流论坛 ( 京ICP备14038949号-1 )|网站地图

GMT+8, 2025-8-18 09:32 , Processed in 0.283294 second(s), 21 queries , Gzip On.

快速回复 返回顶部 返回列表 Return to list