Skip to content
Snippets Groups Projects
Commit 5635f871 authored by Adriel Domínguez's avatar Adriel Domínguez
Browse files

added on-close actions for molecule type and eigenvalues sections

parent a0ed1f98
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@ import setup_paths
from builtins import object
from nomadcore.simple_parser import SimpleMatcher as SM, mainFunction
from nomadcore.local_meta_info import loadJsonFile, InfoKindEl
from nomadcore.unit_conversion import unit_conversion
import os, sys, json
import numpy as np
......@@ -27,6 +28,16 @@ class dftb_plusContext(object):
if atom_charge is not None:
backend.addArrayValues('atom_in_molecule_charge', np.asarray(atom_charge))
def onClose_section_eigenvalues(self, backend, gIndex, section):
eigenvalues = section['x_dftbp_eigenvalues_values']
occ = section['x_dftbp_eigenvalues_occupation']
if eigenvalues is not None:
backend.addArrayValues('eigenvalues_values', np.asarray(eigenvalues))
if occ is not None:
backend.addArrayValues('eigenvalues_occupation', np.asarray(occ))
# description of the input
mainFileDescription = SM(
......@@ -73,7 +84,7 @@ mainFileDescription = SM(
sections = ['section_eigenvalues'],
subMatchers = [
SM(r"\s*Eigenvalues /H"),
SM(r"\s*(?P<eigenvalues_values__hartree>[+-]?\d+\.\d+)\s*", repeats = True),
SM(r"\s*(?P<x_dftbp_eigenvalues_values__hartree>[+-]?\d+\.\d+)\s*", repeats = True),
],
),
SM(name = 'eigenvalues_eV',
......@@ -82,7 +93,7 @@ mainFileDescription = SM(
sections = ['section_eigenvalues'],
subMatchers = [
SM(r"\s*Eigenvalues /eV"),
SM(r"\s*(?P<eigenvalues_values>[+-]?\d+\.\d+)\s*", repeats = True),
SM(r"\s*(?P<x_dftbp_eigenvalues_values__eV>[+-]?\d+\.\d+)\s*", repeats = True),
],
),
SM(name = 'Occupations',
......@@ -91,7 +102,7 @@ mainFileDescription = SM(
sections = ['section_eigenvalues'],
subMatchers = [
SM(r"\s*Fillings"),
SM(r"\s*(?P<eigenvalues_occupation>\d+\.\d+)\s*", repeats = True),
SM(r"\s*(?P<x_dftbp_eigenvalues_occupation>\d+\.\d+)\s*", repeats = True),
],
),
SM(name = 'energies',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment