nomad-parser-plugins-electronic 1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- electronicparsers/__init__.py +1162 -0
- electronicparsers/abacus/__init__.py +20 -0
- electronicparsers/abacus/__main__.py +32 -0
- electronicparsers/abacus/metainfo/__init__.py +19 -0
- electronicparsers/abacus/metainfo/abacus.py +836 -0
- electronicparsers/abacus/nomad_plugin.yaml +44 -0
- electronicparsers/abacus/parser.py +1975 -0
- electronicparsers/abinit/__init__.py +19 -0
- electronicparsers/abinit/__main__.py +31 -0
- electronicparsers/abinit/metainfo/__init__.py +20 -0
- electronicparsers/abinit/metainfo/abinit.py +871 -0
- electronicparsers/abinit/metainfo/abinit_autogenerated.py +6794 -0
- electronicparsers/abinit/nomad_plugin.yaml +43 -0
- electronicparsers/abinit/parser.py +1922 -0
- electronicparsers/ams/__init__.py +19 -0
- electronicparsers/ams/__main__.py +31 -0
- electronicparsers/ams/metainfo/__init__.py +19 -0
- electronicparsers/ams/metainfo/ams.py +769 -0
- electronicparsers/ams/nomad_plugin.yaml +19 -0
- electronicparsers/ams/parser.py +1849 -0
- electronicparsers/ams/rkf.py +620 -0
- electronicparsers/atk/__init__.py +19 -0
- electronicparsers/atk/__main__.py +31 -0
- electronicparsers/atk/metainfo/__init__.py +19 -0
- electronicparsers/atk/metainfo/atk.py +71 -0
- electronicparsers/atk/nomad_plugin.yaml +34 -0
- electronicparsers/atk/parser.py +388 -0
- electronicparsers/bigdft/__init__.py +19 -0
- electronicparsers/bigdft/__main__.py +31 -0
- electronicparsers/bigdft/metainfo/__init__.py +18 -0
- electronicparsers/bigdft/nomad_plugin.yaml +19 -0
- electronicparsers/bigdft/parser.py +372 -0
- electronicparsers/castep/__init__.py +19 -0
- electronicparsers/castep/__main__.py +31 -0
- electronicparsers/castep/metainfo/__init__.py +19 -0
- electronicparsers/castep/metainfo/castep.py +2481 -0
- electronicparsers/castep/nomad_plugin.yaml +28 -0
- electronicparsers/castep/parser.py +1680 -0
- electronicparsers/charmm/__init__.py +19 -0
- electronicparsers/charmm/__main__.py +31 -0
- electronicparsers/charmm/metainfo/__init__.py +19 -0
- electronicparsers/charmm/metainfo/charmm.py +1931 -0
- electronicparsers/charmm/nomad_plugin.yaml +18 -0
- electronicparsers/charmm/parser.py +61 -0
- electronicparsers/cp2k/__init__.py +19 -0
- electronicparsers/cp2k/__main__.py +31 -0
- electronicparsers/cp2k/metainfo/__init__.py +19 -0
- electronicparsers/cp2k/metainfo/cp2k.py +59185 -0
- electronicparsers/cp2k/metainfo/cp2k_general.py +1014 -0
- electronicparsers/cp2k/nomad_plugin.yaml +49 -0
- electronicparsers/cp2k/parser.py +2324 -0
- electronicparsers/cpmd/__init__.py +19 -0
- electronicparsers/cpmd/__main__.py +31 -0
- electronicparsers/cpmd/metainfo/__init__.py +19 -0
- electronicparsers/cpmd/metainfo/cpmd.py +10733 -0
- electronicparsers/cpmd/metainfo/cpmd_general.py +988 -0
- electronicparsers/cpmd/nomad_plugin.yaml +19 -0
- electronicparsers/cpmd/parser.py +680 -0
- electronicparsers/crystal/__init__.py +19 -0
- electronicparsers/crystal/__main__.py +31 -0
- electronicparsers/crystal/metainfo/__init__.py +19 -0
- electronicparsers/crystal/metainfo/crystal.py +619 -0
- electronicparsers/crystal/nomad_plugin.yaml +36 -0
- electronicparsers/crystal/parser.py +1745 -0
- electronicparsers/dmol3/__init__.py +19 -0
- electronicparsers/dmol3/__main__.py +31 -0
- electronicparsers/dmol3/metainfo/__init__.py +19 -0
- electronicparsers/dmol3/metainfo/dmol3.py +664 -0
- electronicparsers/dmol3/nomad_plugin.yaml +19 -0
- electronicparsers/dmol3/parser.py +750 -0
- electronicparsers/edmft/__init__.py +19 -0
- electronicparsers/edmft/__main__.py +31 -0
- electronicparsers/edmft/metainfo/__init__.py +19 -0
- electronicparsers/edmft/metainfo/edmft.py +96 -0
- electronicparsers/edmft/nomad_plugin.yaml +53 -0
- electronicparsers/edmft/parser.py +912 -0
- electronicparsers/elk/__init__.py +19 -0
- electronicparsers/elk/__main__.py +31 -0
- electronicparsers/elk/metainfo/__init__.py +19 -0
- electronicparsers/elk/metainfo/elk.py +775 -0
- electronicparsers/elk/nomad_plugin.yaml +19 -0
- electronicparsers/elk/parser.py +493 -0
- electronicparsers/exciting/__init__.py +19 -0
- electronicparsers/exciting/__main__.py +31 -0
- electronicparsers/exciting/metainfo/__init__.py +19 -0
- electronicparsers/exciting/metainfo/exciting.py +2942 -0
- electronicparsers/exciting/nomad_plugin.yaml +83 -0
- electronicparsers/exciting/parser.py +3398 -0
- electronicparsers/fhiaims/__init__.py +19 -0
- electronicparsers/fhiaims/__main__.py +31 -0
- electronicparsers/fhiaims/metainfo/__init__.py +19 -0
- electronicparsers/fhiaims/metainfo/fhi_aims.py +1565 -0
- electronicparsers/fhiaims/nomad_plugin.yaml +52 -0
- electronicparsers/fhiaims/parser.py +2582 -0
- electronicparsers/fleur/__init__.py +19 -0
- electronicparsers/fleur/__main__.py +31 -0
- electronicparsers/fleur/metainfo/__init__.py +19 -0
- electronicparsers/fleur/metainfo/fleur.py +623 -0
- electronicparsers/fleur/nomad_plugin.yaml +19 -0
- electronicparsers/fleur/parser.py +952 -0
- electronicparsers/fplo/__init__.py +19 -0
- electronicparsers/fplo/__main__.py +31 -0
- electronicparsers/fplo/metainfo/__init__.py +19 -0
- electronicparsers/fplo/metainfo/fplo.py +188 -0
- electronicparsers/fplo/metainfo/fplo_input_autogenerated.py +2744 -0
- electronicparsers/fplo/metainfo/fplo_temporaries.py +319 -0
- electronicparsers/fplo/nomad_plugin.yaml +19 -0
- electronicparsers/fplo/parser.py +42 -0
- electronicparsers/gamess/__init__.py +19 -0
- electronicparsers/gamess/__main__.py +31 -0
- electronicparsers/gamess/metainfo/__init__.py +19 -0
- electronicparsers/gamess/metainfo/gamess.py +837 -0
- electronicparsers/gamess/nomad_plugin.yaml +19 -0
- electronicparsers/gamess/parser.py +941 -0
- electronicparsers/gaussian/__init__.py +19 -0
- electronicparsers/gaussian/__main__.py +31 -0
- electronicparsers/gaussian/metainfo/__init__.py +19 -0
- electronicparsers/gaussian/metainfo/gaussian.py +1707 -0
- electronicparsers/gaussian/nomad_plugin.yaml +18 -0
- electronicparsers/gaussian/parser.py +1556 -0
- electronicparsers/gpaw/__init__.py +19 -0
- electronicparsers/gpaw/__main__.py +31 -0
- electronicparsers/gpaw/metainfo/__init__.py +19 -0
- electronicparsers/gpaw/metainfo/gpaw.py +214 -0
- electronicparsers/gpaw/nomad_plugin.yaml +19 -0
- electronicparsers/gpaw/parser.py +671 -0
- electronicparsers/magres/__init__.py +19 -0
- electronicparsers/magres/__main__.py +31 -0
- electronicparsers/magres/metainfo/__init__.py +19 -0
- electronicparsers/magres/metainfo/magres.py +110 -0
- electronicparsers/magres/nomad_plugin.yaml +18 -0
- electronicparsers/magres/parser.py +505 -0
- electronicparsers/molcas/__init__.py +19 -0
- electronicparsers/molcas/__main__.py +31 -0
- electronicparsers/molcas/metainfo/__init__.py +19 -0
- electronicparsers/molcas/metainfo/molcas.py +151 -0
- electronicparsers/molcas/nomad_plugin.yaml +19 -0
- electronicparsers/molcas/parser.py +59 -0
- electronicparsers/mopac/__init__.py +19 -0
- electronicparsers/mopac/__main__.py +31 -0
- electronicparsers/mopac/metainfo/__init__.py +19 -0
- electronicparsers/mopac/metainfo/mopac.py +79 -0
- electronicparsers/mopac/nomad_plugin.yaml +19 -0
- electronicparsers/mopac/parser.py +304 -0
- electronicparsers/nwchem/__init__.py +19 -0
- electronicparsers/nwchem/__main__.py +31 -0
- electronicparsers/nwchem/metainfo/__init__.py +19 -0
- electronicparsers/nwchem/metainfo/nwchem.py +487 -0
- electronicparsers/nwchem/nomad_plugin.yaml +19 -0
- electronicparsers/nwchem/parser.py +757 -0
- electronicparsers/ocean/__init__.py +19 -0
- electronicparsers/ocean/__main__.py +31 -0
- electronicparsers/ocean/metainfo/__init__.py +19 -0
- electronicparsers/ocean/metainfo/ocean.py +410 -0
- electronicparsers/ocean/nomad_plugin.yaml +37 -0
- electronicparsers/ocean/parser.py +344 -0
- electronicparsers/octopus/__init__.py +19 -0
- electronicparsers/octopus/__main__.py +31 -0
- electronicparsers/octopus/metainfo/__init__.py +19 -0
- electronicparsers/octopus/metainfo/octopus.py +71 -0
- electronicparsers/octopus/metainfo/octopus_autogenerated.py +11647 -0
- electronicparsers/octopus/nomad_plugin.yaml +41 -0
- electronicparsers/octopus/parser.py +1214 -0
- electronicparsers/onetep/__init__.py +19 -0
- electronicparsers/onetep/__main__.py +31 -0
- electronicparsers/onetep/metainfo/__init__.py +19 -0
- electronicparsers/onetep/metainfo/onetep.py +3443 -0
- electronicparsers/onetep/nomad_plugin.yaml +19 -0
- electronicparsers/onetep/parser.py +577 -0
- electronicparsers/openmx/__init__.py +19 -0
- electronicparsers/openmx/__main__.py +31 -0
- electronicparsers/openmx/metainfo/__init__.py +19 -0
- electronicparsers/openmx/metainfo/openmx.py +24 -0
- electronicparsers/openmx/nomad_plugin.yaml +25 -0
- electronicparsers/openmx/parser.py +918 -0
- electronicparsers/orca/__init__.py +19 -0
- electronicparsers/orca/__main__.py +31 -0
- electronicparsers/orca/metainfo/__init__.py +19 -0
- electronicparsers/orca/metainfo/orca.py +1448 -0
- electronicparsers/orca/nomad_plugin.yaml +19 -0
- electronicparsers/orca/parser.py +1371 -0
- electronicparsers/psi4/__init__.py +19 -0
- electronicparsers/psi4/__main__.py +31 -0
- electronicparsers/psi4/metainfo/__init__.py +19 -0
- electronicparsers/psi4/metainfo/psi4.py +372 -0
- electronicparsers/psi4/nomad_plugin.yaml +27 -0
- electronicparsers/psi4/parser.py +1362 -0
- electronicparsers/qball/__init__.py +19 -0
- electronicparsers/qball/__main__.py +31 -0
- electronicparsers/qball/metainfo/__init__.py +19 -0
- electronicparsers/qball/metainfo/qball.py +27 -0
- electronicparsers/qball/nomad_plugin.yaml +25 -0
- electronicparsers/qball/parser.py +152 -0
- electronicparsers/qbox/__init__.py +19 -0
- electronicparsers/qbox/__main__.py +31 -0
- electronicparsers/qbox/metainfo/__init__.py +19 -0
- electronicparsers/qbox/metainfo/qbox.py +490 -0
- electronicparsers/qbox/nomad_plugin.yaml +19 -0
- electronicparsers/qbox/parser.py +508 -0
- electronicparsers/quantumespresso/__init__.py +19 -0
- electronicparsers/quantumespresso/__main__.py +31 -0
- electronicparsers/quantumespresso/metainfo/__init__.py +19 -0
- electronicparsers/quantumespresso/metainfo/quantum_espresso.py +3296 -0
- electronicparsers/quantumespresso/nomad_plugin.yaml +31 -0
- electronicparsers/quantumespresso/parser.py +3594 -0
- electronicparsers/siesta/__init__.py +19 -0
- electronicparsers/siesta/__main__.py +31 -0
- electronicparsers/siesta/metainfo/__init__.py +19 -0
- electronicparsers/siesta/metainfo/siesta.py +141 -0
- electronicparsers/siesta/metainfo/siesta_autogenerated.py +3365 -0
- electronicparsers/siesta/nomad_plugin.yaml +19 -0
- electronicparsers/siesta/parser.py +607 -0
- electronicparsers/soliddmft/__init__.py +19 -0
- electronicparsers/soliddmft/__main__.py +31 -0
- electronicparsers/soliddmft/metainfo/__init__.py +19 -0
- electronicparsers/soliddmft/metainfo/soliddmft.py +274 -0
- electronicparsers/soliddmft/nomad_plugin.yaml +26 -0
- electronicparsers/soliddmft/parser.py +727 -0
- electronicparsers/tbstudio/__init__.py +19 -0
- electronicparsers/tbstudio/__main__.py +31 -0
- electronicparsers/tbstudio/metainfo/__init__.py +19 -0
- electronicparsers/tbstudio/metainfo/tbstudio.py +34 -0
- electronicparsers/tbstudio/nomad_plugin.yaml +24 -0
- electronicparsers/tbstudio/parser.py +412 -0
- electronicparsers/turbomole/__init__.py +19 -0
- electronicparsers/turbomole/__main__.py +31 -0
- electronicparsers/turbomole/metainfo/__init__.py +19 -0
- electronicparsers/turbomole/metainfo/turbomole.py +727 -0
- electronicparsers/turbomole/nomad_plugin.yaml +18 -0
- electronicparsers/turbomole/parser.py +1585 -0
- electronicparsers/utils/__init__.py +20 -0
- electronicparsers/utils/magres_workflow.py +61 -0
- electronicparsers/utils/utils.py +636 -0
- electronicparsers/vasp/__init__.py +19 -0
- electronicparsers/vasp/__main__.py +31 -0
- electronicparsers/vasp/metainfo/__init__.py +19 -0
- electronicparsers/vasp/metainfo/vasp.py +169 -0
- electronicparsers/vasp/metainfo/vasp_incars.py +3428 -0
- electronicparsers/vasp/metainfo/vasp_incarsOut.py +3428 -0
- electronicparsers/vasp/metainfo/vasp_incarsUnknown.py +86 -0
- electronicparsers/vasp/nomad_plugin.yaml +28 -0
- electronicparsers/vasp/parser.py +2340 -0
- electronicparsers/w2dynamics/__init__.py +19 -0
- electronicparsers/w2dynamics/__main__.py +31 -0
- electronicparsers/w2dynamics/metainfo/__init__.py +19 -0
- electronicparsers/w2dynamics/metainfo/w2dynamics.py +1270 -0
- electronicparsers/w2dynamics/nomad_plugin.yaml +36 -0
- electronicparsers/w2dynamics/parser.py +674 -0
- electronicparsers/wannier90/__init__.py +19 -0
- electronicparsers/wannier90/__main__.py +31 -0
- electronicparsers/wannier90/metainfo/__init__.py +19 -0
- electronicparsers/wannier90/metainfo/wannier90.py +56 -0
- electronicparsers/wannier90/nomad_plugin.yaml +34 -0
- electronicparsers/wannier90/parser.py +671 -0
- electronicparsers/wien2k/__init__.py +19 -0
- electronicparsers/wien2k/__main__.py +31 -0
- electronicparsers/wien2k/metainfo/__init__.py +19 -0
- electronicparsers/wien2k/metainfo/wien2k.py +783 -0
- electronicparsers/wien2k/nomad_plugin.yaml +18 -0
- electronicparsers/wien2k/parser.py +1133 -0
- electronicparsers/yambo/__init__.py +19 -0
- electronicparsers/yambo/__main__.py +31 -0
- electronicparsers/yambo/metainfo/__init__.py +19 -0
- electronicparsers/yambo/metainfo/yambo.py +577 -0
- electronicparsers/yambo/nomad_plugin.yaml +31 -0
- electronicparsers/yambo/parser.py +896 -0
- nomad_parser_plugins_electronic-1.0.dist-info/LICENSE +202 -0
- nomad_parser_plugins_electronic-1.0.dist-info/METADATA +360 -0
- nomad_parser_plugins_electronic-1.0.dist-info/RECORD +272 -0
- nomad_parser_plugins_electronic-1.0.dist-info/WHEEL +5 -0
- nomad_parser_plugins_electronic-1.0.dist-info/entry_points.txt +43 -0
- nomad_parser_plugins_electronic-1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
code_category: Atomistic code
|
|
2
|
+
code_homepage: https://siesta-project.org/siesta
|
|
3
|
+
code_name: SIESTA
|
|
4
|
+
metadata:
|
|
5
|
+
codeCategory: Atomistic code
|
|
6
|
+
codeLabel: SIESTA
|
|
7
|
+
codeLabelStyle: All in capitals
|
|
8
|
+
codeName: siesta
|
|
9
|
+
codeUrl: https://siesta-project.org/siesta
|
|
10
|
+
parserDirName: dependencies/electronic/electronicparsers/siesta/
|
|
11
|
+
parserGitUrl: https://github.com/nomad-coe/electronic-parsers.git
|
|
12
|
+
parserSpecific: ''
|
|
13
|
+
preamble: ''
|
|
14
|
+
status: production
|
|
15
|
+
tableOfFiles: ''
|
|
16
|
+
name: parsers/siesta
|
|
17
|
+
parser_class_name: electronicparsers.siesta.parser.SiestaParser
|
|
18
|
+
python_package: electronicparsers.siesta
|
|
19
|
+
plugin_source_code_url: https://github.com/nomad-coe/electronic-parsers/tree/develop/electronicparsers/siesta
|
|
@@ -0,0 +1,607 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Copyright The NOMAD Authors.
|
|
3
|
+
#
|
|
4
|
+
# This file is part of NOMAD.
|
|
5
|
+
# See https://nomad-lab.eu for further info.
|
|
6
|
+
#
|
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
# you may not use this file except in compliance with the License.
|
|
9
|
+
# You may obtain a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
# See the License for the specific language governing permissions and
|
|
17
|
+
# limitations under the License.
|
|
18
|
+
#
|
|
19
|
+
import os
|
|
20
|
+
import logging
|
|
21
|
+
import numpy as np
|
|
22
|
+
from datetime import datetime
|
|
23
|
+
|
|
24
|
+
from nomad.units import ureg
|
|
25
|
+
from nomad.parsing.file_parser import TextParser, Quantity
|
|
26
|
+
from runschema.run import Run, Program, TimeRun
|
|
27
|
+
from runschema.method import (
|
|
28
|
+
Method,
|
|
29
|
+
DFT,
|
|
30
|
+
XCFunctional,
|
|
31
|
+
Functional,
|
|
32
|
+
BasisSet,
|
|
33
|
+
BasisSetContainer,
|
|
34
|
+
)
|
|
35
|
+
from runschema.system import System, Atoms
|
|
36
|
+
from runschema.calculation import (
|
|
37
|
+
Calculation,
|
|
38
|
+
Energy,
|
|
39
|
+
EnergyEntry,
|
|
40
|
+
ScfIteration,
|
|
41
|
+
Forces,
|
|
42
|
+
ForcesEntry,
|
|
43
|
+
Stress,
|
|
44
|
+
StressEntry,
|
|
45
|
+
Multipoles,
|
|
46
|
+
MultipolesEntry,
|
|
47
|
+
Charges,
|
|
48
|
+
ChargesValue,
|
|
49
|
+
)
|
|
50
|
+
from simulationworkflowschema import GeometryOptimization, SinglePoint
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
re_n = r'[\n\r]'
|
|
54
|
+
re_f = r'[-+]?\d+\.\d*(?:[DdEe][-+]\d+)?'
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class FDFParser(TextParser):
|
|
58
|
+
def init_quantities(self):
|
|
59
|
+
def to_parameter(val_in):
|
|
60
|
+
key, val = val_in.strip().split(' ', 1)
|
|
61
|
+
if val[0].isdecimal() or val[0] == '-':
|
|
62
|
+
val = val.split()[0]
|
|
63
|
+
elif val.lower() in ['true', 'false']:
|
|
64
|
+
val = val == 'true'
|
|
65
|
+
return [key, val]
|
|
66
|
+
|
|
67
|
+
def to_block(val_in):
|
|
68
|
+
key, val = val_in.strip().split(' ', 1)
|
|
69
|
+
return [key, [v.strip().split() for v in val.strip().splitlines()]]
|
|
70
|
+
|
|
71
|
+
self._quantities = [
|
|
72
|
+
Quantity(
|
|
73
|
+
'parameter',
|
|
74
|
+
rf'([A-Za-z][\w\.]+) +([ \w\.\/]+?)(?:\#|{re_n})',
|
|
75
|
+
repeats=True,
|
|
76
|
+
str_operation=to_parameter,
|
|
77
|
+
),
|
|
78
|
+
Quantity(
|
|
79
|
+
'block',
|
|
80
|
+
rf'\%block ([A-Za-z][\w\.]+)\s+([\s\S]+?)\%endblock',
|
|
81
|
+
repeats=True,
|
|
82
|
+
str_operation=to_block,
|
|
83
|
+
),
|
|
84
|
+
]
|
|
85
|
+
|
|
86
|
+
def parse(self, key=None):
|
|
87
|
+
super().parse(key)
|
|
88
|
+
|
|
89
|
+
# add atoms info
|
|
90
|
+
species, coordinates, lattice_vectors = None, None, None
|
|
91
|
+
parameters = {key: val for key, val in self._results.get('parameter', [])}
|
|
92
|
+
self._results['parameters'] = parameters
|
|
93
|
+
|
|
94
|
+
# scaling of the lattice vectors
|
|
95
|
+
lattice_constant = parameters.get('LatticeConstant', 1.0) * ureg.angstrom
|
|
96
|
+
# units of the atomic coordinates
|
|
97
|
+
coordinates_format = parameters.get('AtomicCoordinatesFormat')
|
|
98
|
+
|
|
99
|
+
for block in self._results.get('block', []):
|
|
100
|
+
if block[0] == 'ChemicalSpeciesLabel':
|
|
101
|
+
species = [b[2] for b in block[1]]
|
|
102
|
+
elif block[0] == 'LatticeVectors':
|
|
103
|
+
lattice_vectors = block[1] * lattice_constant
|
|
104
|
+
elif block[0] == 'AtomicCoordinatesAndAtomicSpecies':
|
|
105
|
+
coordinates = np.array([b[0:3] for b in block[1]], dtype=np.float64)
|
|
106
|
+
|
|
107
|
+
self._results['positions'] = coordinates
|
|
108
|
+
self._results['labels'] = species
|
|
109
|
+
self._results['lattice_vectors'] = lattice_vectors
|
|
110
|
+
self._results['coordinates_format'] = coordinates_format
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
class OutParser(TextParser):
|
|
114
|
+
def init_quantities(self):
|
|
115
|
+
def to_stress_tensor(val_in):
|
|
116
|
+
val = val_in.strip().split()
|
|
117
|
+
stress = np.zeros((3, 3))
|
|
118
|
+
stress[0][0] = val[0]
|
|
119
|
+
stress[1][1] = val[1]
|
|
120
|
+
stress[2][2] = val[2]
|
|
121
|
+
stress[0][1] = stress[1][0] = val[3]
|
|
122
|
+
stress[1][2] = stress[2][1] = val[4]
|
|
123
|
+
stress[0][2] = stress[2][0] = val[5]
|
|
124
|
+
return stress * ureg.kbar
|
|
125
|
+
|
|
126
|
+
calc_quantities = [
|
|
127
|
+
Quantity(
|
|
128
|
+
'lattice_vectors',
|
|
129
|
+
r'outcell\: Unit cell vectors \(Ang\)\:\s+([\s\d\.\-]+)',
|
|
130
|
+
shape=(3, 3),
|
|
131
|
+
dtype=np.dtype(np.float64),
|
|
132
|
+
unit=ureg.angstrom,
|
|
133
|
+
),
|
|
134
|
+
Quantity(
|
|
135
|
+
'atoms',
|
|
136
|
+
r'outcoor: Atomic coordinates(.+[\s\w\.\-]+)',
|
|
137
|
+
sub_parser=TextParser(
|
|
138
|
+
quantities=[
|
|
139
|
+
Quantity('coordinates_format', r'\((\S+)\)', dtype=str),
|
|
140
|
+
Quantity('labels', r' +([A-Z][a-z]*)', repeats=True, dtype=str),
|
|
141
|
+
Quantity(
|
|
142
|
+
'positions',
|
|
143
|
+
rf'({re_f} +{re_f} +{re_f})',
|
|
144
|
+
repeats=True,
|
|
145
|
+
dtype=np.dtype(np.float64),
|
|
146
|
+
),
|
|
147
|
+
]
|
|
148
|
+
),
|
|
149
|
+
),
|
|
150
|
+
Quantity(
|
|
151
|
+
'energy',
|
|
152
|
+
rf'Program\'s energy decomposition \(eV\)\:([\s\S]+?){re_n} *{re_n}',
|
|
153
|
+
sub_parser=TextParser(
|
|
154
|
+
quantities=[
|
|
155
|
+
Quantity(
|
|
156
|
+
'contribution',
|
|
157
|
+
rf'siesta\: +(\S+) *= *({re_f})',
|
|
158
|
+
repeats=True,
|
|
159
|
+
)
|
|
160
|
+
]
|
|
161
|
+
),
|
|
162
|
+
),
|
|
163
|
+
Quantity(
|
|
164
|
+
'scf',
|
|
165
|
+
rf'scf\: iscf +Eharris\(eV\).+([\s\S]+?){re_n} *{re_n}',
|
|
166
|
+
sub_parser=TextParser(
|
|
167
|
+
quantities=[
|
|
168
|
+
Quantity(
|
|
169
|
+
'step',
|
|
170
|
+
rf'scf\: +\d+ +({re_f} +{re_f} +{re_f} +{re_f} +{re_f})',
|
|
171
|
+
repeats=True,
|
|
172
|
+
dtype=np.dtype(np.float64),
|
|
173
|
+
)
|
|
174
|
+
]
|
|
175
|
+
),
|
|
176
|
+
),
|
|
177
|
+
Quantity(
|
|
178
|
+
'energy_total',
|
|
179
|
+
rf'siesta\: E_KS\(eV\) = +({re_f})',
|
|
180
|
+
dtype=np.float64,
|
|
181
|
+
unit=ureg.eV,
|
|
182
|
+
),
|
|
183
|
+
Quantity(
|
|
184
|
+
'energy',
|
|
185
|
+
rf'Final energy \(eV\)\:([\s\S]+?Total.+)',
|
|
186
|
+
sub_parser=TextParser(
|
|
187
|
+
quantities=[
|
|
188
|
+
Quantity(
|
|
189
|
+
'contribution',
|
|
190
|
+
rf'siesta: +([ \w\.\-]+?) *= *({re_f})',
|
|
191
|
+
repeats=True,
|
|
192
|
+
str_operation=lambda x: [
|
|
193
|
+
v.strip() for v in x.rsplit(' ', 1)
|
|
194
|
+
],
|
|
195
|
+
)
|
|
196
|
+
]
|
|
197
|
+
),
|
|
198
|
+
),
|
|
199
|
+
Quantity(
|
|
200
|
+
'forces',
|
|
201
|
+
r'siesta\: Atomic forces \(eV/Ang\)\:([\s\S]+?Tot.+)',
|
|
202
|
+
sub_parser=TextParser(
|
|
203
|
+
quantities=[
|
|
204
|
+
Quantity(
|
|
205
|
+
'atomic',
|
|
206
|
+
rf'\d+ +({re_f} +{re_f} +{re_f})',
|
|
207
|
+
repeats=True,
|
|
208
|
+
dtype=np.dtype(np.float64),
|
|
209
|
+
)
|
|
210
|
+
]
|
|
211
|
+
),
|
|
212
|
+
),
|
|
213
|
+
Quantity(
|
|
214
|
+
'stress_tensor',
|
|
215
|
+
rf'Stress\-tensor\-Voigt \(kbar\)\: +({re_f} +{re_f} +{re_f} +{re_f} +{re_f} +{re_f})',
|
|
216
|
+
str_operation=to_stress_tensor,
|
|
217
|
+
),
|
|
218
|
+
Quantity(
|
|
219
|
+
'stress_tensor',
|
|
220
|
+
rf'Stress tensor \(static\) \(eV/Ang\*\*3\)\:([\s\S]+?){re_n} *{re_n}',
|
|
221
|
+
str_operation=lambda x: [
|
|
222
|
+
v.strip().split()[1:4] for v in x.strip().splitlines()
|
|
223
|
+
],
|
|
224
|
+
dtype=np.dtype(np.float64),
|
|
225
|
+
unit=ureg.eV / ureg.angstrom**3,
|
|
226
|
+
),
|
|
227
|
+
Quantity(
|
|
228
|
+
'electric_dipole',
|
|
229
|
+
rf'Electric dipole \(Debye\) += +({re_f} +{re_f} +{re_f})',
|
|
230
|
+
dtype=np.dtype(np.float64),
|
|
231
|
+
),
|
|
232
|
+
Quantity(
|
|
233
|
+
'mulliken',
|
|
234
|
+
r'mulliken\: Atomic and Orbital Populations\:([\s\S]+?)siesta\:',
|
|
235
|
+
sub_parser=TextParser(
|
|
236
|
+
quantities=[
|
|
237
|
+
Quantity(
|
|
238
|
+
'atom',
|
|
239
|
+
rf'(Species\:[\s\S]+?){re_n} *{re_n}',
|
|
240
|
+
repeats=True,
|
|
241
|
+
sub_parser=TextParser(
|
|
242
|
+
quantities=[
|
|
243
|
+
Quantity('label', r'Species\: *(\S+)', dtype=str),
|
|
244
|
+
Quantity(
|
|
245
|
+
'orbital',
|
|
246
|
+
r'(\d[spdSPD]\S*) ',
|
|
247
|
+
dtype=str,
|
|
248
|
+
repeats=True,
|
|
249
|
+
),
|
|
250
|
+
Quantity(
|
|
251
|
+
'values',
|
|
252
|
+
rf'(\d+ +{re_f} +{re_f}[\d\.\-\s]+)',
|
|
253
|
+
dtype=np.dtype(np.float64),
|
|
254
|
+
),
|
|
255
|
+
]
|
|
256
|
+
),
|
|
257
|
+
),
|
|
258
|
+
Quantity('spin', r'(Spin DOWN)', str_operation=lambda x: 2),
|
|
259
|
+
Quantity(
|
|
260
|
+
'q_tot',
|
|
261
|
+
rf'Qtot = +({re_f})',
|
|
262
|
+
repeats=True,
|
|
263
|
+
dtype=np.float64,
|
|
264
|
+
),
|
|
265
|
+
]
|
|
266
|
+
),
|
|
267
|
+
),
|
|
268
|
+
]
|
|
269
|
+
|
|
270
|
+
self._quantities = [
|
|
271
|
+
Quantity(
|
|
272
|
+
'header',
|
|
273
|
+
r'(S[\s\S]+?)\*',
|
|
274
|
+
sub_parser=TextParser(
|
|
275
|
+
quantities=[
|
|
276
|
+
Quantity(
|
|
277
|
+
'program_version',
|
|
278
|
+
r'(?:SIESTA|Siesta Version:) *(.+)',
|
|
279
|
+
flatten=False,
|
|
280
|
+
dtype=str,
|
|
281
|
+
),
|
|
282
|
+
Quantity(
|
|
283
|
+
'x_siesta_arch',
|
|
284
|
+
r'Architecture *: +(.+)',
|
|
285
|
+
flatten=False,
|
|
286
|
+
dtype=str,
|
|
287
|
+
),
|
|
288
|
+
Quantity(
|
|
289
|
+
'x_siesta_compiler_flags',
|
|
290
|
+
r'Compiler flags *: +(.+)',
|
|
291
|
+
flatten=False,
|
|
292
|
+
dtype=str,
|
|
293
|
+
),
|
|
294
|
+
Quantity(
|
|
295
|
+
'x_siesta_parallel',
|
|
296
|
+
r'(PARALLEL) version',
|
|
297
|
+
str_operation=lambda x: True,
|
|
298
|
+
),
|
|
299
|
+
]
|
|
300
|
+
),
|
|
301
|
+
),
|
|
302
|
+
Quantity(
|
|
303
|
+
'input_data_file',
|
|
304
|
+
r'(Dump of input data file.+[\s\S]+?End of input data file)',
|
|
305
|
+
flatten=False,
|
|
306
|
+
dtype=str,
|
|
307
|
+
),
|
|
308
|
+
Quantity(
|
|
309
|
+
'simulation_parameters',
|
|
310
|
+
r'Simulation parameters.+([\s\S]+?)\*{10}',
|
|
311
|
+
sub_parser=TextParser(
|
|
312
|
+
quantities=[
|
|
313
|
+
Quantity(
|
|
314
|
+
'redata',
|
|
315
|
+
r'redata\: (.+?= +\S+)',
|
|
316
|
+
str_operation=lambda x: [v.strip() for v in x.rsplit('=')],
|
|
317
|
+
repeats=True,
|
|
318
|
+
)
|
|
319
|
+
]
|
|
320
|
+
),
|
|
321
|
+
),
|
|
322
|
+
Quantity('x_siesta_n_nodes', r'Running on +(\d+) nodes', dtype=np.int32),
|
|
323
|
+
Quantity(
|
|
324
|
+
'run_start',
|
|
325
|
+
r'Start of run: +(\d+-[A-Z]+-\d+) +(\d+:\d+:\d+)',
|
|
326
|
+
flatten=False,
|
|
327
|
+
dtype=str,
|
|
328
|
+
),
|
|
329
|
+
Quantity(
|
|
330
|
+
'run_end',
|
|
331
|
+
r'End of run: +(\d+-[A-Z]+-\d+) +(\d+:\d+:\d+)',
|
|
332
|
+
flatten=False,
|
|
333
|
+
dtype=str,
|
|
334
|
+
),
|
|
335
|
+
Quantity(
|
|
336
|
+
'single_point',
|
|
337
|
+
r'(Single\-point calculation[\s\S]+?Target enthalpy.+)',
|
|
338
|
+
sub_parser=TextParser(quantities=calc_quantities),
|
|
339
|
+
),
|
|
340
|
+
Quantity(
|
|
341
|
+
'geometry_optimization',
|
|
342
|
+
r'\={5}\s+(Begin[\s\S]+?)outcoor\: Re',
|
|
343
|
+
sub_parser=TextParser(
|
|
344
|
+
quantities=[
|
|
345
|
+
Quantity(
|
|
346
|
+
'step',
|
|
347
|
+
r'(Begin.+?opt\. move += +\d+[\s\S]+?Target enthalpy.+)',
|
|
348
|
+
repeats=True,
|
|
349
|
+
sub_parser=TextParser(quantities=calc_quantities),
|
|
350
|
+
)
|
|
351
|
+
]
|
|
352
|
+
),
|
|
353
|
+
),
|
|
354
|
+
] + calc_quantities
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
class SiestaParser:
|
|
358
|
+
def __init__(self):
|
|
359
|
+
self.out_parser = OutParser()
|
|
360
|
+
self.fdf_parser = FDFParser()
|
|
361
|
+
self._xc_map = {
|
|
362
|
+
'ca': ('LDA_X', 'LDA_C_PZ'),
|
|
363
|
+
'pz': ('LDA_X', 'LDA_C_PZ'),
|
|
364
|
+
'pw92': ('LDA_X', 'LDA_C_PW'),
|
|
365
|
+
# TODO 'PW91': '',
|
|
366
|
+
'pbe': ('GGA_X_PBE', 'GGA_C_PBE'),
|
|
367
|
+
'revpbe': ('GGA_X_PBE_R', 'GGA_C_PBE'),
|
|
368
|
+
'rpbe': ('GGA_X_RPBE', 'GGA_C_PBE'),
|
|
369
|
+
# TODO 'WC': ('GGA_X_WC', ),
|
|
370
|
+
'am05': ('GGA_X_AM05', 'GGA_C_AM05'),
|
|
371
|
+
'pbesol': ('GGA_X_PBE_SOL', 'GGA_C_PBE_SOL'),
|
|
372
|
+
'blyp': ('GGA_X_B88', 'GGA_C_LYP'),
|
|
373
|
+
'df1': ('gga_x_pbe_r', 'vdw_c_df1'),
|
|
374
|
+
'drsll': ('gga_x_pbe_r', 'vdw_c_df1'),
|
|
375
|
+
'lmkll': ('gga_x_rpw86', 'vdw_c_df2'),
|
|
376
|
+
'df2': ('gga_x_rpw86', 'vdw_c_df2'),
|
|
377
|
+
'kbm': ('GGA_X_OPTB88_VDW', 'vdw_c_df1'),
|
|
378
|
+
'c09': ('GGA_X_C09X', 'vdw_c_df1'),
|
|
379
|
+
'bh': ('GGA_X_LV_RPW86', 'vdw_c_df1'),
|
|
380
|
+
}
|
|
381
|
+
self._metainfo_map = {
|
|
382
|
+
'Etot': 'total',
|
|
383
|
+
'FreeEng': 'free',
|
|
384
|
+
'Exc': 'xc',
|
|
385
|
+
'Band Struct.': 'sum_eigenvalues',
|
|
386
|
+
'Hartree': 'electrostatic',
|
|
387
|
+
'Exch.-corr.': 'xc',
|
|
388
|
+
'Ion-ion': 'nuclear_repulsion',
|
|
389
|
+
'Total': 'total',
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
def init_parser(self):
|
|
393
|
+
self.out_parser.mainfile = self.filepath
|
|
394
|
+
self.out_parser.logger = self.logger
|
|
395
|
+
self.fdf_parser.logger = self.logger
|
|
396
|
+
self._files = os.listdir(self.maindir)
|
|
397
|
+
|
|
398
|
+
def parse(self, filepath, archive, logger):
|
|
399
|
+
self.filepath = os.path.abspath(filepath)
|
|
400
|
+
self.archive = archive
|
|
401
|
+
self.logger = logging.getLogger(__name__) if logger is None else logger
|
|
402
|
+
self.maindir = os.path.dirname(self.filepath)
|
|
403
|
+
self.init_parser()
|
|
404
|
+
|
|
405
|
+
sec_run = Run()
|
|
406
|
+
archive.run.append(sec_run)
|
|
407
|
+
header = self.out_parser.get('header')
|
|
408
|
+
if header is not None:
|
|
409
|
+
sec_run.program = Program(name='Siesta', version=header.program_version)
|
|
410
|
+
for key, val in header.items():
|
|
411
|
+
if key.startswith('x_siesta'):
|
|
412
|
+
setattr(sec_run, key, val)
|
|
413
|
+
|
|
414
|
+
for key, val in self.out_parser.items():
|
|
415
|
+
if key.startswith('x_siesta'):
|
|
416
|
+
setattr(sec_run, key, val)
|
|
417
|
+
|
|
418
|
+
def get_date(time):
|
|
419
|
+
if time is None:
|
|
420
|
+
return
|
|
421
|
+
return datetime.strptime(time, '%d-%b-%Y %H:%M:%S').timestamp()
|
|
422
|
+
|
|
423
|
+
sec_run.time_run = TimeRun(
|
|
424
|
+
date_start=get_date(self.out_parser.run_start),
|
|
425
|
+
date_end=get_date(self.out_parser.run_end),
|
|
426
|
+
)
|
|
427
|
+
|
|
428
|
+
# input parameters from data file
|
|
429
|
+
self.fdf_parser.mainfile = self.out_parser.mainfile
|
|
430
|
+
if self.out_parser.input_data_file is not None:
|
|
431
|
+
self.fdf_parser._file_handler = self.out_parser.input_data_file.encode()
|
|
432
|
+
|
|
433
|
+
sec_method = Method()
|
|
434
|
+
sec_run.method.append(sec_method)
|
|
435
|
+
parameters = self.fdf_parser.get('parameters')
|
|
436
|
+
sec_method.x_siesta_input_parameters = parameters
|
|
437
|
+
sec_method.x_siesta_simulation_parameters = {
|
|
438
|
+
key: val
|
|
439
|
+
for key, val in self.out_parser.get('simulation_parameters', {}).get(
|
|
440
|
+
'redata', []
|
|
441
|
+
)
|
|
442
|
+
}
|
|
443
|
+
sec_method.dft = DFT(xc_functional=XCFunctional())
|
|
444
|
+
for xc_functional in self._xc_map.get(parameters.get('xc.authors').lower(), []):
|
|
445
|
+
if '_X_' in xc_functional:
|
|
446
|
+
sec_method.dft.xc_functional.exchange.append(
|
|
447
|
+
Functional(name=xc_functional)
|
|
448
|
+
)
|
|
449
|
+
elif '_C_' in xc_functional:
|
|
450
|
+
sec_method.dft.xc_functional.correlation.append(
|
|
451
|
+
Functional(name=xc_functional)
|
|
452
|
+
)
|
|
453
|
+
elif '_HYB_' in xc_functional:
|
|
454
|
+
sec_method.dft.xc_functional.hybrid.append(
|
|
455
|
+
Functional(name=xc_functional)
|
|
456
|
+
)
|
|
457
|
+
else:
|
|
458
|
+
sec_method.dft.xc_functional.contributions.append(
|
|
459
|
+
Functional(name=xc_functional)
|
|
460
|
+
)
|
|
461
|
+
sec_method.electrons_representation = [
|
|
462
|
+
BasisSetContainer(
|
|
463
|
+
type='atom-centered orbitals',
|
|
464
|
+
scope=['wavefunction'],
|
|
465
|
+
basis_set=[
|
|
466
|
+
BasisSet(
|
|
467
|
+
type='numeric AOs',
|
|
468
|
+
scope=['full-election'],
|
|
469
|
+
)
|
|
470
|
+
],
|
|
471
|
+
)
|
|
472
|
+
]
|
|
473
|
+
# parse atomic basis info
|
|
474
|
+
|
|
475
|
+
def parse_system(source):
|
|
476
|
+
sec_system = System()
|
|
477
|
+
sec_run.system.append(sec_system)
|
|
478
|
+
lattice_vectors = source.get('lattice_vectors')
|
|
479
|
+
atoms = source.get('atoms')
|
|
480
|
+
source = atoms if atoms is not None else source
|
|
481
|
+
positions = source.get('positions')
|
|
482
|
+
if positions is not None:
|
|
483
|
+
coordinates_format = source.get('coordinates_format', 'Ang').lower()
|
|
484
|
+
if coordinates_format == 'ang':
|
|
485
|
+
positions = positions * ureg.angstrom
|
|
486
|
+
elif coordinates_format in ['fractional', 'scaledcartesian']:
|
|
487
|
+
if lattice_vectors is not None:
|
|
488
|
+
positions = np.dot(positions, lattice_vectors)
|
|
489
|
+
|
|
490
|
+
sec_system.atoms = Atoms(
|
|
491
|
+
positions=positions,
|
|
492
|
+
labels=source.get('labels'),
|
|
493
|
+
lattice_vectors=lattice_vectors,
|
|
494
|
+
)
|
|
495
|
+
|
|
496
|
+
return sec_system
|
|
497
|
+
|
|
498
|
+
def parse_calculation(source):
|
|
499
|
+
sec_calc = Calculation()
|
|
500
|
+
sec_run.calculation.append(sec_calc)
|
|
501
|
+
# energy
|
|
502
|
+
sec_energy = Energy()
|
|
503
|
+
sec_calc.energy = sec_energy
|
|
504
|
+
for key, val in source.get('energy', {}).get('contribution', []):
|
|
505
|
+
if key in self._metainfo_map:
|
|
506
|
+
setattr(
|
|
507
|
+
sec_energy,
|
|
508
|
+
self._metainfo_map[key],
|
|
509
|
+
EnergyEntry(value=val * ureg.eV),
|
|
510
|
+
)
|
|
511
|
+
else:
|
|
512
|
+
sec_energy.contributions.append(
|
|
513
|
+
EnergyEntry(kind=key, value=val * ureg.eV)
|
|
514
|
+
)
|
|
515
|
+
if source.energy_total is not None:
|
|
516
|
+
sec_energy.total = EnergyEntry(value=source.energy_total)
|
|
517
|
+
|
|
518
|
+
# forces
|
|
519
|
+
if source.forces is not None and source.forces.atomic is not None:
|
|
520
|
+
sec_calc.forces = Forces(
|
|
521
|
+
total=ForcesEntry(
|
|
522
|
+
value=source.forces.atomic * ureg.eV / ureg.angstrom
|
|
523
|
+
)
|
|
524
|
+
)
|
|
525
|
+
|
|
526
|
+
# stress tensor
|
|
527
|
+
if source.stress_tensor is not None:
|
|
528
|
+
sec_calc.stress = Stress(total=StressEntry(value=source.stress_tensor))
|
|
529
|
+
|
|
530
|
+
# dipoles
|
|
531
|
+
if source.electric_dipole is not None:
|
|
532
|
+
sec_multipoles = Multipoles()
|
|
533
|
+
sec_calc.multipoles.append(sec_multipoles)
|
|
534
|
+
sec_multipoles.kind = 'electric'
|
|
535
|
+
sec_multipoles.dipole = MultipolesEntry(total=source.electric_dipole)
|
|
536
|
+
|
|
537
|
+
# multipoles
|
|
538
|
+
if source.mulliken is not None:
|
|
539
|
+
sec_charges = Charges()
|
|
540
|
+
sec_calc.charges.append(sec_charges)
|
|
541
|
+
atoms = source.mulliken.get('atom', [])
|
|
542
|
+
spin = source.mulliken.get('spin', 1)
|
|
543
|
+
n_atoms = len(atoms) // spin
|
|
544
|
+
value = np.zeros(n_atoms)
|
|
545
|
+
for atom_n, atom in enumerate(atoms):
|
|
546
|
+
spin_n = atom_n // n_atoms
|
|
547
|
+
for orb_n, orb in enumerate(atom.get('orbital', [])):
|
|
548
|
+
# TODO map orb to lm value
|
|
549
|
+
sec_charges.orbital_projected.append(
|
|
550
|
+
ChargesValue(
|
|
551
|
+
spin=spin_n,
|
|
552
|
+
atom_label=atom.label,
|
|
553
|
+
orbital=orb,
|
|
554
|
+
value=atom.values[orb_n + 2]
|
|
555
|
+
* ureg.elementary_charge, # 0: index 1: sum
|
|
556
|
+
)
|
|
557
|
+
)
|
|
558
|
+
if spin == 2:
|
|
559
|
+
# spin peojected
|
|
560
|
+
sec_charges.spin_projected.append(
|
|
561
|
+
ChargesValue(
|
|
562
|
+
spin=spin_n,
|
|
563
|
+
atom_label=atom.label,
|
|
564
|
+
value=atom.values[1] * ureg.elementary_charge,
|
|
565
|
+
)
|
|
566
|
+
)
|
|
567
|
+
value[atom_n % n_atoms] += atom.values[1]
|
|
568
|
+
|
|
569
|
+
sec_charges.analysis_method = 'Mulliken'
|
|
570
|
+
sec_charges.value = value * ureg.elementary_charge
|
|
571
|
+
sec_charges.total = (
|
|
572
|
+
sum(source.mulliken.get('qtot', [])) * ureg.elementary_charge
|
|
573
|
+
)
|
|
574
|
+
|
|
575
|
+
# TODO parse more properties
|
|
576
|
+
# scf steps
|
|
577
|
+
for step in source.get('scf', {}).get('step', []):
|
|
578
|
+
sec_scf = ScfIteration()
|
|
579
|
+
sec_calc.scf_iteration.append(sec_scf)
|
|
580
|
+
sec_scf.energy = Energy(
|
|
581
|
+
total=EnergyEntry(value=step[1] * ureg.eV),
|
|
582
|
+
fermi=step[4] * ureg.eV,
|
|
583
|
+
free=EnergyEntry(value=step[2] * ureg.eV),
|
|
584
|
+
)
|
|
585
|
+
sec_scf.energy.types.append(
|
|
586
|
+
EnergyEntry(kind='Harris', value=step[0] * ureg.eV)
|
|
587
|
+
)
|
|
588
|
+
|
|
589
|
+
return sec_calc
|
|
590
|
+
|
|
591
|
+
def parse_configurations(source):
|
|
592
|
+
system = parse_system(source)
|
|
593
|
+
calc = parse_calculation(source)
|
|
594
|
+
calc.system_ref = system
|
|
595
|
+
|
|
596
|
+
if self.out_parser.single_point is not None:
|
|
597
|
+
parse_configurations(self.out_parser.single_point)
|
|
598
|
+
archive.workflow2 = SinglePoint()
|
|
599
|
+
|
|
600
|
+
if self.out_parser.geometry_optimization is not None:
|
|
601
|
+
for step in self.out_parser.geometry_optimization.get('step', []):
|
|
602
|
+
parse_configurations(step)
|
|
603
|
+
archive.workflow2 = GeometryOptimization()
|
|
604
|
+
|
|
605
|
+
# final properties
|
|
606
|
+
calc = parse_calculation(self.out_parser)
|
|
607
|
+
calc.system_ref = sec_run.system[-1]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Copyright The NOMAD Authors.
|
|
3
|
+
#
|
|
4
|
+
# This file is part of NOMAD.
|
|
5
|
+
# See https://nomad-lab.eu for further info.
|
|
6
|
+
#
|
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
# you may not use this file except in compliance with the License.
|
|
9
|
+
# You may obtain a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
# See the License for the specific language governing permissions and
|
|
17
|
+
# limitations under the License.
|
|
18
|
+
#
|
|
19
|
+
from .parser import SolidDMFTParser
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Copyright The NOMAD Authors.
|
|
3
|
+
#
|
|
4
|
+
# This file is part of NOMAD.
|
|
5
|
+
# See https://nomad-lab.eu for further info.
|
|
6
|
+
#
|
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
# you may not use this file except in compliance with the License.
|
|
9
|
+
# You may obtain a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
# See the License for the specific language governing permissions and
|
|
17
|
+
# limitations under the License.
|
|
18
|
+
#
|
|
19
|
+
import sys
|
|
20
|
+
import json
|
|
21
|
+
import logging
|
|
22
|
+
|
|
23
|
+
from nomad.utils import configure_logging
|
|
24
|
+
from nomad.datamodel import EntryArchive
|
|
25
|
+
from electronicparsers.soliddmft import SolidDMFTParser
|
|
26
|
+
|
|
27
|
+
if __name__ == '__main__':
|
|
28
|
+
configure_logging(console_log_level=logging.DEBUG)
|
|
29
|
+
archive = EntryArchive()
|
|
30
|
+
SolidDMFTParser().parse(sys.argv[1], archive, logging)
|
|
31
|
+
json.dump(archive.m_to_dict(), sys.stdout, indent=2)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Copyright The NOMAD Authors.
|
|
3
|
+
#
|
|
4
|
+
# This file is part of NOMAD.
|
|
5
|
+
# See https://nomad-lab.eu for further info.
|
|
6
|
+
#
|
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
# you may not use this file except in compliance with the License.
|
|
9
|
+
# You may obtain a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
# See the License for the specific language governing permissions and
|
|
17
|
+
# limitations under the License.
|
|
18
|
+
#
|
|
19
|
+
from . import soliddmft
|