icc=0 nfile=`ls ./*.inp|wc -l` for inf in *.inp do ((icc++)) echo Running ${inf} ... \($icc of $nfile\) time $orca_path/orca ${inf} > ${inf/inp/out} $orca_path/orca_2mkl ${inf/.inp} -molden echo${inf} has finished echo done
trj2xyz: 将xyz动画拆分为单独的.xyz文件
你也可以用split拆分文件
食用方法: ./trj2xyz.sh trj.xyz
注意输入的xyz文件名不能为数字,否则可能会被覆盖,导致错误
1 2 3 4 5 6 7 8 9 10 11
#!/bin/bash xyzfilename=$1 number=$(awk '{print $1}'$xyzfilename | head -1) rownumber=$(awk '{print NR}'$xyzfilename|tail -1) xyznumber=$((rownumber / (number + 2))) for ((i=1; i<=$xyznumber; i=i+1)) do startline=$(((i - 1)*(number + 2)+1)) endline=$((startline + number + 1)) sed -n "${startline},${endline-1}p"$xyzfilename > $i.xyz done
xtbrunall: 用xtb计算所有.xyz文件
请提前移除/重命名你的xyz动画文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#!/bin/bash # 修改自http://sobereva.com/258
xtb_args="--gfn 2 --chrg 0 --uhf 0 --molden"
icc=0 nfile=`ls ./*.xyz|wc -l` for inf in *.xyz do ((icc++)) echo Running ${inf} ... \($icc of $nfile\) time xtb ${inf}${xtb_args} > ${inf/xyz/out} mv molden.input ${inf/xyz}molden.input echo${inf} has finished echo done
rm charges wbo xtbrestart xtbtopo.mol
batch.sh: 调用Multiwfn生成用于IRI的cub文件
batch.sh:
1 2 3 4 5 6
for inf in *.molden.input do Multiwfn ${inf} < batch.txt mv func1.cub f1_${inf/.molden.input}.cub mv func2.cub f2_${inf/.molden.input}.cub done
color Display Background white color scale method BGR color scale midpoint 0.666 display depthcue off set isoval 1 axes location Off display distance -8.0 light 3 on
#根据实际情况进行修改 for {set i 1} {$i<=51} {incr i} { set name $i puts "Processing f1_$name.cub and f2_$name.cub..." mol default style CPK mol new f1_$name.cub mol addfile f2_$name.cub
# 根据实际情况进行修改 scale to 0.4 rotate y by -15 translate by 0.000000 0.00000 -2.000000
mol modstyle 0 top CPK 0.700000 0.300000 18.000000 16.000000 mol addrep top mol modstyle 1 top Isosurface $isoval 1 0 0 1 1 mol modcolor 1 top Volume 0 mol scaleminmax top 1 -0.04 0.02 render snapshot $name.bmp mol delete top }
reverse
如果你的xyz动画反了,可以翻转它
1 2 3 4 5 6 7 8 9 10 11 12 13
#!/bin/bash xyzfilename=$1 number=$(awk '{print $1}'$xyzfilename | head -1) rownumber=$(awk '{print NR}'$xyzfilename|tail -1) xyznumber=$((rownumber / (number + 2))) truncate -s 0 ${xyzfilename%.*}_reverse.${xyzfilename##*.} for ((i=$xyznumber; i >= 1; i=i-1)) do startline=$(((i - 1)*(number + 2)+1)) endline=$((startline + number + 1))
sed -n "${startline},${endline-1}p"$xyzfilename >> ${xyzfilename%.*}_reverse.${xyzfilename##*.} done