• R/O
  • HTTP
  • SSH
  • HTTPS

Molby: コミット

Molecular Modeling Software


コミットメタ情報

リビジョンb2ebb86b44a1b06307cd32b7a7fb75bb74f70030 (tree)
日時2022-02-11 15:17:03
作者Toshi Nagata <alchemist.2005@nift...>
コミッターToshi Nagata

ログメッセージ

SADPOINT and IRC runtypes are now implemented in Create GAMESS dialog.

変更サマリ

差分

--- a/Scripts/gamess.rb
+++ b/Scripts/gamess.rb
@@ -831,7 +831,7 @@ class Molecule
831831 # Various settings
832832 icharg = hash["charge"]
833833 mult = hash["mult"]
834- runtyp = ["ENERGY", "PROP", "OPTIMIZE"][hash["runtype"].to_i]
834+ runtyp = ["ENERGY", "PROP", "OPTIMIZE", "SADPOINT", "IRC"][hash["runtype"].to_i]
835835 scftyp = ["RHF", "ROHF", "UHF"][hash["scftype"].to_i]
836836 bssname = hash["basis"]
837837 bssname2 = hash["secondary_basis"]
@@ -916,14 +916,28 @@ class Molecule
916916
917917 h = (hash["STATPT"] ||= Hash.new)
918918 h["NSTEP"] ||= "400"
919- h["OPTTOL"] ||= "1.0E-06"
919+ if runtyp == "SADPOINT"
920+ h["OPTTOL"] ||= "1.0E-05"
921+ h["HESS"] ||= "CALC"
922+ h["HSSEND"] ||= ".T."
923+ elsif runtyp == "IRC"
924+ h["OPTTOL"] ||= "1.0E-05"
925+ h["HESS"] ||= "READ"
926+ h["HSSEND"] ||= ".T."
927+ else
928+ h["OPTTOL"] ||= "1.0E-06"
929+ end
920930 if hash["eliminate_freedom"] == 0
921931 h["PROJCT"] ||= ".F."
922932 end
923933
924934 h = (hash["SYSTEM"] ||= Hash.new)
925935 h["MEMDDI"] ||= "0"
926- h["MWORDS"] ||= "16"
936+ if runtyp == "SADPOINT" || runtyp == "IRC"
937+ h["MWORDS"] ||= "32"
938+ else
939+ h["MWORDS"] ||= "16"
940+ end
927941 h["TIMLIM"] ||= "50000"
928942
929943 h = (hash["GUESS"] ||= Hash.new)
@@ -940,6 +954,16 @@ class Molecule
940954 h["AUTO"] ||= ".T."
941955 end
942956
957+ if runtyp == "IRC"
958+ h = (hash["IRC"] ||= Hash.new)
959+ h["SADDLE"] = ".T."
960+ h["TSENGY"] = ".T."
961+ h["FORWRD"] = ".T."
962+ h["NPOINT"] = "100"
963+ h["STRIDE"] = "0.2"
964+ h["OPTTOL"] = "1.0E-05"
965+ end
966+
943967 if (hash["esp"] || 0) != 0
944968 h = (hash["ELPOT"] ||= Hash.new)
945969 h["IEPOT"] ||= "1"
@@ -985,7 +1009,7 @@ class Molecule
9851009 elsif k == "SCF"
9861010 ordered = ["CONV", "DIRSCF", "FDIFF", "DAMP"]
9871011 elsif k == "STATPT"
988- ordered = ["NSTEP", "OPTTOL"]
1012+ ordered = ["NSTEP", "OPTTOL", "HESS", "HSSEND"]
9891013 elsif k == "SYSTEM"
9901014 ordered = ["MEMDDI", "MWORDS", "TIMLIM"]
9911015 elsif k == "GUESS"
@@ -998,6 +1022,8 @@ class Molecule
9981022 ordered = ["IEPOT", "OUTPUT", "WHERE"]
9991023 elsif k == "PDC"
10001024 ordered = ["CONSTR", "PTSEL"]
1025+ elsif k == "IRC"
1026+ ordered = ["SADDLE", "TSENGY", "FORWRD", "NPOINT", "STRIDE", "OPTTOL"]
10011027 else
10021028 ordered = []
10031029 end
@@ -1074,21 +1100,58 @@ class Molecule
10741100 end
10751101 end
10761102
1077- def cmd_edit_gamess_input(s)
1078- h = Dialog.run("Edit GAMESS Input", "OK", "Cancel", :resizable=>true) {
1079- layout(1,
1080- item(:textview, :value=>s, :tag=>"edit", :width=>400, :height=>400, :flex=>[0,0,0,0,1,1]),
1081- :flex=>[0,0,0,0,1,1]
1082- )
1083- set_min_size(300, 300)
1084- }
1085- if h[:status] == 0
1086- return h["edit"]
1087- else
1088- return nil
1089- end
1103+ def copy_section_from_gamess_output
1104+ fname = Dialog.open_panel("Select GAMESS Output:", self.dir, "*.log;*.dat")
1105+ if fname
1106+ fp = open(fname, "rb")
1107+ if fp
1108+ pos = 0
1109+ k = Hash.new
1110+ fp.each_line { |ln|
1111+ if ln.start_with?(" $")
1112+ keyword = ln.strip
1113+ if keyword !~ /\$END/
1114+ k[keyword] = pos
1115+ end
1116+ end
1117+ pos += ln.length
1118+ }
1119+ keywords = k.keys.sort { |a, b| k[a] <=> k[b] }
1120+ h = Dialog.run("Select GAMESS section to copy", "Copy", "Cancel") {
1121+ layout(1,
1122+ item(:popup, :subitems=>keywords, :tag=>"section"))
1123+ }
1124+ if h[:status] == 0
1125+ fp.seek(k[keywords[h["section"]]])
1126+ s = ""
1127+ fp.each_line { |ln|
1128+ s += ln
1129+ break if ln =~ /\$END/
1130+ }
1131+ export_to_clipboard(s)
1132+ end
1133+ fp.close
1134+ end
1135+ end
10901136 end
10911137
1138+ def cmd_edit_gamess_input(s)
1139+ mol = self
1140+ h = Dialog.run("Edit GAMESS Input", "OK", "Cancel", :resizable=>true) {
1141+ layout(1,
1142+ item(:textview, :value=>s, :tag=>"edit", :width=>400, :height=>400, :flex=>[0,0,0,0,1,1]),
1143+ item(:button, :title=>"Copy Section from GAMESS Output...", :action=>lambda { |it| mol.copy_section_from_gamess_output } ),
1144+ :flex=>[0,0,0,0,1,1]
1145+ )
1146+ set_min_size(300, 300)
1147+ }
1148+ if h[:status] == 0
1149+ return h["edit"]
1150+ else
1151+ return nil
1152+ end
1153+ end
1154+
10921155 def cmd_create_gamess_input
10931156
10941157 mol = self
@@ -1228,8 +1291,8 @@ class Molecule
12281291 item(:text, :title=>"SCF type"),
12291292 item(:popup, :subitems=>["RHF", "ROHF", "UHF"], :tag=>"scftype"),
12301293 item(:text, :title=>"Run type"),
1231- item(:popup, :subitems=>["Energy", "Property", "Optimize"], :tag=>"runtype",
1232- :action=>lambda { |it| set_attr("use_internal", :enabled=>(it[:value] == 2)) } ),
1294+ item(:popup, :subitems=>["Energy", "Property", "Optimize", "Sadpoint", "IRC"], :tag=>"runtype",
1295+ :action=>lambda { |it| set_attr("use_internal", :enabled=>(it[:value] >= 2)) } ),
12331296 item(:checkbox, :title=>"Use internal coordinates for structure optimization", :tag=>"use_internal"),
12341297 -1, -1, -1,
12351298 item(:checkbox, :title=>"Eliminate translation and rotational degrees of freedom", :tag=>"eliminate_freedom"),
@@ -1353,7 +1416,7 @@ class Molecule
13531416 set_attr("secondary_elements", :enabled=>(values["use_secondary_basis"] == 1))
13541417 set_attr("secondary_basis", :enabled=>(values["use_secondary_basis"] == 1))
13551418 set_attr("dfttype", :enabled=>(values["dft"] == 1))
1356- set_attr("use_internal", :enabled=>(values["runtype"] == 2))
1419+ set_attr("use_internal", :enabled=>(values["runtype"] >= 2))
13571420 set_attr("executable_path", :enabled=>(values["execute_local"] == 1))
13581421 set_attr("select_path", :enabled=>(values["execute_local"] == 1))
13591422 set_attr("ncpus", :enabled=>(values["execute_local"] == 1))
旧リポジトリブラウザで表示