mirror of
https://gitlab.com/scemama/resultsFile.git
synced 2024-11-08 15:13:41 +01:00
Fixed Gamess with symmetry
This commit is contained in:
parent
ca97e90da3
commit
b502a622cc
@ -599,15 +599,19 @@ class gamessFile(resultsFile):
|
|||||||
except IndexError:
|
except IndexError:
|
||||||
return None
|
return None
|
||||||
end = self._pos
|
end = self._pos
|
||||||
pos += 4
|
pos += 2
|
||||||
basis_read = []
|
basis_read = []
|
||||||
|
basis_read_dict = {}
|
||||||
|
atom_label = None
|
||||||
atom = []
|
atom = []
|
||||||
while pos < end:
|
while pos < end:
|
||||||
line = self.text[pos].split()
|
line = self.text[pos].split()
|
||||||
bf = []
|
bf = []
|
||||||
if len(line) == 1:
|
if len(line) == 1:
|
||||||
basis_read.append(atom)
|
basis_read.append(atom)
|
||||||
|
basis_read_dict[atom_label] = atom
|
||||||
atom = []
|
atom = []
|
||||||
|
atom_label = line[0]
|
||||||
while len(line) > 1:
|
while len(line) > 1:
|
||||||
index = int(line[0])
|
index = int(line[0])
|
||||||
sym = line[1]
|
sym = line[1]
|
||||||
@ -625,19 +629,28 @@ class gamessFile(resultsFile):
|
|||||||
pos += 1
|
pos += 1
|
||||||
|
|
||||||
basis_read.append(atom)
|
basis_read.append(atom)
|
||||||
|
basis_read_dict[atom_label] = atom
|
||||||
|
|
||||||
|
# new_basis_read = []
|
||||||
|
# ib = 1
|
||||||
|
# for iatom in range(len(basis_read)):
|
||||||
|
# atom = basis_read[iatom]
|
||||||
|
# for (i, s, b) in atom:
|
||||||
|
# new_basis_read += [ [ib, s, b] ]
|
||||||
|
# ib += 1
|
||||||
|
# if iatom+1 < len(basis_read):
|
||||||
|
# while ib < basis_read[iatom+1][0][0]:
|
||||||
|
# for (i, s, b) in atom:
|
||||||
|
# new_basis_read += [ [ib, s, b] ]
|
||||||
|
# ib += 1
|
||||||
|
#
|
||||||
|
# basis_read = new_basis_read
|
||||||
|
|
||||||
new_basis_read = []
|
new_basis_read = []
|
||||||
ib = 1
|
|
||||||
for iatom in range(len(basis_read)):
|
for iatom in range(len(basis_read)):
|
||||||
atom = basis_read[iatom]
|
atom = basis_read[iatom]
|
||||||
for (i, s, b) in atom:
|
for a in atom:
|
||||||
new_basis_read += [ [ib, s, b] ]
|
new_basis_read += [ a ]
|
||||||
ib += 1
|
|
||||||
if iatom+1 < len(basis_read):
|
|
||||||
while ib < basis_read[iatom+1][0][0]:
|
|
||||||
for (i, s, b) in atom:
|
|
||||||
new_basis_read += [ [ib, s, b] ]
|
|
||||||
ib += 1
|
|
||||||
|
|
||||||
basis_read = new_basis_read
|
basis_read = new_basis_read
|
||||||
|
|
||||||
@ -646,18 +659,15 @@ class gamessFile(resultsFile):
|
|||||||
for b in basis_read:
|
for b in basis_read:
|
||||||
basis[b[0]-1] = [b[1],b[2]]
|
basis[b[0]-1] = [b[1],b[2]]
|
||||||
|
|
||||||
|
# If symmetry is used, rebuild the basis taking the infos of the atoms
|
||||||
|
if None in basis:
|
||||||
|
basis_aux = []
|
||||||
|
for atom in self.geometry:
|
||||||
|
basis_aux += basis_read_dict[atom._name]
|
||||||
|
|
||||||
NotNone = 0
|
for i,b in enumerate(basis):
|
||||||
ReadNone = False
|
if b is None:
|
||||||
for i in range(len(basis)-1,-1,-1):
|
basis[i] = [ basis_aux[i][1], basis_aux[i][2] ]
|
||||||
if basis[i] == None:
|
|
||||||
ReadNone = True
|
|
||||||
basis[i] = list(basis[i+NotNone])
|
|
||||||
else:
|
|
||||||
if ReadNone:
|
|
||||||
NotNone = 0
|
|
||||||
ReadNone = False
|
|
||||||
NotNone += 1
|
|
||||||
|
|
||||||
k=0
|
k=0
|
||||||
while k<len(basis):
|
while k<len(basis):
|
||||||
@ -697,6 +707,7 @@ class gamessFile(resultsFile):
|
|||||||
basis[k][0] = i
|
basis[k][0] = i
|
||||||
k+=1
|
k+=1
|
||||||
|
|
||||||
|
|
||||||
for a,i in enumerate(self.atom_to_ao_range):
|
for a,i in enumerate(self.atom_to_ao_range):
|
||||||
for j in range(i[0]-1,i[1]):
|
for j in range(i[0]-1,i[1]):
|
||||||
basis[j].append(a)
|
basis[j].append(a)
|
||||||
|
Loading…
Reference in New Issue
Block a user