Commits (3)
......@@ -34,6 +34,8 @@ import os
import re
import sys
from nomad.units import ureg
############################################################
# This is the parser for the main file of FHI-aims.
......@@ -593,6 +595,12 @@ class FhiAimsParserContext(object):
if self.dosFound:
self.dosRefSingleConfigurationCalculation = gIndex
self.dosFound = False
try:
fermi_ref = section['x_fhi_aims_energy_reference_fermi'][0]
backend.addArrayValues('energy_reference_fermi', np.array([fermi_ref, fermi_ref]) * ureg.eV)
except:
pass
self.lastCalculationGIndex = gIndex
def onClose_x_fhi_aims_section_eigenvalues_ZORA(self, backend, gIndex, section):
......@@ -1524,7 +1532,7 @@ def build_FhiAimsMainFileSimpleMatcher():
SM (name = 'SectionMethodNoVerbatin',
startReStr = r"\s*Parsing control\.in *(?:\.\.\.|\(first pass over file, find array dimensions only\)\.)",
# startReStr = r"\s*Parsing control\.in \(first pass over file, find array dimensions only\)\.",
# startReStr = r"\s*Parsing control\.in \(first pass over file, find array dimensions only\)\.",
sections = ['section_method'],
subMatchers = [
# parse verbatim writeout of control.in
......@@ -1577,6 +1585,7 @@ def build_FhiAimsMainFileSimpleMatcher():
subMatchers = [
SM (r"\s*Date\s*:\s*(?P<x_fhi_aims_scf_date_start>[-.0-9/]+)\s*,\s*Time\s*:\s*(?P<x_fhi_aims_scf_time_start>[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)"),
SM (r"\s*-{20}-*", weak = True),
SM (r"\s*\| Chemical potential \(Fermi level\):\s*(?P<x_fhi_aims_energy_reference_fermi__eV>[-+]?[0-9]*\.?[0-9]+)\s*eV", name='FermiLevel'),
EigenvaluesGroupSubMatcher,
TotalEnergyScfSubMatcher,
SM (r"\s*End scf initialization - timings\s*:\s*max\(cpu_time\)\s+wall_clock\(cpu1\)"),
......@@ -1609,9 +1618,9 @@ def build_FhiAimsMainFileSimpleMatcher():
SM (r"\s*\|\s*Change of analytical stress\s*:\s*[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)? *eV/A\*\*3")
]), # END SCFConvergence
# after convergence eigenvalues are printed in the end instead of usually in the beginning
# EigenvaluesGroupSubMatcher.copy(), # need copy since SubMatcher already used for ScfInitialization
# SM (r"\s*(?P<x_fhi_aims_single_configuration_calculation_converged>Self-consistency cycle converged)\."),
# SM (r"\s*End self-consistency iteration #\s*[0-9]+\s*:\s*max\(cpu_time\)\s+wall_clock\(cpu1\)")
# EigenvaluesGroupSubMatcher.copy(), # need copy since SubMatcher already used for ScfInitialization
# SM (r"\s*(?P<x_fhi_aims_single_configuration_calculation_converged>Self-consistency cycle converged)\."),
# SM (r"\s*End self-consistency iteration #\s*[0-9]+\s*:\s*max\(cpu_time\)\s+wall_clock\(cpu1\)")
]), # END ScfIteration
SM (name = 'ScfIteration',
startReStr = r"\s*Begin self-consistency iteration #\s*[0-9]+",
......
......@@ -4,6 +4,7 @@ from nomad.metainfo import ( # pylint: disable=unused-import
MSection, MCategory, Category, Package, Quantity, Section, SubSection, SectionProxy,
Reference
)
from nomad.units import ureg
from nomad.metainfo.legacy import LegacyDefinition
from nomad.datamodel.metainfo import public
......@@ -819,6 +820,9 @@ class section_single_configuration_calculation(public.section_single_configurati
repeats=False,
a_legacy=LegacyDefinition(name='x_fhi_aims_section_eigenvalues_ZORA'))
x_fhi_aims_energy_reference_fermi = Quantity(
type=float, unit=ureg.eV, a_legacy=LegacyDefinition(name='x_fhi_aims_energy_reference_fermi'))
class section_scf_iteration(public.section_scf_iteration):
......