| 查看: 498 | 回复: 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! |
» 猜你喜欢
分子筛催化剂
已经有1人回复
青岛大学国家优青团队急招一名26年秋季入学博士(报名截止时间为6月17号下午1点)
已经有8人回复
物理化学论文润色/翻译怎么收费?
已经有218人回复
福建理工大学资源化学专业正式获批并启动招生
已经有32人回复
Crystals(IF=2.9)- Special Issue invatation- Functional Materials
已经有0人回复
分子筛催化方向 一篇cej共一第一 可以申请上海什么学校呢
已经有3人回复
求助共晶分子筛的电镜图分析,有偿
已经有1人回复
中南大学化学化工学院招收电池储能、理论计算方向博士生
已经有16人回复
International Journal of Nanoscience属于中科院4区吗?
已经有0人回复
请问哪里可以代烧带压力的炉子?
已经有3人回复
找到一些相关的精华帖子,希望有用哦~
取得博士学位大于三年是否能申请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])
回复此楼
点击这里搜索更多相关资源