计算化学公社

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

[ORCA] 请教ORCA手册内复合方法(Compound Methods)内with的用法

[复制链接 Copy URL]

41

帖子

0

威望

233

eV
积分
274

Level 3 能力者

跳转到指定楼层 Go to specific reply
楼主
根据ORCA手册的教程,里面有复合方法的脚本。
其中一个是[color=var(--fgColor-accent)  !important]iterativeOptimization.cmp(从此链接下载 https://github.com/ORCAQuantumCh ... eometryOptimization
其目的是对结构进行优化,计算频率,若有虚频则调整结构后再次优化,直至找到最小值。
1,我想对一个分子进行优化,使用此复合方法的脚本[color=var(--fgColor-accent)  !important]iterativeOptimization.cmp,计算的INP文件只有1行,内容为:
%compound "iterativeOptimization.cmp"
同时在相同文件夹内有一个待优化的坐标文件initial.xyz。
计算运行良好,并产生理想的结果。

2,现在,我有一系列分子(a.xyz , b.xyz, c.xyz, ...),想用同样的方式进行优化。经过查看手册,里面说若想调整变量,可以使用“with”。

3, 手册内关于with命令的语法如下:
%compound "filename"
With
var1 = val1;
var2 = val2;
End

4, 没有看明白with的用法。请问,我要如何写INP文件,利用with,在一个INP内实现一次优化多个分子呢?




41

帖子

0

威望

233

eV
积分
274

Level 3 能力者

2#
 楼主 Author| 发表于 Post on 2025-1-12 18:29:41 | 只看该作者 Only view this author
以下是 iterativeOptimization.cmp 的内容:


# Author: Dimitrios G. Liakos and Franke Neese
# Date  : May/June of 2024
#
# *************************************** DESCRIPTION ***********************************************
# iterative Optimization protocol to find structure with no negative
# frequencies (e.g. real minima)
#
# Step 1. Run a single point calculation (we need it for the first property file)
#
# Step 1. Loop and perform calculations with (optimization and frequencies)
#
# Step 2. Check the frequencies. If there are negative ones use the hessian
#         of the appropriate normal mode to adjust the geometry
#
# ------ Variables to adjust (e.g. using 'with') -------------------
Variable method          = "HF"; #"HF-3c";
Variable MaxNTries       =  25;   # Number of maximum tries
Variable CutOff          = -10.0; # CutOff for a negative frequency
Variable scaling         = 0.6;   # Scaling factor for normal mode
Variable NNegativeTarget = 0;     # Number of negative frequencies we allow
Variable myFilename      = "xyzInput.xyz";
Variable charge          = 0;
Variable multiplicity    = 2;
# ------------------------------------------------------------------
# ------            Rest of variables            -------------------  
Geometry myGeom;
Variable freqs, modes;
Variable res = -1;
Variable NNegative =   0;
Variable OptDone;

# -----------------------------------------------------------
# Perform a single point calculation. We need it for
# the initial geometry from the property file
# -----------------------------------------------------------
New_Step
  !&{method}
Step_End
myGeom.Read();
myGeom.WriteXYZFile(filename=myFilename);

# -----------------------------------------------------------
# Start a for loop over number of tries
# ----------------------------------------------------------
For itry From 1 To maxNTries Do
  # --------------------------------------------
  # Perform a geometry optimization/Frequency calculation
  # --------------------------------------------
  New_Step
    ! &{method} freq Opt
    *xyzfile &{charge} &{multiplicity} &{myFilename}
  Step_End
  res = freqs.readProperty(propertyName = "THERMO_FREQS");
  res = modes.readProperty(propertyName = "HESSIAN_MODES");
  myGeom.Read();

  # ---------------------------------------------
  #  check for sufficiently negative frequencies
  # ---------------------------------------------
  NNegative = 0;
  For ifreq From 0 to freqs.GetSize()-1 Do
    if ( freqs[ifreq] < CutOff )  then
       myGeom.FollowNormalMode(vibrationSN=ifreq, scalingFactor=scaling);
       NNegative = NNegative + 1;
    endif
  endfor
  myGeom.WriteXYZFile(filename=myFilename);
  If ( NNegative <= NNegativeTarget ) then
    goto OptDone;
  endif
endfor

# -----------------------------------------------------------------
# Either found correct geometry or reached maximum number of tries.
# -----------------------------------------------------------------
OptDone :
if (NNegative > NNegativeTarget) then
  print("ERROR The program did not find a structure with the desired\n number of imaginary frequencies.\n There are %9.3lf negative frequencies after %3d steps", NNegative,itry);
else
  print("\nSUCCESS optimized structure with (%d) negative\n frequencies found after %3d steps", NNegative, itry);
endif

End

8

帖子

0

威望

87

eV
积分
95

Level 2 能力者

3#
发表于 Post on 2025-2-21 09:07:41 | 只看该作者 Only view this author
popeyezheung 发表于 2025-1-12 18:29
以下是 iterativeOptimization.cmp 的内容:

楼主,你好,我也用同样的想法,也想多个分子优化,请问楼主解决了吗,如果解决了的话,麻烦请教下使用方法,谢谢

41

帖子

0

威望

233

eV
积分
274

Level 3 能力者

4#
 楼主 Author| 发表于 Post on 2025-7-31 10:52:42 | 只看该作者 Only view this author
userrr 发表于 2025-2-21 09:07
楼主,你好,我也用同样的想法,也想多个分子优化,请问楼主解决了吗,如果解决了的话,麻烦请教下使用方 ...

ORCA 6.1.0开放下载(无需**上网)
http://bbs.keinsci.com/forum.php ... 6&fromuid=50380
(出处: 计算化学公社)

查看这个,下载6.1的手册,5.20节,1015页的范例(或直接搜索semiNumericalPolarizability.cmp定位),里面有with的用法。

本版积分规则 Credits rule

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

GMT+8, 2025-8-12 21:01 , Processed in 0.179723 second(s), 20 queries , Gzip On.

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