mirror of
https://gitlab.com/scemama/resultsFile.git
synced 2025-01-03 01:55:53 +01:00
Add pseudo
This commit is contained in:
parent
8b195b3eeb
commit
c68d2bd08b
@ -38,7 +38,7 @@ gamessFile_defined_vars = [ "date", "version", "machine", "memory", "disk",\
|
||||
"Ne_pot_energies", "pot_energies", \
|
||||
"kin_energies", "virials", "point_group", "num_elec", \
|
||||
"charge", "multiplicity","nuclear_energy","dipole","geometry",\
|
||||
"basis","mo_sets","mo_types","mulliken_mo","mulliken_ao",\
|
||||
"basis","pseudo", "mo_sets","mo_types","mulliken_mo","mulliken_ao",\
|
||||
"mulliken_atom","lowdin_ao", "mulliken_atom","lowdin_atom",\
|
||||
"two_e_int_ao", "determinants", "num_alpha", "num_beta",\
|
||||
"closed_mos", "active_mos", "virtual_mos", \
|
||||
@ -1348,6 +1348,59 @@ class gamessFile(resultsFile):
|
||||
pass
|
||||
return self._num_states
|
||||
|
||||
def get_pseudo(self):
|
||||
try:
|
||||
self.find_string('ECP POTENTIALS')
|
||||
except IndexError:
|
||||
raise TypeError('No ECP')
|
||||
else:
|
||||
pos_begin = self._pos
|
||||
|
||||
try:
|
||||
self.find_string('THE ECP RUN REMOVES')
|
||||
except IndexError:
|
||||
raise TypeError('Cannot parse ECP')
|
||||
else:
|
||||
pos_end = self._pos
|
||||
|
||||
raw_str = ''.join(self.text[pos_begin+2:pos_end])
|
||||
l_param_atom = raw_str.split('\n\n')
|
||||
|
||||
import re
|
||||
regex = r"PARAMETERS FOR \"(.*)\" ON ATOM\s+(\d+) WITH ZCORE\s+(\d+) AND LMAX\s+(\d+) ARE"
|
||||
regex_l = r"FOR L=\s+\d+\s+COEFF\s+N\s+ZETA\s*"
|
||||
|
||||
regex_already_existing_atom = r"PARAMETERS FOR \"(.*)\" ON ATOM\s+(\d+) ARE THE SAME AS ATOM\s+(\d+)\s*$"
|
||||
|
||||
d = dict()
|
||||
|
||||
for param in [i for i in l_param_atom if i]:
|
||||
matches = re.findall(regex, param)
|
||||
if matches:
|
||||
name, label,zcore, lmax = matches[0]
|
||||
l_str = ['{0} GEN {1} {2}'.format(name, zcore, lmax)]
|
||||
#l_bloc
|
||||
l_lblock = re.split(regex_l,param)[1:]
|
||||
for l in l_lblock:
|
||||
lignes = [i.strip() for i in l.split('\n') if i.strip()]
|
||||
l_str.append(len(lignes))
|
||||
l_str += lignes
|
||||
l_str.append('')
|
||||
|
||||
d[int(label)] = '\n'.join(map(str,l_str))
|
||||
else:
|
||||
matches = re.findall(regex_already_existing_atom, param)
|
||||
name, label, label_ref = matches[0]
|
||||
d[int(label)] = d[int(label_ref)]
|
||||
|
||||
|
||||
result = ""
|
||||
for i in range(len(d)):
|
||||
result+= d[i+1]
|
||||
result+= '\n'
|
||||
|
||||
return result
|
||||
|
||||
# Properties
|
||||
# ----------
|
||||
to_remove = []
|
||||
|
@ -77,11 +77,13 @@ local_vars = [ \
|
||||
( 'num_beta' , "Number of Beta electrons."),
|
||||
( 'charge' , "Charge of the system."),
|
||||
( 'multiplicity' , "Spin multiplicity of the system."),
|
||||
( 'nuclear_energy', "Repulsion of the nuclei."),
|
||||
( 'nuclear_energy ', "Repulsion of the nuclei."),
|
||||
( 'gradient_energy', "Gradient of the Energy wrt nucl coord."),
|
||||
# Basis set
|
||||
( 'basis' , "Basis set definition"),
|
||||
( 'uncontracted_basis', "Uncontracted Basis set"),
|
||||
# Pseudo
|
||||
('pseudo' , 'Pseudopotential (gamess input format)'),
|
||||
# Orbitals
|
||||
( 'mo_sets' , "List of molecular orbitals"),
|
||||
( 'mo_types' , "Types of molecular orbitals (canonical, natural,...)"),
|
||||
|
Loading…
Reference in New Issue
Block a user