parser_exciting.py 56.1 KB
Newer Older
1
# Copyright 2016-2018 The NOMAD Developers Group
2
3
4
5
6
7
8
9
10
11
12
13
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
14
15
#
# Main author and maintainer: Lorenzo Pardini <loren.pard@gmail.com>
16
from builtins import object
17
import setup_paths
18
import numpy as np
19
from nomadcore.simple_parser import AncillaryParser, CachingLevel
20
from nomadcore.simple_parser import SimpleMatcher as SM, mainFunction
21
from nomadcore.local_meta_info import loadJsonFile, InfoKindEl
22
from nomadcore.caching_backend import CachingLevel
23
from nomadcore.unit_conversion import unit_conversion
24
from nomadcore.unit_conversion.unit_conversion import convert_unit_function
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
25
import os, sys, json, exciting_parser_dos,exciting_parser_bandstructure, exciting_parser_gw, exciting_parser_GS_input
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
26
import exciting_parser_XS_input, exciting_parser_xs
27
from ase import Atoms
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
28
import logging
29

30
31
class ExcitingParserContext(object):

32
33
  def __init__(self):
    self.parser = None
34
35
36
37
38
39
40
#    self.mainFileUri = sys.argv[1]    #exciting !!!!!!LOCAL HOME!!!!!!!!             OKOKOKOK
    self.mainFileUri = sys.argv[2]  #exciting !!! FOR NOMAD URI nmd:// or sbt -> zip file!!!!!!!!   OKOKKOOK
    self.mainFilePath = None
    self.mainFile = None
    self.volumeCubOpt = False
    self.volumeOpt = False
    self.volumeCubOptIndex = 0
41
42
43

  def initialize_values(self):
    self.metaInfoEnv = self.parser.parserBuilder.metaInfoEnv
44
45
    self.atom_pos = []
    self.atom_labels = []
46

47
48
  def startedParsing(self, path, parser):
    self.parser=parser
49
    self.initialize_values()
50
51
#    self.atom_pos = []
#    self.atom_labels = []
52
    self.secMethodIndex = None  
53
    self.secSystemIndex = None
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
54
    self.secSingleConfIndex = None
55
    self.spinTreat = None
56
57
    self.sim_cell = []
    self.cell_format = ''
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
58
    self.secRunIndex = None
59
60
    self.unit_cell_vol = 0
    self.xcName = None
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
61
    self.gmaxvr = 0
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
62
    self.rgkmax = 0
63
    self.energy_thresh = []
64
65
66
67
68
69
    self.samplingMethod = None
    self.secSamplingMethodIndex = None
    self.geometryForceThreshold = 0
    self.frameSequence = []
    self.samplingGIndex = 0
    self.dummy = 0
70
71
    self.i=0
    self.clathrates = False
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
72
73
74
75
    self.bsetype = None
    self.screentype = None
    self.tensorComp = []
    self.excitonEnergies = []
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#    self.volumeOptIndex = 0

  def onOpen_section_run(self, backend, gIndex, section):
#    self.i=self.i+1
#    print("self.i=",self.i)
    curDir = os.getcwd()
    mainFile = self.parser.fIn.fIn.name           #####exciting sbt -> zip filei r from NOMAD URI nmd:// ####     YES ?????????? sure???? check first    OKOKOKKO
    self.mainFilePath = os.path.dirname(mainFile)           #####exciting sbt -> zip file####     YES ?????????? sure???? check first    OKOKOKKO
#    self.mainFilePath = self.mainFileUri[0:-9]     #####exciting LOCAL HOME #######   YES                      OKOKOKOK
#    print("self.mainFilePath===",self.mainFilePath)
    os.chdir(self.mainFilePath)
    os.chdir('../')
#    self.i=self.i+1
#    print("self.i=",self.i)
#    self.volumeOptIndex = 0
#    for root, dirs, files in os.walk('.'):
#      if root == '.':
#        for directory in dirs:
#          if directory[-4:-1]==
#        print("root=",root)
#        print("dirs=",dirs)
#        print("files=",files)     
#####volume optimization for simple cubic systems########
    if 'INFO_VOL' in os.listdir('.'):
      self.volumeOpt = True
#      print("self.volumeOpt=",self.volumeOpt)
      with open('INFO_VOL') as g:
          while 1:
            s = g.readline()
            if not s: break
            s = s.strip()

    else:
      for files in os.listdir('.'):
#      print("files=",files)
#      backend.addValue("x_exciting_dummy2", files)
        if files[0:7] == 'rundir-':
          self.volumeCubOptIndex+=1
    os.chdir(curDir)
#    curDir = os.getcwd()
#    dirPath = self.mainFileUri[0:-9]
#    os.chdir(dirPath)
#    os.chdir('../')
#    i = 0
#    for files in os.listdir('.'):
#      if files[0:7] == 'rundir-':
#        i+=1
#      if i>1:
#        self.volumeOpt = True
#        optGindex = backend.openSection("section_method")
#        print("optGindex=",optGindex)
#        backend.addValue("x_exciting_volume_optimization", self.volumeOpt)
#        backend.closeSection("section_method", optGindex)        
#    os.chdir(curDir)
130
131
132
133
134
135
136
137

  def onOpen_section_sampling_method(self, backend, gIndex, section):
    self.secSamplingMethodIndex = gIndex
    backend.addValue("sampling_method", "geometry_optimization")
#    print("self.secSamplingMethodIndex=",self.secSamplingMethodIndex)
    self.samplingMethod = "geometry_optimization"
#    print("self.samplingMethod=",self.samplingMethod)
    
138
139
  def onOpen_section_system(self, backend, gIndex, section):
    self.secSystemIndex = gIndex
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
    curDir = os.getcwd()
    mainFile = self.parser.fIn.fIn.name           #####exciting sbt -> zip file or from NOMAD URI nmd:// ####     YES ?????????? sure???? check first    OKOKOKKO
    self.mainFilePath = os.path.dirname(mainFile)           #####exciting sbt -> zip file####     YES ?????????? sure???? check first    OKOKOKKO
#    self.mainFilePath = self.mainFileUri[0:-9]     #####exciting LOCAL HOME#######   YES                      OKOKOKOK
#    print("self.mainFilePath===",self.mainFilePath)
    os.chdir(self.mainFilePath)
#    print("listdir=",os.listdir('.'))
    if 'str.out' in os.listdir('.'):
      self.clathrates = True
      backend.addValue("x_exciting_clathrates", True)
      clathrate_labels = []
      clathrate_coordinates = []
      with open('str.out') as g:
          while 1:
            s = g.readline()
            if not s: break
            s = s.strip()
            s = s.split()
            if len(s) == 4:
#              print("s=",s[0],float(s[0]))
              clathrate_coordinates.append([float(s[0]),float(s[1]),float(s[2])])
              clathrate_labels.append(s[3])
#      print("clathrate_coordinates=",clathrate_coordinates)
      backend.addArrayValues("x_exciting_clathrates_atom_coordinates", np.asarray(clathrate_coordinates))
      backend.addValue("x_exciting_clathrates_atom_labels", clathrate_labels)
    else:
      backend.addValue("x_exciting_clathrates", False)
#    backend.addArrayValues("x_exciting_clathrates_atom_coordinates", np.array(clathrate_coordinates)) 
#    backend.addValue("x_exciting_clathrates_atom_labels", clathrate_labels)
    os.chdir(curDir)            
170

Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
171
172
173
  def onOpen_section_single_configuration_calculation(self, backend, gIndex, section):
    if self.secSingleConfIndex is None:
      self.secSingleConfIndex = gIndex
174
    self.frameSequence.append(gIndex)
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
175

176
  def onOpen_section_method(self, backend, gIndex, section):
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
177
178
179
    if self.secMethodIndex is None:
      self.secMethodIndex = gIndex

180
181
182
183
184
  def onOpen_x_exciting_section_geometry_optimization(self, backend, gIndex, section):
#    """Trigger called when x_abinit_section_dataset is opened.
#    """
    self.samplingGIndex = backend.openSection("section_sampling_method")

Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
185
186
  def onClose_section_run(self, backend, gIndex, section):
    self.secRunIndex = gIndex
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
#    backend.addValue("x_exciting_dummy", self.volumeOptIndex)
########### VOLUME OPTIMIZATION #########################
#    curDir = os.getcwd()
##    mainFile = self.parser.fIn.fIn.name           #####exciting sbt -> zip file####     YES ?????????? sure???? check first    OKOKOKKO
##    dirPath = os.path.dirname(mainFile)           #####exciting sbt -> zip file####     YES ?????????? sure???? check first    OKOKOKKO
#    dirPath = self.mainFileUri[0:-9]     #####exciting LOCAL HOME or from NOMAD URI nmd://  #######   YES                      OKOKOKOK
#    os.chdir(dirPath)
#    os.chdir('../')
#    self.volumeOptIndex = 0
#    for files in os.listdir('.'):
#      if files[0:7] == 'rundir-':
#        self.volumeOptIndex+=1
######################independent from above#################
    if self.volumeCubOptIndex>1:
      self.volumeCubOpt = True
      optGindex = backend.openSection("section_method")
      backend.addValue("x_exciting_volume_optimization", self.volumeCubOpt)
      backend.closeSection("section_method", optGindex)
