| 1 | 1/1 | 返回列表 |
| 查看: 543 | 回復(fù): 0 | ||
張張蟲123新蟲 (初入文壇)
|
[求助]
gaussian計算過程中,生成geom文件出錯,如何修改小程序
|
|
各位大牛好!在使用gaussian進行量化計算,用fchk文件生成geom文件時,文件輸出總為空白文件,無法得到坐標(biāo)信息。究其原因,可能是因為服務(wù)器升級為gaussian16版本,而生成geom文件的小程序還是以gaussian09版本編寫的,請問修改小程序的哪個部分可以解決這個問題呢?以下是小程序的源代碼。拜托各位了。! # -*- coding: cp936 -*- def parse_fchk(fchkfile): f = open(fchkfile,'r') line = f.readline() # geom while True: line = f.readline() if line == '': print 'can not geom' break if line.find('Current cartesian coordinates') != -1: break geom = [] while True: line = f.readline() if line == '': print 'can not geom' break if line.find('Force Field') != -1: break ws = line.strip().split(None) geom += ws lt_xyz = [] s3 = ' '*3 for i in geom: # i = '-9.09973086E-01', i[-3:] = '-01', i[:-4] = '-9.09973086' s = '{:0=+3d}'.format(int(i[-3:]) + 1) s2 = (' {: =10.7f}' + 'E' + s).format(float(i[:-4])/10) s3 = s3 + s2 if len(s3) >= 48: lt_xyz.append(s3 + '\n') s3 = ' '*3 f.close() return lt_xyz def readpara(): lt_smep = [] f = open('dat-input.dat') lines = f.readlines() f.close() lt_5f = [w.strip() for w in lines[5:10]] return lt_5f try: lt_5f = readpara() except: print 'Cound no find dat-input.dat' datfile = raw_input('Please input the name of the fu.dat file : ') f = open(datfile,'wb') for i,v in enumerate(lt_5f): lt_xyz = parse_fchk(v) f.writelines(' rpts ' + str(i+1) + '\n') f.writelines(lt_xyz) f.close() raw_input('completed') |
| 1 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 085701環(huán)境工程295求調(diào)劑,一志愿A區(qū)211 +6 | 等春來, 2026-03-06 | 7/350 |
|
|---|---|---|---|---|
|
[考研] 材料與化工328求調(diào)劑 +4 | 。,。,。,。i 2026-03-02 | 4/200 |
|
|
[考研] 308求調(diào)劑 +6 | 倘若起風(fēng)了呢 2026-03-05 | 7/350 |
|
|
[考研] 材料學(xué)碩318求調(diào)劑 +21 | February_Feb 2026-03-01 | 24/1200 |
|
|
[考研] 復(fù)試調(diào)劑 +7 | 呼呼?~+123456 2026-03-05 | 10/500 |
|
|
[考博] 2026年博士名額撿漏 +4 | 科研ya 2026-03-04 | 7/350 |
|
|
[考研] 一志愿211,0860總分286食品工程專業(yè)求調(diào)劑 +5 | 林林Winnie 2026-03-05 | 5/250 |
|
|
[考研] 332材料求調(diào)劑 +6 | zjy101327 2026-03-05 | 7/350 |
|
|
[考研] 083000,總分284,求調(diào)劑 +3 | 徐yr 2026-03-04 | 3/150 |
|
|
[考研] 313求調(diào)劑 +3 | 水流年lc 2026-02-28 | 4/200 |
|
|
[考研] 沒上岸的看過來 +3 | tangxiaotian 2026-03-01 | 5/250 |
|
|
[考研] 0817化學(xué)工程與技術(shù)312分求調(diào)劑 +3 | T123 tt 2026-03-04 | 3/150 |
|
|
[考研] 材料328求調(diào)劑 +10 | 一個蘿卜02 2026-03-03 | 10/500 |
|
|
[考研] 322分 085600求調(diào)劑,有互聯(lián)網(wǎng)+國金及主持省級大創(chuàng)經(jīng)歷 +6 | 熊境喆 2026-03-04 | 6/300 |
|
|
[考研] 0703化學(xué)求調(diào)劑 +3 | 將未有期 2026-03-04 | 3/150 |
|
|
[考研] 本科太原理工采礦工程,求調(diào)劑 +3 | onlx 2026-03-01 | 3/150 |
|
|
[考研] 化工專碩348,一志愿985求調(diào)劑 +8 | 弗格個 2026-02-28 | 11/550 |
|
|
[考研] 求調(diào)劑 +4 | Guo_yuxuan 2026-03-02 | 5/250 |
|
|
[考研] 0854復(fù)試調(diào)劑 276 +5 | wmm9 2026-03-01 | 7/350 |
|
|
[考研] 【2026 碩士調(diào)劑】課題組 招收調(diào)劑生 +3 | 考研版棒棒 2026-03-02 | 5/250 |
|