计算化学公社

标题: 【分享】监督高斯结构优化进度的脚本 [打印本页]

作者
Author:
北大-陶豫    时间: 2021-1-2 19:29
标题: 【分享】监督高斯结构优化进度的脚本
本帖最后由 北大-陶豫 于 2021-5-4 20:30 编辑

https://github.com/Tao-Yu-Chem/GaussianScripts/ 里的 Converge_Reader.cpp(或最后的附件)

(2021年3月6日更新:添加了对双杂化泛函的支持,为说明添加了英文版。)(Update on March 6, 2021: Added support for double-hybrid functionals, and added an English version for the description.)

这是本人写的监督高斯结构优化进度的脚本,能显示出每步的能量、受力、位移等信息,如果受力、位移等达到了收敛标准会加上下划线,十分直观。
This is a script I wrote to monitor the progress of Gaussian structure optimization. It can display the energy, force, displacement and other information of each step. If the force and displacement reach the convergence standard, they will be underlined, which is very intuitive.

下面是一个 opt freq job 的使用效果:
Below is the use effect of an opt freq job:
(, 下载次数 Times of downloads: 49)

(2021年3月6日新增)对双杂化泛函也支持得很好,能给出加入了 MP2 关联能的正确能量(而 GView 会给出错误的能量,即 SCF Done 的能量,详见 http://bbs.keinsci.com/thread-13450-1-1.html):(Added on March 6, 2021) It also supports double hybrid functionals very well (While GView will give the wrong energy, i. e. , the energy of "SCF Done", see http://bbs.keinsci.com/thread-13450-1-1.html for details):
(, 下载次数 Times of downloads: 39)

会自动找出受力、位移最小的步,因此可以帮助判断结构优化是否发生了振荡。比如下面就是一个发生振荡的例子:
It will automatically find the step with the smallest force and displacement, so it can help determine whether the structure optimization had an oscillation. Below is an example of oscillation:
(, 下载次数 Times of downloads: 38)
当前已经走了 184 步,但能量最低的是第 147 步,受力最小的是第 85 步,位移最小的是第 36 步,因此显然发生了振荡。
At present, 184 steps have been taken, but the lowest energy is on step 147, the lowest force is on step 85, and the lowest displacement is on step 36, so it is obvious that there is an oscillation.

会自动检测 scan job,并给出 scan summary:
It can automatically detect a scan job and give a scan summary:
(, 下载次数 Times of downloads: 55)

有时 scan job 未完成,或结构优化走步太多(发生振荡、未能收敛),会给对应的能量显示警告信息:
Sometimes the scan job is not completed, or the structure optimization takes too many steps (oscillation, failure to converge), a warning message will be displayed for the corresponding energy:
(, 下载次数 Times of downloads: 40)
(注意,对于 scan job 中结构优化发生振荡的情况,我的脚本会给出最低能量,而不是像 GView 一样给出最后一个结构的能量。)
(Note that for the oscillation of structure optimization in scan job, my script will give the lowest energy instead of giving the energy of the last structure like GView does.)

能自动检测错误并显示出来:(但是还不太支持 IRC job)
It can also automatically detect and display errors: (but IRC jobs are poorly supported)
(, 下载次数 Times of downloads: 48)

现在已知的缺点:
Currently known disadvantages:
(1)基本只支持 sp,opt,freq 等 job type,尚不支持 IRC 等 job type。
(1) Basically, only job types such as sp, opt, freq are supported, while job types such as IRC are not yet supported.
(2)能量读取是从有 "SCF Done" 的一行中读取,因此对涉及 MPn 的任务,如 MPn、CCSD 等任务无法得到正确的能量(但已经支持双杂化泛函得到正确能量了)。
(2) The energy read is read from the line with "SCF Done", so for tasks involving MPn, such as MPn, CCSD and other tasks, the correct energy cannot be obtained (But double hybrid functional has been supported to obtain the correct energy).


作者
Author:
冰释之川    时间: 2021-1-2 19:39
本帖最后由 冰释之川 于 2021-1-2 19:52 编辑

IRC 过渡态啥的可以参考钟成老师的程序:《(更新3.0版)Gaussian优化过渡态的监控/诊断小脚本-tsmonitor 》http://bbs.keinsci.com/thread-14081-1-1.html

P.s. (1)其实用当前指标与指标的收敛限之比来跟踪几何优化收敛情况更加直观,比值小于1代表达到收敛限,(2)如果能显示最小的振动本征值就更好了。


作者
Author:
abin    时间: 2021-1-4 13:53
molden 可视化监控
免费,可用。
作者
Author:
北大-陶豫    时间: 2021-5-4 17:08
本帖最后由 北大-陶豫 于 2021-5-4 20:34 编辑

5月4日更新:加了个Windows版,并改了2个bug:
1 计算单点能的时候受力会显示乱码,因为没有读入力导致力的值是未定义值;

2 处理了运行时忘记传入log文件名参数的问题。


作者
Author:
不想飞的猫头鹰    时间: 2024-10-11 10:22
感谢楼主,今天刚下载,我的linux系统是rockylinux9.2,想看看一个g16 dft计算的opt freq收敛情况,使用Converge_Reader.cpp BMC-POM.log后出现./Converge_Reader.cpp: line 1: $'\r': command not found
./Converge_Reader.cpp: line 7: using: command not found
./Converge_Reader.cpp: line 7: $'\r': command not found
./Converge_Reader.cpp: line 8: $'\r': command not found
./Converge_Reader.cpp: line 15: $'\r': command not found
./Converge_Reader.cpp: line 16: syntax error near unexpected token `('
'/Converge_Reader.cpp: line 16: `void ReadLine(FILE *f,int &EOLN, char *Line)

请问这是缺什么环境嘛,十分感谢
作者
Author:
北大-陶豫    时间: 2024-10-11 13:20
不想飞的猫头鹰 发表于 2024-10-11 10:22
感谢楼主,今天刚下载,我的linux系统是rockylinux9.2,想看看一个g16 dft计算的opt freq收敛情况,使用Con ...

用g++编译。
  1. g++ Converge_Reader.cpp -o Converge_Reader
复制代码

得到 Converge_Reader(可以把它移动到环境变量的目录里),然后 Converge_Reader xxx.log
作者
Author:
不想飞的猫头鹰    时间: 2024-10-11 20:05
北大-陶豫 发表于 2024-10-11 13:20
用g++编译。

得到 Converge_Reader(可以把它移动到环境变量的目录里),然后 Converge_Reader xxx.lo ...

感谢,成功运行了




欢迎光临 计算化学公社 (http://bbs.keinsci.com/) Powered by Discuz! X3.3