|
本帖最后由 neocc 于 2022-5-16 00:05 编辑
楼主能加入终端绘图功能嚒
我通过gnuplot搞定了无GUI绘图,超算上应该有需求,不知道matplotlib有没有这种能力,要是能搞出smile结构用于TS和scan就更666了
将以下脚本命名为OPT-E-monitor-noGUI.sh
运行时候必须要带上俩参数
如 ./OPT-g16-E-monitor.sh OPT-gaussian.out 10
表示每10s输出一次优化次数-能量曲线
- #!/bin/bash
- # $1 = out file
- # $2 = delay in seconds
- grep 'SCF Done' $1 | awk '{print $5}' |cat -n > $1-data.txt
- while :
- do
- grep 'SCF Done' $1 | awk '{print $5}' |cat -n |tail -1 >> $1-data.txt
- gnuplot -p <<EOF
- reset session
- set term dumb 120,30
- set tics nomirror scale 0.5
- set grid
- set xlabel "steps"
- set ylabel "Energy Variation (a.u.)"
- unset key
- plot '$1-data.txt' u 1:2 w l t "Step-E_{a.u.}"
- EOF
- sleep $2
- done
- # chmod +x
复制代码
效果大概是这样的
-2109.4 +-------------------------------------------------------------------------------------------------------+
| : : : : : |
| : : : : : |
-2109.6 |+...............:.................:................:................:.................:................|
| : : : : : |
|* : : : : : |
-2109.8 |*...............:.................:................:................:.................:................|
| * : : : : : |
| ** : : : : : |
-2110 |+.*.............:.................:................:................:.................:................|
| ** : : : : : |
| ** : : : : : |
| ** : : : : : |
-2110.2 |+.....**........:.................:................:................:.................:................|
| ** : : : : : |
| *** : : : : : |
-2110.4 |+.........**....:.................:................:................:.................:................|
| *** : : : : : |
| **** : : : : |
-2110.6 |+...............:******...........:................:................:.................:................|
| : ********* : : : : |
| : **************** : : : |
-2110.8 |+...............:.................:...........**************************************************.......|
| : : : : : **** |
| : : : : : |
-2111 +-------------------------------------------------------------------------------------------------------+
0 50 100 150 200 250 300
|
|