Skip to content
Snippets Groups Projects
Commit 15d0110c authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Fixed broken calc to system refs.

parent 02c301eb
Branches
Tags
No related merge requests found
...@@ -431,7 +431,7 @@ class GaussianParserContext(object): ...@@ -431,7 +431,7 @@ class GaussianParserContext(object):
when the parsing starts and when a section_run closes. when the parsing starts and when a section_run closes.
""" """
self.secMethodIndex = None self.secMethodIndex = None
self.secSystemDescriptionIndex = 0 self.secSystemDescriptionIndex = -1
# start with -1 since zeroth iteration is the initialization # start with -1 since zeroth iteration is the initialization
self.scfIterNr = -1 self.scfIterNr = -1
self.singleConfCalcs = [] self.singleConfCalcs = []
...@@ -449,6 +449,9 @@ class GaussianParserContext(object): ...@@ -449,6 +449,9 @@ class GaussianParserContext(object):
# allows to reset values if the same superContext is used to parse different files # allows to reset values if the same superContext is used to parse different files
self.initialize_values() self.initialize_values()
def onOpen_section_system(self, backend, gIndex, section):
self.secSystemDescriptionIndex = gIndex
def onClose_section_run(self, backend, gIndex, section): def onClose_section_run(self, backend, gIndex, section):
"""Trigger called when section_run is closed. """Trigger called when section_run is closed.
...@@ -494,18 +497,10 @@ class GaussianParserContext(object): ...@@ -494,18 +497,10 @@ class GaussianParserContext(object):
atom_numbers[i] = numbers[i] atom_numbers[i] = numbers[i]
atomic_symbols[i] = ase.data.chemical_symbols[atom_numbers[i]] atomic_symbols[i] = ase.data.chemical_symbols[atom_numbers[i]]
if self.secSystemDescriptionIndex > 0:
self.secSystemDescriptionIndex = backend.openSection("section_system")
backend.addArrayValues("atom_labels", atomic_symbols, self.secSystemDescriptionIndex) backend.addArrayValues("atom_labels", atomic_symbols, self.secSystemDescriptionIndex)
backend.addArrayValues("atom_positions", atom_coords, self.secSystemDescriptionIndex) backend.addArrayValues("atom_positions", atom_coords, self.secSystemDescriptionIndex)
backend.addValue("x_gaussian_number_of_atoms",len(atomic_symbols), self.secSystemDescriptionIndex) backend.addValue("x_gaussian_number_of_atoms",len(atomic_symbols), self.secSystemDescriptionIndex)
if self.secSystemDescriptionIndex > 0:
backend.closeSection("section_system", self.secSystemDescriptionIndex)
else:
self.secSystemDescriptionIndex = 1
def onClose_x_gaussian_section_atom_forces(self, backend, gIndex, section): def onClose_x_gaussian_section_atom_forces(self, backend, gIndex, section):
xForce = section["x_gaussian_atom_x_force"] xForce = section["x_gaussian_atom_x_force"]
yForce = section["x_gaussian_atom_y_force"] yForce = section["x_gaussian_atom_y_force"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment