| 查看: 411 | 回复: 0 | |||
[资源]
cclib 处理大于100个原子的系统 (GAMESS, parser)
|
|
前段时间自己遇到的问题,cclib处理大于100个原子的系统出错。 下面是俺的处理方法,共享: Here is the root problem: cclib (the current released version) cannot parse the log file of system with natom >= 100. In the log file for the Eigenvalues/MOs: 518 H 98 S -0.000000 0.000000 -0.000000 -0.000000 -0.000000 519 C 99 S -0.000000 0.000000 -0.000000 -0.000000 -0.000000 520 C 99 S -0.000000 0.000000 -0.000000 -0.000000 -0.000000 521 C 99 X -0.000000 0.000000 -0.000000 -0.000000 -0.000000 522 C 99 Y -0.000000 0.000000 -0.000000 -0.000000 -0.000000 523 C 99 Z -0.000000 0.000000 -0.000000 -0.000000 -0.000000 524 H 0 S -0.000000 0.000000 -0.000000 -0.000000 -0.000000 525 H 1 S -0.000000 0.000000 -0.000000 -0.000000 -0.000000 526 C 2 S -0.000000 0.000000 -0.000000 -0.000000 -0.000000 The number of atoms are recorded as 0, 1, ..., instead of 100/200/..., 101/201/..., which is however problematic in calculating CSPA. My resolution is: introducing a switch to monitor this change. The corresponding code, in gamessparser.py is partially copied in the following: LINE 714: p = re.compile("(\d+)\s*([A-Z][A-Z]?)\s*(\d+)\s*([A-Z]+)" ![]() oldatom ='0' i_atom = 0 #couter to translate to 0s to some hundreds, by C.W. flag_w = True #Flag to whether for i in range(self.nbasis): line = inputfile.next() # If line is empty, break (ex. for FMO in exam37). if not line.strip(): break # Fill atombasis and aonames only first time around if readatombasis and base == 0: aonames = [] start = line[:17].strip() m = p.search(start) if m: g = m.groups() g2 = int(g[2]) #atom index from GAMESS's log file if g2 == 0 and flag_w: #c.w. i_atom = i_atom + 100 #c.w flag_w = False if g2 != 0: flag_w = True g2 = g2 + i_atom #c.w. aoname = "%s%s_%s" % (g[1].capitalize(), str(g2), g[3]) #c.w. # aoname = "%s%s_%s" % (g[1].capitalize(), g[2], g[3]) oldatom = str(g2) #c.w. atomno = g2 - 1 #c.w. # oldatom = g[2] # atomno = int(g[2])-1 orbno = int(g[0])-1 else: # For F orbitals, as shown above g = [x.strip() for x in line.split()] g2 = int(g[2]) #atom index from GAMESS's log file if g2 == 0 and flag_w: #c.w. i_atom = i_atom + 100 #c.w. flag_w = False #c.w. if g2 != 0: #c.w. flag_w = True #c.w. g2 = g2 + i_atom #c.w. # aoname = "%s%s_%s" % (g[1].capitalize(), oldatom, g[2]) aoname = "%s%s_%s" % (g[1].capitalize(), oldatom, str(g2)) atomno = int(oldatom)-1 orbno = int(g[0])-1 self.atombasis[atomno].append(orbno) self.aonames.append(aoname) coeffs = line[15:] # Strip off the crud at the start. j = 0 while j*11+4 < len(coeffs): self.mocoeffs[0][base+j, i] = float(coeffs[j * 11 j + 1) * 11])j += 1 line = inputfile.next() Enjoy! |
» 猜你喜欢
软包
已经有0人回复
软包电池的N/P是多少合适
已经有0人回复
物理化学论文润色/翻译怎么收费?
已经有135人回复
招贤纳博(已结束)
已经有28人回复
表征测试机构后台私聊我
已经有0人回复
需要一个圆偏振光诱导化学反应,请问使用圆偏振光作为光源,应该需要哪些设备搭建
已经有0人回复
Coordination Chemistry Reviews
已经有0人回复
找到一些相关的精华帖子,希望有用哦~
取得博士学位大于三年是否能申请CSC资助读海外博后?
已经有12人回复
求h-BN的原子位置以及单层结构怎么用MS建立?
已经有9人回复
物理吸附一定放热吗?焓变可以大于0吗?
已经有10人回复
原子布居电荷分布
已经有3人回复
让中学生受益一生的100个美德故事.黄棋【转载】
已经有4人回复
生测数据的标准差大于平均值,怎么办?
已经有7人回复
原子荧光测试遇到问题,怎么办?
已经有5人回复
【求助】单晶的X衍射-确定绝对构型-是否一定要有重原子!!
已经有7人回复
【讨论】悬赏100金币!红外分析解谱:Si原子上甲基数量
已经有10人回复
【求助】原子吸收测定矿石中的钾和钠,怎么也做不好?
已经有5人回复
【求助】如何使用火焰原子吸收法测定100ppm以内的铁含量
已经有14人回复
【求助】如何判断一个原子在原包内部
已经有4人回复
科研从小木虫开始,人人为我,我为人人














j + 1) * 11])
回复此楼
点击这里搜索更多相关资源