#    os.chdir(curDir)
206

Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
####################################TEST############################
    mainFile = self.parser.fIn.fIn.name
    dirPath = os.path.dirname(self.parser.fIn.name)
#    print("dirPath===",dirPath)
    gw_File = os.path.join(dirPath, "GW_INFO.OUT")
    gwFile = os.path.join(dirPath, "GWINFO.OUT")
    xsFile = os.path.join(dirPath, "INFOXS.OUT")
    for gFile in [gw_File, gwFile]:
      if os.path.exists(gFile):
        gwParser = exciting_parser_gw.GWParser()
        gwParser.parseGW(gFile, backend,
                         dftMethodSectionGindex = self.secMethodIndex,
                         dftSingleConfigurationGindex = self.secSingleConfIndex,
                         xcName = self.xcName,
                         unitCellVol = self.unit_cell_vol,
                         gmaxvr = self.gmaxvr)

        subParser = AncillaryParser(
            fileDescription = exciting_parser_gw.buildGWMatchers(),
            parser = self.parser,
            cachingLevelForMetaName = exciting_parser_gw.get_cachingLevelForMetaName(self.metaInfoEnv, CachingLevel.PreOpenedIgnore),
            superContext = gwParser)
        with open(gFile) as fIn:
            subParser.parseFile(fIn)
        break

    if os.path.exists(xsFile):
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
234
235
236
237
238
      excNum = []
      excEn = []
      excBindEn = []
      osclStr = []
      transCoeff = []
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
239
240
241
242
243
244
245
246
247
248
249
#      print("BSE!!!")
#        if os.path.exists(inputgwFile):
      inputXSFile = os.path.join(dirPath, "input.xml")
      selfXSSetGIndex = backend.openSection("section_method")
#      backend.addValue('x_exciting_electronic_structure_method', "BSE")   ########!!!!!!!!!!! So far, BSE is not a valid value for electronic_structure_method. It must be added! #########
      backend.addValue('x_exciting_xs_starting_point', self.xcName)
      if self.secMethodIndex is not None:
        m2mGindex = backend.openNonOverlappingSection("section_method_to_method_refs")
        backend.addValue("method_to_method_ref", self.secMethodIndex)
        backend.addValue("method_to_method_kind", "starting_point")
        backend.closeNonOverlappingSection("section_method_to_method_refs")
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278

        for files in os.listdir(dirPath):
            if files[0:11] == "EXCITON_BSE":
                dummyBse = files[11:13]
#                self.tensorComp = files[-6:-4]
                self.tensorComp.append(files[-6:-4])

                if dummyBse == 'si':
                    self.bsetype = 'singlet'
#                  name = "EXCITON_BSE" + self.bsetype
                elif dummyBse == 'tr':
                    self.bsetype = 'triplet'
                elif dummyBse == 'RP':
                    self.bsetype = 'RPA'
                elif dummyBse == 'IP':
                    self.bsetype = 'IP'
                name = "EXCITON_BSE" + self.bsetype + '_SCR'
                if files[len(name):len(name)+4] == 'full':
                    self.screentype = 'full'
                elif files[len(name):len(name)+4] == 'diag':
                    self.screentype = 'diag'
                elif files[len(name):len(name)+4] == 'noin':
                    self.screentype = 'noinvdiag'
                elif files[len(name):len(name)+4] == 'long':
                    self.screentype = 'longrange'
                
        backend.addValue("x_exciting_xs_screening_type", self.screentype)
        backend.addValue("x_exciting_xs_bse_type", self.bsetype)
#        print("===", self.tensorComp[0])
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
279
280
281
        with open(inputXSFile) as f:
          exciting_parser_XS_input.parseInput(f, backend, self.rgkmax)
      backend.closeSection("section_method",selfXSSetGIndex)
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
      numberOfComponents = len(self.tensorComp)

      backend.openNonOverlappingSection("section_single_configuration_calculation")
      if self.secSingleConfIndex is not None:
          backend.openNonOverlappingSection("section_calculation_to_calculation_refs")
          backend.addValue("calculation_to_calculation_ref", self.secSingleConfIndex)
          backend.addValue("calculation_to_calculation_kind", "starting_point")
          backend.closeNonOverlappingSection("section_calculation_to_calculation_refs")

      for i in range(numberOfComponents):
          excNum.append([])
          excEn.append([])
          excBindEn.append([])
          osclStr.append([])
          transCoeff.append([[],[]])
          outputXSFile = os.path.join(dirPath, "EXCITON_BSE" + self.bsetype + '_SCR' + self.screentype + "_OC" + self.tensorComp[i] + ".OUT")
          with open(outputXSFile) as g:
              xsParser = exciting_parser_xs.XSParser()
              xsParser.parseExciton(outputXSFile, backend, excNum, excEn, excBindEn, osclStr, transCoeff) #, dftMethodSectionGindex = self.secMethodIndex,
#                                    dftSingleConfigurationGindex = self.secSingleConfIndex)
#      backend.addvalue("x_exciting_xs_bse_number_of_components",numberOfComponents)
#      backend.addvalue("x_exciting_xs_bse_number_of_excitons",len(excNum))
      backend.addValue("x_exciting_xs_bse_exciton_energies",excEn) 
#      print("===",excBindEn) 
      backend.closeNonOverlappingSection("section_single_configuration_calculation")


#              print(outputXSFile)

#      for files in os.listdir(dirPath):
#          if files[0:11] == "EXCITON_BSE":
#              dummyBse = files[11:13]
#              dummyTenCom = files[-6:-4]
#              if dummyBse == 'si':
#                  self.bsetype = 'singlet'
##                  name = "EXCITON_BSE" + self.bsetype
#              elif dummyBse == 'tr':
#                  self.bsetype = 'triplet'
#              elif dummyBse == 'RP':
#                  self.bsetype = 'RPA'
#              elif dummyBse == 'IP':
#                  self.bsetype = 'IP'
#              name = "EXCITON_BSE" + self.bsetype + '_SCR'
#              if files[len(name):len(name)+4] == 'full':
#                  self.screentype = 'full'
#              elif files[len(name):len(name)+4] == 'diag':
#                  self.screentype = 'diag'
#              elif files[len(name):len(name)+4] == 'noin':
#                  self.screentype = 'noinvdiag'
#              elif files[len(name):len(name)+4] == 'long':
#                  self.screentype = 'longrange'
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
333

Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
334
#              print("===",self.screentype)
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
335
336
337

###########################TEST#############################

338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
  def onClose_x_exciting_section_geometry_optimization(self, backend, gIndex, section):
    """Trigger called when x_abinit_section_dataset is closed.
    """
#    print("len(self.frameSequence)=",len(self.frameSequence))
    if len(self.frameSequence) > 1:
      frameGIndex = backend.openSection("section_frame_sequence")
#        if section["x_abinit_geometry_optimization_converged"] is not None:
#          if section["x_abinit_geometry_optimization_converged"][-1] == "are converged":
      backend.addValue("geometry_optimization_converged", True)
#          else:
#            backend.addValue("geometry_optimization_converged", False)
      backend.closeSection("section_frame_sequence", frameGIndex)
#    self.frameSequence = []
    backend.closeSection("section_sampling_method", self.samplingGIndex)

  def onClose_section_frame_sequence(self, backend, gIndex, section):
    """Trigger called when section_framce_sequence is closed.
    """
    backend.addValue("number_of_frames_in_sequence", len(self.frameSequence))
    backend.addArrayValues("frame_sequence_local_frames_ref", np.array(self.frameSequence))
    backend.addValue("frame_sequence_to_sampling_ref", self.samplingGIndex)

#    print("self.samplingMethod=",self.samplingMethod)
    if self.samplingMethod == "geometry_optimization":
#        gix = backend.openSection("section_sampling_method")
#        backend.addValue("XC_functional_name", xcName)
#        backend.closeSection("section_sampling_method", gix)
#        geometryForceThreshold = section["x_exciting_geometry_optimization_threshold_force"]
#        print("geometryForceThreshold=",self.geometryForceThreshold)
        gi = backend.openSection("section_sampling_method")
        backend.addValue("geometry_optimization_threshold_force", self.geometryForceThreshold)
        backend.closeSection("section_sampling_method", gi)
    else:
        pass
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
################################TESDT###########################
#    mainFile = self.parser.fIn.fIn.name
#    dirPath = os.path.dirname(self.parser.fIn.name)
#    print("dirPath===",dirPath)
#    gw_File = os.path.join(dirPath, "GW_INFO.OUT")
#    gwFile = os.path.join(dirPath, "GWINFO.OUT")
#    bseFile = os.path.join(dirPath, "INFOXS.OUT")
#    for gFile in [gw_File, gwFile]:
#      if os.path.exists(gFile):
#        gwParser = exciting_parser_gw.GWParser()
#        gwParser.parseGW(gFile, backend,
#                         dftMethodSectionGindex = self.secMethodIndex,
#                         dftSingleConfigurationGindex = self.secSingleConfIndex,
#                         xcName = self.xcName,
#                         unitCellVol = self.unit_cell_vol,
#                         gmaxvr = self.gmaxvr)
#
#        subParser = AncillaryParser(
#            fileDescription = exciting_parser_gw.buildGWMatchers(),
#            parser = self.parser,
#            cachingLevelForMetaName = exciting_parser_gw.get_cachingLevelForMetaName(self.metaInfoEnv, CachingLevel.PreOpenedIgnore),
#            superContext = gwParser)
#        with open(gFile) as fIn:
#            subParser.parseFile(fIn)
#        break
#
#    if os.path.exists(bseFile):
#      print("BSE!!!")
###########################TEST##########################
401
402
403
404
  def onClose_x_exciting_section_lattice_vectors(self, backend, gIndex, section):
    latticeX = section["x_exciting_geometry_lattice_vector_x"]
    latticeY = section["x_exciting_geometry_lattice_vector_y"]
    latticeZ = section["x_exciting_geometry_lattice_vector_z"]
405
    cell = [[latticeX[0],latticeY[0],latticeZ[0]],
406
            [latticeX[1],latticeY[1],latticeZ[1]],
407
            [latticeX[2],latticeY[2],latticeZ[2]]]
408
    self.sim_cell = cell
409
    backend.addValue("simulation_cell", cell)
410

Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
411
412
413
414
  def onClose_x_exciting_section_reciprocal_lattice_vectors(self, backend, gIndex, section):
    recLatticeX = section["x_exciting_geometry_reciprocal_lattice_vector_x"]
    recLatticeY = section["x_exciting_geometry_reciprocal_lattice_vector_y"]
    recLatticeZ = section["x_exciting_geometry_reciprocal_lattice_vector_z"]
415
    recCell = [[recLatticeX[0],recLatticeY[0],recLatticeZ[0]],
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
416
            [recLatticeX[1],recLatticeY[1],recLatticeZ[1]],
417
418
            [recLatticeX[2],recLatticeY[2],recLatticeZ[2]]]
    backend.addValue("x_exciting_simulation_reciprocal_cell", recCell)
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
419

420
421
  def onClose_x_exciting_section_xc(self, backend, gIndex, section):
    xcNr = section["x_exciting_xc_functional"][0]
422
423
    xc_internal_map = {
        2: ['LDA_C_PZ', 'LDA_X_PZ'],
424
        3: ['LDA_C_PW', 'LDA_X_PZ'],
425
426
        4: ['LDA_C_XALPHA'],
        5: ['LDA_C_VBH'],
427
428
429
430
431
432
433
        20: ['GGA_C_PBE', 'GGA_X_PBE'],
        21: ['GGA_C_PBE', 'GGA_X_PBE_R'],
        22: ['GGA_C_PBE_SOL', 'GGA_X_PBE_SOL'],
        26: ['GGA_C_PBE', 'GGA_X_WC'],
        30: ['GGA_C_AM05', 'GGA_C_AM05'],
        300: ['GGA_C_BGCP', 'GGA_X_PBE'],
        406: ['HYB_GGA_XC_PBEH']
434
        }
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
435
436
437
438
439
440
441
442
443
444
445
    if xcNr == 100:
        dirPath = os.path.dirname(self.parser.fIn.name)
        inputGSFile = os.path.join(dirPath, "input.xml") 
        with open(inputGSFile) as f:
            exciting_parser_GS_input.parseInput(f, backend)
    else:
        for xcName in xc_internal_map[xcNr]:
          self.xcName = xcName
          gi = backend.openSection("section_XC_functionals")
          backend.addValue("XC_functional_name", xcName)
          backend.closeSection("section_XC_functionals", gi)
446

447
  def onClose_section_single_configuration_calculation(self, backend, gIndex, section):
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
448
#    logging.error("BASE onClose_section_single_configuration_calculation")
449
450
    backend.addValue('single_configuration_to_calculation_method_ref', self.secMethodIndex)
    backend.addValue('single_configuration_calculation_to_system_ref', self.secSystemIndex)
451
#    print("self.samplingMethod=",self.samplingMethod)
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
####################VOLUME TEST BEGIN################################
    ext_uri = []
#    backend.addValue("x_exciting_dummy=",self.volumeOptIndex)
#    backend.addValue("x_exciting_dummy", self.volumeOptIndex)
    if self.volumeCubOptIndex > 1:
      for j in range(1, self.volumeCubOptIndex):
        if (j<10):
          ext_uri.append(self.mainFilePath[0:-9] + 'rundir-0' + str(j) + '/INFO.OUT')
#          backend.addValue("x_exciting_dummy2", ext_uri[-1])
#          print("ext_uri===",ext_uri)
        else:
          ext_uri.append(self.mainFilePath[0:-9] + 'rundir-' + str(j) + '/INFO.OUT')
#          backend.addValue("x_exciting_dummy2", ext_uri[-1])
#          print("ext_uri===",ext_uri)
#    backend.addArrayValues("x_exciting_dummy2", np.asarray(ext_uri))
    for ref in ext_uri:
      refGindex = backend.openSection("section_calculation_to_calculation_refs")
      backend.addValue("calculation_to_calculation_external_url", ref)
      backend.addValue("calculation_to_calculation_kind", "source_calculation")
      backend.closeSection("section_calculation_to_calculation_refs", refGindex)

####################VOLUME TEST END############################


476
477
    if self.samplingMethod == "geometry_optimization":
        self.geometryForceThreshold = section["x_exciting_geometry_optimization_threshold_force"][0]
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
478
479
480
481
482
483
484
485
486
    forceX = section["x_exciting_geometry_atom_forces_x"]
    if forceX:
      forceY = section["x_exciting_geometry_atom_forces_y"]
      forceZ = section["x_exciting_geometry_atom_forces_z"]
      atoms = len(forceX)
      atom_geometry_forces = []
      for i in range(0,atoms):
          atom_geometry_forces.append([forceX[i],forceY[i],forceZ[i]])
      backend.addValue("atom_forces",atom_geometry_forces)
487
488
489
490
#        print("geometryForceThreshold=",geometryForceThreshold)
#        backend.addValue("geometry_optimization_threshold_force", geometryForceThreshold)
#    else:
#        pass
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
#
##############TO DO. FIX FORCES#####################
#    forceX = section["x_exciting_atom_forces_x"]
#    if forceX:
#      forceY = section["x_exciting_atom_forces_y"]
#      forceZ = section["x_exciting_atom_forces_z"]
#      print("forceX===",forceX)
#      print("forceY===",forceY)
#      print("forceZ===",forceZ)
#      forceCoreX = section["x_exciting_atom_core_forces_x"]
#      forceCoreY = section["x_exciting_atom_core_forces_y"]
#      forceCoreZ = section["x_exciting_atom_core_forces_z"]
#      print("forceCoreX===",forceCoreX)
##      print("forceCoreY===",forceCoreY)
#      print("forceCoreZ===",forceCoreZ)
#      forceIBSX = section["x_exciting_atom_IBS_forces_x"]
#      forceIBSY = section["x_exciting_atom_IBS_forces_y"]
#      forceIBSZ = section["x_exciting_atom_IBS_forces_z"]
#      print("forceIBSX===",forceIBSX)
#      print("forceIBSY===",forceIBSY)
#      print("forceIBSZ===",forceIBSZ)
#      forceHFX = section["x_exciting_atom_HF_forces_x"]
#      forceHFY = section["x_exciting_atom_HF_forces_y"]
#      forceHFZ = section["x_exciting_atom_HF_forces_z"]
#      fConv = convert_unit_function("hartree/bohr", "N")
#      atoms = len(forceX)
#      atom_forces = []
#      atom_core_forces = []
#      atom_IBS_forces = []
#      atom_HF_forces = []
#      for i in range(0,atoms):
#        print("atoms===",atoms)
#        print("i===",i)
#        print("atom_forces===",atom_forces)
#        print("forceX[i]===",forceX[i])
#        print("forceY[i]===",forceY[i])
#        print("forceZ[i]===",forceZ[i])
#        print("forceCoreX[i]===",forceCoreX[i])
#        print("forceCoreY[i]===",forceCoreY[i])
#        print("forceCoreZ[i]===",forceCoreZ[i])
#        print("forceIBSX[i]===",forceIBSX[i])
#        print("forceIBSY[i]===",forceIBSY[i])
#        print("forceIBSZ[i]===",forceIBSZ[i])
#        atom_forces.append([fConv(forceX[i]),fConv(forceY[i]),fConv(forceZ[i])])
#        atom_core_forces.append([fConv(forceCoreX[i]),fConv(forceCoreY[i]),fConv(forceCoreZ[i])])
#        atom_IBS_forces.append([fConv(forceIBSX[i]),fConv(forceIBSY[i]),fConv(forceIBSZ[i])])
#        atom_HF_forces.append([fConv(forceHFX[i]),fConv(forceHFY[i]),fConv(forceHFZ[i])])
#      backend.addValue("atom_forces",atom_forces)
#      backend.addValue("x_exciting_atom_core_forces",atom_core_forces)
#      backend.addValue("x_exciting_atom_IBS_forces",atom_IBS_forces)
#      backend.addValue("x_exciting_atom_HF_forces",atom_HF_forces)
542
#    print("atom_forces=",atom_forces)
543
#
544
545
    dirPath = os.path.dirname(self.parser.fIn.name)
    dosFile = os.path.join(dirPath, "dos.xml")
546
    bandFile = os.path.join(dirPath, "bandstructure.xml")
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
547
    fermiSurfFile = os.path.join(dirPath, "FERMISURF.bxsf")
548
    eigvalFile = os.path.join(dirPath, "EIGVAL.OUT")    
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
549
#    logging.error("done BASE onClose_section_single_configuration_calculation")
550

551
552
    if os.path.exists(dosFile):
      with open(dosFile) as f:
553
        exciting_parser_dos.parseDos(f, backend, self.spinTreat, self.unit_cell_vol)
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
554
555
    if os.path.exists(bandFile):
      with open(bandFile) as g:
556
        exciting_parser_bandstructure.parseBand(g, backend, self.spinTreat)
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
    if os.path.exists(eigvalFile):
      eigvalGIndex = backend.openSection("section_eigenvalues")
      with open(eigvalFile) as g:
          eigvalKpoint=[]
          eigvalVal=[]
          eigvalOcc=[]
          eigvalValSpin = [[],[]]
          eigvalOccSpin = [[],[]]
          fromH = unit_conversion.convert_unit_function("hartree", "J")
          while 1:
            s = g.readline()
            if not s: break
            s = s.strip()              
            if len(s) < 20:
              if "nstsv" in s.split():
                 nstsv = int(s.split()[0])
                 nstsv2=int(nstsv/2)
              elif "nkpt" in s.split():
                 nkpt = int(s.split()[0])
              continue
            elif len(s) > 50:
              eigvalVal.append([])
              eigvalOcc.append([])
              eigvalKpoint.append([float(x) for x in s.split()[1:4]])
            else:
              try: int(s[0])
              except ValueError:
                continue
              else:
                n, e, occ = s.split()
                eigvalVal[-1].append(fromH(float(e)))
                eigvalOcc[-1].append(float(occ))
          if not self.spinTreat:
590
591
592
593
594
595
596
            for i in range(0,nkpt):
              eigvalValSpin[0].append(eigvalVal[i][0:nstsv])
              eigvalOccSpin[0].append(eigvalOcc[i][0:nstsv])
              eigvalValSpin[1].append(eigvalVal[i][0:nstsv])
              eigvalOccSpin[1].append(eigvalOcc[i][0:nstsv])
            backend.addValue("eigenvalues_values", eigvalValSpin)
            backend.addValue("eigenvalues_occupation", eigvalOccSpin)
597
598
599
600
601
602
          else:
            for i in range(0,nkpt):
              eigvalValSpin[0].append(eigvalVal[i][0:nstsv2])
              eigvalOccSpin[0].append(eigvalOcc[i][0:nstsv2])
              eigvalValSpin[1].append(eigvalVal[i][nstsv2:nstsv])
              eigvalOccSpin[1].append(eigvalOcc[i][nstsv2:nstsv])
603
604
605
            backend.addValue("eigenvalues_values", eigvalValSpin)
            backend.addValue("eigenvalues_occupation", eigvalOccSpin)
          backend.addValue("eigenvalues_kpoints", eigvalKpoint)
606
          backend.closeSection("section_eigenvalues",eigvalGIndex)
Pardini, Lorenzo (lopa)'s avatar
test    
Pardini, Lorenzo (lopa) committed
607
608
609

##########################Parsing Fermi surface##################

610
611
612
613
614
    if os.path.exists(fermiSurfFile):
      fermiGIndex = backend.openSection("x_exciting_section_fermi_surface")
      with open(fermiSurfFile) as g:
        grid = []
        all_vectors = []
615
        values = []
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
        origin = []
        vectors = []
        fermi = 0
        number_of_bands = 0
        mesh_size = 0
        fromH = unit_conversion.convert_unit_function("hartree", "J")
        while 1:
          s = g.readline()
          if not s: break
          s = s.strip()
          st = s.split()
          if len(st) == 3:
            if len(s) >= 40:
              all_vectors.append([])
              i = 0
              while i < 3:
                all_vectors[-1].append(float(st[i]))
                i += 1
            elif st[0] == "Fermi":
              fermi = fromH(float(st[2]))
            else:
              j = 0
              while j < 3:
                grid.append(int(st[j]))
                j += 1
          elif len(st) == 2:
642
            values.append([])
643
          elif len(s) >= 12 and len(st) == 1:
644
645
646
647
            try: float(st[0])
            except ValueError:
              continue
            else:
648
              values[-1].append(float(st[0]))
649
          elif len(s) < 5 and len(st) == 1:
650
            number_of_bands = st[0] 
651
        mesh_size = grid[0]*grid[1]*grid[2]
652
653
654
655
656
        origin = all_vectors[0]
        vectors = all_vectors[1:]
        backend.addValue("x_exciting_number_of_bands_fermi_surface", int(number_of_bands))
        backend.addValue("x_exciting_number_of_mesh_points_fermi_surface", int(mesh_size))
        backend.addValue("x_exciting_fermi_energy_fermi_surface", float(fermi))
657
658
659
660
661
        backend.addArrayValues("x_exciting_grid_fermi_surface", np.asarray(grid))
        backend.addArrayValues("x_exciting_origin_fermi_surface", np.asarray(origin))
        backend.addArrayValues("x_exciting_vectors_fermi_surface", np.asarray(vectors))
        backend.addArrayValues("x_exciting_values_fermi_surface", np.asarray(values))
        backend.closeSection("x_exciting_section_fermi_surface",fermiGIndex)
662

663
  def onClose_x_exciting_section_spin(self, backend, gIndex, section):
664

665
666
667
668
669
670
    spin = section["x_exciting_spin_treatment"][0]
    spin = spin.strip()
    if spin == "spin-polarised":
      self.spinTreat = True
    else:
      self.spinTreat = False
671

672
  def onClose_section_system(self, backend, gIndex, section):
673

674
    self.unit_cell_vol = section["x_exciting_unit_cell_volume"]
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
675
    self.gmaxvr = section["x_exciting_gmaxvr"]
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
676
    self.rgkmax = section["x_exciting_rgkmax"]
677
    backend.addArrayValues('configuration_periodic_dimensions', np.asarray([True, True, True]))
678

679
    self.secSystemDescriptionIndex = gIndex
680

681
    if self.atom_pos and self.cell_format[0] == 'cartesian':
682
#       print("self.atom_pos=",self.atom_pos)
683
       backend.addArrayValues('atom_positions', np.asarray(self.atom_pos))
684
    elif self.atom_pos and self.cell_format[0] == 'lattice':
685
686
#       print("aaaself.atom_pos=",self.atom_pos)
#       print("aaaself.atom_labels=",self.atom_labels)
687
688
689
690
       atoms = Atoms(self.atom_labels, self.atom_pos, cell=[(1, 0, 0),(0, 1, 0),(0, 0, 1)])
       atoms.set_cell(self.sim_cell, scale_atoms=True)
       self.atom_pos = atoms.get_positions()
       backend.addArrayValues('atom_positions', np.asarray(self.atom_pos))
691
    if self.atom_labels is not None:
692
#       print("aaaself.atom_labels=",self.atom_labels)
693
       backend.addArrayValues('atom_labels', np.asarray(self.atom_labels))
694
695
    self.atom_labels = []

696
697
698
699
    excSmearingKind = section["x_exciting_smearing_type"]
 
    smearing_internal_map = {
        "Gaussian": ['gaussian'],
700
701
        "Methfessel-Paxton": ['methfessel-paxton'],
        "Fermi-Dirac": ['fermi'],
702
        "Extended": ['tetrahedra']
703
704
        }

705
706
707
708
709
    if self.samplingMethod is not "geometry_optimization":
        for smName in smearing_internal_map[excSmearingKind[0]]:
          backend.addValue("smearing_kind", smName)
    else:
        pass
710

711
  def onClose_x_exciting_section_atoms_group(self, backend, gIndex, section):
712
#    print("start.self.atom_labels=",self.atom_labels)
713
714
    fromB = unit_conversion.convert_unit_function("bohr", "m")
    formt = section['x_exciting_atom_position_format']
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
715
716
717
718
719
    if self.samplingMethod is not "geometry_optimization":
      pass
    else:
      if self.atom_pos is not None: self.atom_pos = []
      if self.atom_labels is not None: self.atom_labels = []
720
    self.cell_format = formt
Mohamed, Fawzi Roberto (fawzi)'s avatar
Mohamed, Fawzi Roberto (fawzi) committed
721
    pos = [section['x_exciting_geometry_atom_positions_' + i] for i in ['x', 'y', 'z']]
722
#    print("pos=",pos)
Mohamed, Fawzi Roberto (fawzi)'s avatar
Mohamed, Fawzi Roberto (fawzi) committed
723
    pl = [len(comp) for comp in pos]
724
725
726
727
    natom = pl[0]
    if pl[1] != natom or pl[2] != natom:
      raise Exception("invalid number of atoms in various components %s" % pl)
    for i in range(natom):
728
#      print("nattom=",natom)  
729
730
731
732
733
734
#      print("i=",i)
#      print("natom=",natom)
#      print("[pos[0][i]=",pos[0][i])
#      print("[pos[1][i]=",pos[1][i])
#      print("[pos[2][i]=",pos[2][i])
#      print("self.atom_pos=",self.atom_pos)
735
736
737
      if formt[0] == 'cartesian':
        self.atom_pos.append([fromB(pos[0][i]), fromB(pos[1][i]), fromB(pos[2][i])])
      else:
738
739
#        print("self.atom_labels_prima=",self.atom_labels)
#        print("self.atom_pos_prima=",self.atom_pos)
740
        self.atom_pos.append([pos[0][i], pos[1][i], pos[2][i]])
741
742
743
744
745
746
#        print("self.atom_pos_dopo=",self.atom_pos)
#        print("self.atom_labels_dopo=",self.atom_labels)
#    print("natom=",natom)
#    print("section['x_exciting_geometry_atom_labels']=",section['x_exciting_geometry_atom_labels'])
#    print("self.samplingMethod[0]=",self.samplingMethod)
    if self.samplingMethod is not "geometry_optimization":
747
#        print("prima=",self.atom_labels)
748
        self.atom_labels = self.atom_labels + (section['x_exciting_geometry_atom_labels'] * natom)
749
750
#        print("self.atom_labels=",self.atom_labels)
#        print("section['x_exciting_geometry_atom_labels']=",section['x_exciting_geometry_atom_labels'])
751
752
753
    else:
        self.atom_labels = self.atom_labels + section['x_exciting_geometry_atom_labels']
#    print("self.atom_labels_dopodopo=",self.atom_labels)
754

755
  def onClose_section_method(self, backend, gIndex, section):
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
756
757
    if gIndex == self.secMethodIndex:
      backend.addValue('electronic_structure_method', "DFT")
758
759
760
761
762
763
764
765
766
767
768
769
      try:
        energy_thresh = section["x_exciting_scf_threshold_energy_change"][0]
      except:
        pass
      try:
        potential_thresh = section["x_exciting_scf_threshold_potential_change_list"][0]
      except:
        pass
      try:
        charge_thresh = section["x_exciting_scf_threshold_charge_change_list"][0]
      except:
        pass
770
771
      if section["x_exciting_scf_threshold_force_change_list"]:
        force_thresh = section["x_exciting_scf_threshold_force_change_list"][0]
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
        try:
          backend.addValue('x_exciting_scf_threshold_force_change', force_thresh)
        except:
          pass
      try:
        backend.addValue('scf_threshold_energy_change', energy_thresh)
      except:
        pass
      try:
        backend.addValue('x_exciting_scf_threshold_potential_change', potential_thresh)
      except:
        pass
      try:
        backend.addValue('x_exciting_scf_threshold_charge_change', charge_thresh)
      except:
        pass
##########BELOW VOLUME OPTIMIZATION######################
#    if self.volumeOptIndex>1:
#      self.volumeOpt = True
#      optGindex = backend.openSection("section_method")
#      backend.addValue("x_exciting_volume_optimization", self.volumeOpt)
#      backend.closeSection("section_method", optGindex)
#
#    ext_uri = []
#    backend.addValue("x_exciting_dummy", self.volumeOptIndex)
#    if self.volumeOptIndex > 1:
#      for j in range(1, self.volumeOptIndex):
#        if (j<10):
#          ext_uri.append(self.mainFilePath[0:-9] + 'rundir-0' + str(j) + '/INFO.OUT')
#        else:
#          ext_uri.append(self.mainFilePath[0:-9] + 'rundir-' + str(j) + '/INFO.OUT')
#    for ref in ext_uri:
#      refGindex = backend.openSection("section_calculation_to_calculation_refs")
#      backend.addValue("calculation_to_calculation_external_url", ref)
#      backend.addValue("calculation_to_calculation_kind", "source_calculation")
#      backend.closeSection("section_calculation_to_calculation_refs", refGindex)
808

809
810
811
812
813
814
815
mainFileDescription = \
    SM(name = "root matcher",
       startReStr = "",
       weak = True,
       subMatchers = [
         SM(name = "header",
         startReStr = r"\s*\|\s*EXCITING\s*(?P<program_version>[-a-zA-Z0-9]+)\s*started\s*=",
816
         fixedStartValues={'program_name': 'exciting', 'program_basis_set_type': '(L)APW+lo' },
817
            sections = ["section_run", "section_method"],
818
819
820
821
         subMatchers = [
	   SM(name = 'input',
              startReStr = r"\|\sStarting initialization",
              endReStr = r"\|\sEnding initialization",
822
              sections = ['section_system'],
823
824
              subMatchers = [
                SM(startReStr = r"\sLattice vectors \(cartesian\) :",
825
                sections = ["x_exciting_section_lattice_vectors"],
826
                subMatchers = [
827

828
    SM(startReStr = r"\s*(?P<x_exciting_geometry_lattice_vector_x__bohr>[-+0-9.]+)\s+(?P<x_exciting_geometry_lattice_vector_y__bohr>[-+0-9.]+)\s+(?P<x_exciting_geometry_lattice_vector_z__bohr>[-+0-9.]+)", repeats = True)
829
                ]),
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
830
                SM(startReStr = r"\sReciprocal lattice vectors \(cartesian\) :",
831
                sections = ["x_exciting_section_reciprocal_lattice_vectors"],
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
832
833
                subMatchers = [

834
    SM(startReStr = r"\s*(?P<x_exciting_geometry_reciprocal_lattice_vector_x__bohr_1>[-+0-9.]+)\s+(?P<x_exciting_geometry_reciprocal_lattice_vector_y__bohr_1>[-+0-9.]+)\s+(?P<x_exciting_geometry_reciprocal_lattice_vector_z__bohr_1>[-+0-9.]+)", repeats = True)
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
835
                ]),
836
837
838
    SM(r"\s*Unit cell volume\s*:\s*(?P<x_exciting_unit_cell_volume__bohr3>[-0-9.]+)"),
    SM(r"\s*Brillouin zone volume\s*:\s*(?P<x_exciting_brillouin_zone_volume__bohr_3>[-0-9.]+)"),
    SM(r"\s*Species\s*:\s*[0-9]\s*\((?P<x_exciting_geometry_atom_labels>[-a-zA-Z0-9]+)\)", repeats = True,
839
      sections = ["x_exciting_section_atoms_group"],
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
840
       subMatchers = [
841
842
        SM(r"\s*muffin-tin radius\s*:\s*(?P<x_exciting_muffin_tin_radius__bohr>[-0-9.]+)", repeats = True),
        SM(r"\s*# of radial points in muffin-tin\s*:\s*(?P<x_exciting_muffin_tin_points>[-0-9.]+)", repeats = True),
843
        SM(startReStr = r"\s*atomic positions\s*\((?P<x_exciting_atom_position_format>[-a-zA-Z]+)\)\s*:\s*",
844
           endReStr = r"\s*magnetic fields\s*",
845
           subMatchers = [
846
                    SM(r"\s*(?P<x_exciting_geometry_atom_number>[+0-9]+)\s*:\s*(?P<x_exciting_geometry_atom_positions_x>[-+0-9.]+)\s*(?P<x_exciting_geometry_atom_positions_y>[-+0-9.]+)\s*(?P<x_exciting_geometry_atom_positions_z>[-+0-9.]+)", repeats = True)
847
848
849
850
851
         ]) #,
#        SM(startReStr = r"\s*magnetic fields\s*\((?P<x_exciting_magnetic_field_format>[-a-zA-Z]+)\)\s*:\s*",
#           subMatchers = [
#                    SM(r"\s*(?P<x_exciting_MT_external_magnetic_field_atom_number>[+0-9]+)\s*:\s*(?P<x_exciting_MT_external_magnetic_field_x>[-+0-9.]+)\s*(?P<x_exciting_MT_external_magnetic_field_y>[-+0-9.]+)\s*(?P<x_exciting_MT_external_magnetic_field_z>[-+0-9.]+)", repeats = True)
#         ])
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
852
    ]),
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
853
    SM(r"\s*Total number of atoms per unit cell\s*:\s*(?P<x_exciting_number_of_atoms>[-0-9.]+)"),
854
855
    SM(r"\s*Spin treatment\s*:\s*(?P<x_exciting_spin_treatment>[-a-zA-Z\s*]+)",
       sections = ["x_exciting_section_spin"]),
856
857
858
    SM(r"\s*k-point grid\s*:\s*(?P<x_exciting_number_kpoint_x>[-0-9.]+)\s+(?P<x_exciting_number_kpoint_y>[-0-9.]+)\s+(?P<x_exciting_number_kpoint_z>[-0-9.]+)"),
    SM(r"\s*k-point offset\s*:\s*(?P<x_exciting_kpoint_offset_x>[-0-9.]+)\s+(?P<x_exciting_kpoint_offset_y>[-0-9.]+)\s+(?P<x_exciting_kpoint_offset_z>[-0-9.]+)"),
    SM(r"\s*Total number of k-points\s*:\s*(?P<x_exciting_number_kpoints>[-0-9.]+)"),
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
859
    SM(r"\s*R\^MT_min \* \|G\+k\|_max \(rgkmax\)\s*:\s*(?P<x_exciting_rgkmax>[-0-9.]+)"),
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
860
    SM(r"\s*Maximum \|G\+k\| for APW functions\s*:\s*(?P<x_exciting_gkmax__bohr_1>[-0-9.]+)"),
861
862
863
    SM(r"\s*Maximum \|G\| for potential and density\s*:\s*(?P<x_exciting_gmaxvr__bohr_1>[-0-9.]+)"),
    SM(r"\s*G-vector grid sizes\s*:\s*(?P<x_exciting_gvector_size_x>[-0-9.]+)\s+(?P<x_exciting_gvector_size_y>[-0-9.]+)\s+(?P<x_exciting_gvector_size_z>[-0-9.]+)"),
    SM(r"\s*Total number of G-vectors\s*:\s*(?P<x_exciting_gvector_total>[-0-9.]+)"),
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
864
865
    SM(startReStr = r"\s*Maximum angular momentum used for\s*",
        subMatchers = [
866
          SM(r"\s*APW functions\s*:\s*(?P<x_exciting_lmaxapw>[-0-9.]+)")
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
867
        ]),
868
869
    SM(r"\s*Total nuclear charge\s*:\s*(?P<x_exciting_nuclear_charge>[-0-9.]+)"),
    SM(r"\s*Total electronic charge\s*:\s*(?P<x_exciting_electronic_charge>[-0-9.]+)"),
870
871
    SM(r"\s*Total core charge\s*:\s*(?P<x_exciting_core_charge_initial>[-0-9.]+)"),
    SM(r"\s*Total valence charge\s*:\s*(?P<x_exciting_valence_charge_initial>[-0-9.]+)"),
872
873
874
875
876
877
    SM(r"\s*Effective Wigner radius, r_s\s*:\s*(?P<x_exciting_wigner_radius>[-0-9.]+)"),
    SM(r"\s*Number of empty states\s*:\s*(?P<x_exciting_empty_states>[-0-9.]+)"),
    SM(r"\s*Total number of valence states\s*:\s*(?P<x_exciting_valence_states>[-0-9.]+)"),
    SM(r"\s*Maximum Hamiltonian size\s*:\s*(?P<x_exciting_hamiltonian_size>[-0-9.]+)"),
    SM(r"\s*Maximum number of plane-waves\s*:\s*(?P<x_exciting_pw>[-0-9.]+)"),
    SM(r"\s*Total number of local-orbitals\s*:\s*(?P<x_exciting_lo>[-0-9.]+)"),
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
878
879
    SM(startReStr = r"\s*Exchange-correlation type\s*:\s*(?P<x_exciting_xc_functional>[-0-9.]+)",
       sections = ['x_exciting_section_xc']),
880
    SM(r"\s*Smearing scheme\s*:\s*(?P<x_exciting_smearing_type>[-a-zA-Z0-9]+)"),
881
    SM(r"\s*Smearing width\s*:\s*(?P<smearing_width__hartree>[-0-9.]+)"),
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
882
    SM(r"\s*Using\s*(?P<x_exciting_potential_mixing>[-a-zA-Z\s*]+)\s*potential mixing")
883
    ]),
884
885
886
887
888
889
890
891
892
893
            SM(name = "single configuration iteration",
              startReStr = r"\|\s*Self-consistent loop started\s*\+",
              sections = ["section_single_configuration_calculation"],
              repeats = True,
              subMatchers = [
                SM(name = "scfi totE",
                 startReStr =r"\|\s*SCF iteration number\s*:",
                  sections = ["section_scf_iteration"],
                  repeats = True,
                  subMatchers = [
894
                   SM(r"\s*Total energy\s*:\s*(?P<energy_total_scf_iteration__hartree>[-0-9.]+)"),
895
                   SM(r"\s*Fermi energy\s*:\s*(?P<x_exciting_fermi_energy_scf_iteration__hartree>[-0-9.]+)"),
896
                   SM(r"\s*Kinetic energy\s*:\s*(?P<electronic_kinetic_energy_scf_iteration__hartree>[-0-9.]+)"),
897
898
899
                   SM(r"\s*Coulomb energy\s*:\s*(?P<x_exciting_coulomb_energy_scf_iteration__hartree>[-0-9.]+)"),
                   SM(r"\s*Exchange energy\s*:\s*(?P<x_exciting_exchange_energy_scf_iteration__hartree>[-0-9.]+)"),
                   SM(r"\s*Correlation energy\s*:\s*(?P<x_exciting_correlation_energy_scf_iteration__hartree>[-0-9.]+)"),
900
                   SM(r"\s*Sum of eigenvalues\s*:\s*(?P<energy_sum_eigenvalues_scf_iteration__hartree>[-0-9.]+)"),
901
902
                   SM(r"\s*Effective potential energy\s*:\s*(?P<x_exciting_effective_potential_energy_scf_iteration__hartree>[-0-9.]+)"),
                   SM(r"\s*Coulomb potential energy\s*:\s*(?P<x_exciting_coulomb_potential_energy_scf_iteration__hartree>[-0-9.]+)"),
903
                   SM(r"\s*xc potential energy\s*:\s*(?P<energy_XC_potential_scf_iteration__hartree>[-0-9.]+)"),
904
905
906
907
908
                   SM(r"\s*Hartree energy\s*:\s*(?P<x_exciting_hartree_energy_scf_iteration__hartree>[-0-9.]+)"),
                   SM(r"\s*Electron-nuclear energy\s*:\s*(?P<x_exciting_electron_nuclear_energy_scf_iteration__hartree>[-0-9.]+)"),
                   SM(r"\s*Nuclear-nuclear energy\s*:\s*(?P<x_exciting_nuclear_nuclear_energy_scf_iteration__hartree>[-0-9.]+)"),
                   SM(r"\s*Madelung energy\s*:\s*(?P<x_exciting_madelung_energy_scf_iteration__hartree>[-0-9.]+)"),
                   SM(r"\s*Core-electron kinetic energy\s*:\s*(?P<x_exciting_core_electron_kinetic_energy_scf_iteration__hartree>[-0-9.]+)"),
909
                   SM(r"\s*Absolute change in total energy   (target)\s*:\s*(?P<energy_change_scf_iteration__hartree>[-0-9.]+)\s*(\s*(?P<scf_threshold_energy_change__hartree>[-0-9.]+))"),
910
                   SM(r"\s*DOS at Fermi energy \(states\/Ha\/cell\)\s*:\s*(?P<x_exciting_dos_fermi_scf_iteration__hartree_1>[-0-9.]+)"),
911
                   SM(r"\s*core\s*:\s*(?P<x_exciting_core_charge_scf_iteration>[-0-9.]+)"),
912
                   SM(r"\s*core leakage\s*:\s*(?P<x_exciting_core_leakage_scf_iteration>[-0-9.]+)"),
913
                   SM(r"\s*valence\s*:\s*(?P<x_exciting_valence_charge_scf_iteration>[-0-9.]+)"),
914
915
916
917
                   SM(r"\s*interstitial\s*:\s*(?P<x_exciting_interstitial_charge_scf_iteration>[-0-9.]+)"),
                   SM(r"\s*total charge in muffin-tins\s*:\s*(?P<x_exciting_total_MT_charge_scf_iteration>[-0-9.]+)"),
                   SM(r"\s*Estimated fundamental gap\s*:\s*(?P<x_exciting_gap_scf_iteration__hartree>[-0-9.]+)"),
                   SM(r"\s*Wall time \(seconds\)\s*:\s*(?P<x_exciting_time_scf_iteration>[-0-9.]+)"),
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
918
                   SM(r"\s*RMS change in effective potential \(target\)\s*:\s*(?P<x_exciting_effective_potential_convergence_scf_iteration__hartree>[0-9]+\.[0-9]*([E]?[-]?[0-9]+))\s*\(\s*(?P<x_exciting_scf_threshold_potential_change_list__hartree>[0-9]\.[0-9]*([E]?[-]?[0-9]+))\)"),
919
                   SM(r"\s*Absolute change in total energy\s*\(target\)\s*:\s*(?P<x_exciting_energy_convergence_scf_iteration>[0-9]+\.[0-9]*([E]?[-]?[0-9]+))\s*\(\s*(?P<x_exciting_scf_threshold_energy_change__hartree>[0-9]\.[0-9]*([E]?[-]?[0-9]+))\)"),
920
                   SM(r"\s*Absolute change in total energy\s*\(target\)\s*\:\s*\s*\(\s*[0-9]+\.[0-9]+\s*[0-9]+\.[0-9]+\s*[0-9]+\.[0-9]+\s*\)\s*avg =\s*[0-9]+\.[0-9]+\s*\(\s*(?P<x_exciting_scf_threshold_energy_change__hartree>[0-9.]+E?[-][0-9]+)\s*\)"),
921
922
                   SM(r"\s*Charge distance\s*\(target\)\s*:\s*(?P<x_exciting_charge_convergence_scf_iteration>[0-9]\.[0-9]*([E]?[-]?[0-9]+))\s*\(\s*(?P<x_exciting_scf_threshold_charge_change_list>[0-9]\.[0-9]*([E]?[-]?[0-9]+))\)"),
                   SM(r"\s*Abs. change in max-nonIBS-force\s*\(target\)\s*:\s*(?P<x_exciting_force_convergence_scf_iteration>[0-9]\.[0-9]*([E]?[-]?[0-9]+))\s*\(\s*(?P<x_exciting_scf_threshold_force_change_list>[0-9]\.[0-9]*([E]?[-]?[0-9]+))\)")
923
                  ]),
924
                SM(name="final_quantities",
925
926
927
                  startReStr = r"\| Convergence targets achieved. Performing final SCF iteration\s*\+",
                  endReStr = r"\| Self-consistent loop stopped\s*\+",
                   subMatchers = [
928
                     SM(r"\s*Total energy\s*:\s*(?P<energy_total__hartree>[-0-9.]+)"),
929
                     SM(r"\s*Fermi energy\s*:\s*(?P<x_exciting_fermi_energy__hartree>[-0-9.]+)"),
930
                     SM(r"\s*Kinetic energy\s*:\s*(?P<electronic_kinetic_energy__hartree>[-0-9.]+)"),
931
932
933
                     SM(r"\s*Coulomb energy\s*:\s*(?P<x_exciting_coulomb_energy__hartree>[-0-9.]+)"),
                     SM(r"\s*Exchange energy\s*:\s*(?P<x_exciting_exchange_energy__hartree>[-0-9.]+)"),
                     SM(r"\s*Correlation energy\s*:\s*(?P<x_exciting_correlation_energy__hartree>[-0-9.]+)"),
934
                     SM(r"\s*Sum of eigenvalues\s*:\s*(?P<energy_sum_eigenvalues__hartree>[-0-9.]+)"),
935
936
                     SM(r"\s*Effective potential energy\s*:\s*(?P<x_exciting_effective_potential_energy__hartree>[-0-9.]+)"),
                     SM(r"\s*Coulomb potential energy\s*:\s*(?P<x_exciting_coulomb_potential_energy__hartree>[-0-9.]+)"),
937
                     SM(r"\s*xc potential energy\s*:\s*(?P<energy_XC_potential__hartree>[-0-9.]+)"),
938
939
940
941
942
943
944
945
946
947
                     SM(r"\s*Hartree energy\s*:\s*(?P<x_exciting_hartree_energy__hartree>[-0-9.]+)"),
                     SM(r"\s*Electron-nuclear energy\s*:\s*(?P<x_exciting_electron_nuclear_energy__hartree>[-0-9.]+)"),
                     SM(r"\s*Nuclear-nuclear energy\s*:\s*(?P<x_exciting_nuclear_nuclear_energy__hartree>[-0-9.]+)"),
                     SM(r"\s*Madelung energy\s*:\s*(?P<x_exciting_madelung_energy__hartree>[-0-9.]+)"),
                     SM(r"\s*Core-electron kinetic energy\s*:\s*(?P<x_exciting_core_electron_kinetic_energy__hartree>[-0-9.]+)"),
                     SM(r"\s*DOS at Fermi energy \(states\/Ha\/cell\)\s*:\s*(?P<x_exciting_dos_fermi__hartree_1>[-0-9.]+)"),
                     SM(r"\s*core leakage\s*:\s*(?P<x_exciting_core_leakage>[-0-9.]+)"),
                     SM(r"\s*interstitial\s*:\s*(?P<x_exciting_interstitial_charge>[-0-9.]+)"),
                     SM(r"\s*total charge in muffin-tins\s*:\s*(?P<x_exciting_total_MT_charge>[-0-9.]+)"),
                     SM(r"\s*Estimated fundamental gap\s*:\s*(?P<x_exciting_gap__hartree>[-0-9.]+)")
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
                   ]) #,
#                SM(name="final_forces",
##                  startReStr = r"\| Writing atomic positions and forces\s*\-",
#                  startReStr = r"\s*Total atomic forces including IBS \(cartesian\) \s*:",
#                  endReStr = r"\|\s*Groundstate module stopped\s*\*",
##                  endReStr = r"\s* Atomic force components including IBS \(cartesian\)\s*:",
#                  floating = True,
#                   subMatchers = [
##                     SM(name="total_forces",
##                     startReStr = r"\s*Total atomic forces including IBS \(cartesian\)\s*:",
#                       SM(r"\s*atom\s*[0-9]+\s*[A-Za-z]+\s*\:\s*(?P<x_exciting_atom_forces_x>[-0-9.]+)\s*(?P<x_exciting_atom_forces_y>[-0-9.]+)\s*(?P<x_exciting_atom_forces_z>[-0-9.]+)",
#                          repeats = True )    
######                     subMatchers = [
######                     SM(r"\s*atom\s*(?P<x_exciting_store_total_forces>[0-9]+\s*[A-Za-z]+\s*\:+\s*[-\d\.]+\s*[-\d\.]+\s*[-\d\.]+)",
######                          repeats = True)
######                   ] )
##)
##                     print ("number atoms=", x_exciting_number_of_atoms)
##                     SM(name="force_components",
##                     startReStr = r"\s*Atomic force components including IBS \(cartesian\)\s*:",
##                     forwardMatch = True,
##                     subMatchers = [
##                     SM(r"\s*atom\s*(?P<x_exciting_store_total_forces>[0-9]+\s*[A-Za-z]+\s*\:+\s*[-\d\.]+\s*[-\d\.]+\s*[-\d\.]+\s*[A-Za-z]+\s*[A-Za-z]+)", weak = True),
##                     SM(r"\s*(?P<x_exciting_store_total_forces>\s*\:+\s*[-\d\.]+\s*[-\d\.]+\s*[-\d\.]+\s*[A-Za-z]+\s*[A-Za-z]+)"),
##                     SM(r"\s*(?P<x_exciting_store_total_forces>\s*\:+\s*[-\d\.]+\s*[-\d\.]+\s*[-\d\.]+\s*[A-Za-z]+\s*[A-Za-z]+)")
##                     SM(r"\s*(?P<x_exciting_store_total_forces>\s*\:+\s*[-\d\.]+\s*[-\d\.]+\s*[-\d\.]+\s*[A-Za-z]+\s*[A-Za-z]+)"),
##                   ] 
##                    )
#                   ]),
#                 SM(name="force_components",
978
#                  startReStr = r"\s* Atomic force components including IBS \(cartesian\)\s*:",
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
#                  endReStr = r"\|\s* Groundstate module stopped\s* \*",
#                  subMatchers = [
##                  startReStr = r"\s* Atomic force components including IBS \(cartesian\)\s*:",
#                   SM(r"\s*atom\s*[0-9]+\s*[A-Za-z]+\s*\:\s*(?P<x_exciting_atom_HF_forces_x>[-0-9.]+)\s*(?P<x_exciting_atom_HF_forces_y>[-0-9.]+)\s*(?P<x_exciting_atom_HF_forces_z>[-0-9.]+)\s*HF force",
#                     repeats = True,
#                     floating = True),
#                   SM(r"\s*\:\s*(?P<x_exciting_atom_core_forces_x>[-0-9.]+)\s*(?P<x_exciting_atom_core_forces_y>[-0-9.]+)\s*(?P<x_exciting_atom_core_forces_z>[-0-9.]+)\s*core correction",
#                     repeats = True,
#                     floating = True),
#                   SM(r"\s*\:\s*(?P<x_exciting_atom_IBS_forces_x>[-0-9.]+)\s*(?P<x_exciting_atom_IBS_forces_y>[-0-9.]+)\s*(?P<x_exciting_atom_IBS_forces_z>[-0-9.]+)\s*IBS correction",
#                     repeats = True,
#                     floating = True),
##                   SM(r"(?P<x_exciting_store_total_forces>.*)",
##                          repeats = True, 
#                ] )
994
               ]
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
            ),
            SM(name = "geometry optimization",
              startReStr = r"\|\s*Structure-optimization module started*\s*\*",
              sections = ["section_sampling_method","x_exciting_section_geometry_optimization"],
#              fixedStartValues={'sampling_method': 'geometry_optimization'},
#              repeats = True,
              subMatchers = [
                   SM(name = "optimization steps",
                   startReStr = r"\|\s*Optimization step\s*(?P<x_exciting_geometry_optimization_step>[-0-9]+)\s*\(method = (?P<x_exciting_geometry_optimization_method>[A-Za-z]+)\)\s*\-",
                   sections = ["section_single_configuration_calculation"],
#                   SM(r"\s*Output level for this task is set to normal\s*"),
#                   SM(r"\|\s*Optimization step (?P<x_exciting_geometry_optimization_step>[-0-9]+)\: Initialize optimization\s*\-"),
                   repeats = True,
                   subMatchers = [
                   SM(r"\s*Maximum force magnitude\s*\(target\)\s*:\s*(?P<x_exciting_maximum_force_magnitude__hartree_bohr_1>[0-9]+\.[0-9]*([E]?[-]?[0-9]+))\s*\(\s*(?P<x_exciting_geometry_optimization_threshold_force__hartree_bohr_1>[0-9]\.[0-9]*([E]?[-]?[0-9]+))\)"),
                   SM(r"\s*Total energy at this optimization step\s*:\s*(?P<energy_total__hartree>[-0-9.]+)"),
                   SM(startReStr = r"\s*Atomic positions at this step \s*\((?P<x_exciting_atom_position_format>[-a-zA-Z]+)\)\s*:\s*",
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
1012
1013
#                   endReStr = r"\s*Total atomic forces including IBS \(cartesian\) \:",
#                   weak = True,
1014
1015
1016
1017
                   sections = ["section_system","x_exciting_section_atoms_group"],
#           endReStr = r"\s*magnetic fields\s*",
           subMatchers = [
                    SM(r"\s*atom\s*(?P<x_exciting_atom_number>[+0-9]+)\s*(?P<x_exciting_geometry_atom_labels>[A-Za-z]+)\s*\:\s*(?P<x_exciting_geometry_atom_positions_x>[-+0-9.]+)\s*(?P<x_exciting_geometry_atom_positions_y>[-+0-9.]+)\s*(?P<x_exciting_geometry_atom_positions_z>[-+0-9.]+)", repeats = True)
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
1018
1019
1020
1021
1022
1023
1024
         ]),
                   SM(startReStr = r"\s*Total atomic forces including IBS \(cartesian\) \:",
                    endReStr = r"\s*Time spent in this optimization step\s*\:\s*(?P<x_exciting_geometry_dummy>[+0-9.]+)\s*seconds",
                    subMatchers = [
                    SM(r"\s*atom\s*[+0-9]+\s*[A-Za-z]+\s*\:\s*(?P<x_exciting_geometry_atom_forces_x__hartree_bohr_1>[-+0-9.]+)\s*(?P<x_exciting_geometry_atom_forces_y__hartree_bohr_1>[-+0-9.]+)\s*(?P<x_exciting_geometry_atom_forces_z__hartree_bohr_1>[-+0-9.]+)", repeats = True)
         ])
         ])
1025
1026
           ]
           )
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
          ])
    ])




parserInfo = {
  "name": "exciting_parser",
  "version": "1.0"
}

metaInfoPath = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)),"../../../../nomad-meta-info/meta_info/nomad_meta_info/exciting.nomadmetainfo.json"))
metaInfoEnv, warnings = loadJsonFile(filePath = metaInfoPath, dependencyLoader = None, extraArgsHandling = InfoKindEl.ADD_EXTRA_ARGS, uri = None)
1040

1041
cachingLevelForMetaName = {
1042
1043
1044
                            "x_exciting_geometry_lattice_vector_x":CachingLevel.Cache,
                            "x_exciting_geometry_lattice_vector_y":CachingLevel.Cache,
                            "x_exciting_geometry_lattice_vector_z":CachingLevel.Cache,
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
1045
1046
1047
1048
                            "x_exciting_section_lattice_vectors": CachingLevel.Ignore,
                            "x_exciting_geometry_reciprocal_lattice_vector_x":CachingLevel.Cache,
                            "x_exciting_geometry_reciprocal_lattice_vector_y":CachingLevel.Cache,
                            "x_exciting_geometry_reciprocal_lattice_vector_z":CachingLevel.Cache,
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
                            "x_exciting_section_reciprocal_lattice_vectors": CachingLevel.Ignore,
                            "x_exciting_atom_forces_x":CachingLevel.Cache,
                            "x_exciting_atom_forces_y":CachingLevel.Cache,
                            "x_exciting_atom_forces_z":CachingLevel.Cache,
                            "x_exciting_atom_HF_forces_x":CachingLevel.Cache,
                            "x_exciting_atom_HF_forces_y":CachingLevel.Cache,
                            "x_exciting_atom_HF_forces_z":CachingLevel.Cache,
                            "x_exciting_atom_core_forces_x":CachingLevel.Cache,
                            "x_exciting_atom_core_forces_y":CachingLevel.Cache,
                            "x_exciting_atom_core_forces_z":CachingLevel.Cache,
                            "x_exciting_atom_IBS_forces_x":CachingLevel.Cache,
                            "x_exciting_atom_IBS_forces_y":CachingLevel.Cache,
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
1061
1062
1063
1064
                            "x_exciting_atom_IBS_forces_z":CachingLevel.Cache,
                            "x_exciting_geometry_atom_forces_x":CachingLevel.Cache,
                            "x_exciting_geometry_atom_forces_y":CachingLevel.Cache,
                            "x_exciting_geometry_atom_forces_z":CachingLevel.Cache
1065
                          }
1066
if __name__ == "__main__":
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
1067
    mainFunction(mainFileDescription, metaInfoEnv, parserInfo, cachingLevelForMetaName = cachingLevelForMetaName, superContext=ExcitingParserContext())