Commit afc75b31 authored by Lauri Himanen's avatar Lauri Himanen

Some renamings for regexs, and cache service functions.

parent 7e702fab
...@@ -65,8 +65,8 @@ class CP2KGeoOptParser(MainHierarchicalParser): ...@@ -65,8 +65,8 @@ class CP2KGeoOptParser(MainHierarchicalParser):
# subMatchers=[ # subMatchers=[
# self.cm.quickstep_calculation(), # self.cm.quickstep_calculation(),
# SM( " -------- Informations at step"), # SM( " -------- Informations at step"),
# SM( " Optimization Method =\s+(?P<x_cp2k_optimization_method>{})".format(self.regexs.regex_word)), # SM( " Optimization Method =\s+(?P<x_cp2k_optimization_method>{})".format(self.regexs.word)),
# SM( " Total Energy =\s+(?P<x_cp2k_optimization_energy__hartree>{})".format(self.regexs.regex_f), # SM( " Total Energy =\s+(?P<x_cp2k_optimization_energy__hartree>{})".format(self.regexs.float),
# otherMetaInfo=["frame_sequence_potential_energy"] # otherMetaInfo=["frame_sequence_potential_energy"]
# ), # ),
# ], # ],
...@@ -87,7 +87,7 @@ class CP2KGeoOptParser(MainHierarchicalParser): ...@@ -87,7 +87,7 @@ class CP2KGeoOptParser(MainHierarchicalParser):
subMatchers=[ subMatchers=[
# SM( "", # SM( "",
# forwardMatch=True, # forwardMatch=True,
# endReStr=" *** MNBRACK - NUMBER OF ENERGY EVALUATIONS :\s+{}\s+***".replace("*", "\*").format(self.regexs.regex_i), # endReStr=" *** MNBRACK - NUMBER OF ENERGY EVALUATIONS :\s+{}\s+***".replace("*", "\*").format(self.regexs.int),
# subMatchers=[ # subMatchers=[
# SM(" SCF WAVEFUNCTION OPTIMIZATION", # SM(" SCF WAVEFUNCTION OPTIMIZATION",
# forwardMatch=True, # forwardMatch=True,
...@@ -100,7 +100,7 @@ class CP2KGeoOptParser(MainHierarchicalParser): ...@@ -100,7 +100,7 @@ class CP2KGeoOptParser(MainHierarchicalParser):
# ), # ),
# SM( "", # SM( "",
# forwardMatch=True, # forwardMatch=True,
# endReStr=" *** BRENT - NUMBER OF ENERGY EVALUATIONS :\s+{}\s+***".replace("*", "\*").format(self.regexs.regex_i), # endReStr=" *** BRENT - NUMBER OF ENERGY EVALUATIONS :\s+{}\s+***".replace("*", "\*").format(self.regexs.int),
# subMatchers=[ # subMatchers=[
# SM(" SCF WAVEFUNCTION OPTIMIZATION", # SM(" SCF WAVEFUNCTION OPTIMIZATION",
# forwardMatch=True, # forwardMatch=True,
...@@ -112,27 +112,27 @@ class CP2KGeoOptParser(MainHierarchicalParser): ...@@ -112,27 +112,27 @@ class CP2KGeoOptParser(MainHierarchicalParser):
# ] # ]
# ), # ),
SM( " -------- Informations at step"), SM( " -------- Informations at step"),
SM( " Optimization Method =\s+(?P<x_cp2k_optimization_method>{})".format(self.regexs.regex_word)), SM( " Optimization Method =\s+(?P<x_cp2k_optimization_method>{})".format(self.regexs.word)),
SM( " Total Energy =\s+(?P<x_cp2k_optimization_energy__hartree>{})".format(self.regexs.regex_f), SM( " Total Energy =\s+(?P<x_cp2k_optimization_energy__hartree>{})".format(self.regexs.float),
otherMetaInfo=["frame_sequence_potential_energy"] otherMetaInfo=["frame_sequence_potential_energy"]
), ),
SM( " Real energy change =\s+(?P<x_cp2k_optimization_energy_change__hartree>{})".format(self.regexs.regex_f)), SM( " Real energy change =\s+(?P<x_cp2k_optimization_energy_change__hartree>{})".format(self.regexs.float)),
SM( " Decrease in energy =\s+(?P<x_cp2k_optimization_energy_decrease>{})".format(self.regexs.regex_word)), SM( " Decrease in energy =\s+(?P<x_cp2k_optimization_energy_decrease>{})".format(self.regexs.word)),
SM( " Used time =\s+(?P<x_cp2k_optimization_used_time>{})".format(self.regexs.regex_f)), SM( " Used time =\s+(?P<x_cp2k_optimization_used_time>{})".format(self.regexs.float)),
SM( " Max. step size =\s+(?P<x_cp2k_optimization_max_step_size__bohr>{})".format(self.regexs.regex_f)), SM( " Max. step size =\s+(?P<x_cp2k_optimization_max_step_size__bohr>{})".format(self.regexs.float)),
SM( " Conv. limit for step size =\s+(?P<x_cp2k_optimization_step_size_convergence_limit__bohr>{})".format(self.regexs.regex_f), SM( " Conv. limit for step size =\s+(?P<x_cp2k_optimization_step_size_convergence_limit__bohr>{})".format(self.regexs.float),
otherMetaInfo=["geometry_optimization_geometry_change"] otherMetaInfo=["geometry_optimization_geometry_change"]
), ),
SM( " Convergence in step size =\s+(?P<x_cp2k_optimization_step_size_convergence>{})".format(self.regexs.regex_word)), SM( " Convergence in step size =\s+(?P<x_cp2k_optimization_step_size_convergence>{})".format(self.regexs.word)),
SM( " RMS step size =\s+(?P<x_cp2k_optimization_rms_step_size__bohr>{})".format(self.regexs.regex_f)), SM( " RMS step size =\s+(?P<x_cp2k_optimization_rms_step_size__bohr>{})".format(self.regexs.float)),
SM( " Convergence in RMS step =\s+(?P<x_cp2k_optimization_rms_step_size_convergence>{})".format(self.regexs.regex_word)), SM( " Convergence in RMS step =\s+(?P<x_cp2k_optimization_rms_step_size_convergence>{})".format(self.regexs.word)),
SM( " Max. gradient =\s+(?P<x_cp2k_optimization_max_gradient__bohr_1hartree>{})".format(self.regexs.regex_f)), SM( " Max. gradient =\s+(?P<x_cp2k_optimization_max_gradient__bohr_1hartree>{})".format(self.regexs.float)),
SM( " Conv. limit for gradients =\s+(?P<x_cp2k_optimization_gradient_convergence_limit__bohr_1hartree>{})".format(self.regexs.regex_f), SM( " Conv. limit for gradients =\s+(?P<x_cp2k_optimization_gradient_convergence_limit__bohr_1hartree>{})".format(self.regexs.float),
otherMetaInfo=["geometry_optimization_threshold_force"] otherMetaInfo=["geometry_optimization_threshold_force"]
), ),
SM( " Conv. for gradients =\s+(?P<x_cp2k_optimization_max_gradient_convergence>{})".format(self.regexs.regex_word)), SM( " Conv. for gradients =\s+(?P<x_cp2k_optimization_max_gradient_convergence>{})".format(self.regexs.word)),
SM( " RMS gradient =\s+(?P<x_cp2k_optimization_rms_gradient__bohr_1hartree>{})".format(self.regexs.regex_f)), SM( " RMS gradient =\s+(?P<x_cp2k_optimization_rms_gradient__bohr_1hartree>{})".format(self.regexs.float)),
SM( " Conv. in RMS gradients =\s+(?P<x_cp2k_optimization_rms_gradient_convergence>{})".format(self.regexs.regex_word)), SM( " Conv. in RMS gradients =\s+(?P<x_cp2k_optimization_rms_gradient_convergence>{})".format(self.regexs.word)),
], ],
# adHoc=self.adHoc_step() # adHoc=self.adHoc_step()
), ),
...@@ -191,8 +191,8 @@ class CP2KGeoOptParser(MainHierarchicalParser): ...@@ -191,8 +191,8 @@ class CP2KGeoOptParser(MainHierarchicalParser):
self.cache_service["frame_sequence_potential_energy"].append(energy) self.cache_service["frame_sequence_potential_energy"].append(energy)
# Push values from cache # Push values from cache
self.cache_service.push_array_values("frame_sequence_potential_energy") self.cache_service.addArrayValues("frame_sequence_potential_energy")
self.cache_service.push_value("geometry_optimization_method") self.cache_service.addValue("geometry_optimization_method")
self.backend.addValue("frame_sequence_to_sampling_ref", 0) self.backend.addValue("frame_sequence_to_sampling_ref", 0)
# Get the optimization convergence criteria from the last optimization # Get the optimization convergence criteria from the last optimization
...@@ -234,7 +234,7 @@ class CP2KGeoOptParser(MainHierarchicalParser): ...@@ -234,7 +234,7 @@ class CP2KGeoOptParser(MainHierarchicalParser):
backend.closeSection("section_system", systemId) backend.closeSection("section_system", systemId)
backend.closeSection("section_single_configuration_calculation", singleId) backend.closeSection("section_single_configuration_calculation", singleId)
self.cache_service.push_array_values("frame_sequence_local_frames_ref") self.cache_service.addArrayValues("frame_sequence_local_frames_ref")
backend.addValue("number_of_frames_in_sequence", n_steps) backend.addValue("number_of_frames_in_sequence", n_steps)
def onClose_section_sampling_method(self, backend, gIndex, section): def onClose_section_sampling_method(self, backend, gIndex, section):
...@@ -249,7 +249,7 @@ class CP2KGeoOptParser(MainHierarchicalParser): ...@@ -249,7 +249,7 @@ class CP2KGeoOptParser(MainHierarchicalParser):
self.cache_service["frame_sequence_potential_energy"].append(energy[0]) self.cache_service["frame_sequence_potential_energy"].append(energy[0])
def onClose_section_system(self, backend, gIndex, section): def onClose_section_system(self, backend, gIndex, section):
self.cache_service.push_array_values("simulation_cell", unit="angstrom") self.cache_service.addArrayValues("simulation_cell", unit="angstrom")
def onClose_section_method(self, backend, gIndex, section): def onClose_section_method(self, backend, gIndex, section):
traj_file = self.file_service.get_file_by_id("trajectory") traj_file = self.file_service.get_file_by_id("trajectory")
......
...@@ -61,20 +61,20 @@ class CP2KMDParser(MainHierarchicalParser): ...@@ -61,20 +61,20 @@ class CP2KMDParser(MainHierarchicalParser):
forwardMatch=True, forwardMatch=True,
sections=["section_sampling_method", "x_cp2k_section_md_settings"], sections=["section_sampling_method", "x_cp2k_section_md_settings"],
subMatchers=[ subMatchers=[
SM( " MD\| Ensemble Type\s+(?P<x_cp2k_md_ensemble_type>{})".format(self.regexs.regex_word)), SM( " MD\| Ensemble Type\s+(?P<x_cp2k_md_ensemble_type>{})".format(self.regexs.word)),
SM( " MD\| Number of Time Steps\s+(?P<x_cp2k_md_number_of_time_steps>{})".format(self.regexs.regex_i)), SM( " MD\| Number of Time Steps\s+(?P<x_cp2k_md_number_of_time_steps>{})".format(self.regexs.int)),
SM( " MD\| Time Step \[fs\]\s+(?P<x_cp2k_md_time_step__fs>{})".format(self.regexs.regex_f)), SM( " MD\| Time Step \[fs\]\s+(?P<x_cp2k_md_time_step__fs>{})".format(self.regexs.float)),
SM( " MD\| Temperature \[K\]\s+(?P<x_cp2k_md_target_temperature>{})".format(self.regexs.regex_f)), SM( " MD\| Temperature \[K\]\s+(?P<x_cp2k_md_target_temperature>{})".format(self.regexs.float)),
SM( " MD\| Temperature tolerance \[K\]\s+(?P<x_cp2k_md_target_temperature_tolerance>{})".format(self.regexs.regex_f)), SM( " MD\| Temperature tolerance \[K\]\s+(?P<x_cp2k_md_target_temperature_tolerance>{})".format(self.regexs.float)),
SM( " MD\| Pressure \[Bar\]\s+(?P<x_cp2k_md_target_pressure>{})".format(self.regexs.regex_f)), SM( " MD\| Pressure \[Bar\]\s+(?P<x_cp2k_md_target_pressure>{})".format(self.regexs.float)),
SM( " MD\| Barostat time constant \[ fs\]\s+(?P<x_cp2k_md_barostat_time_constant>{})".format(self.regexs.regex_f)), SM( " MD\| Barostat time constant \[ fs\]\s+(?P<x_cp2k_md_barostat_time_constant>{})".format(self.regexs.float)),
SM( " MD\| Print MD information every\s+(?P<x_cp2k_md_print_frequency>{}) step\(s\)".format(self.regexs.regex_i)), SM( " MD\| Print MD information every\s+(?P<x_cp2k_md_print_frequency>{}) step\(s\)".format(self.regexs.int)),
SM( " MD\| File type Print frequency\[steps\] File names"), SM( " MD\| File type Print frequency\[steps\] File names"),
SM( " MD\| Coordinates\s+(?P<x_cp2k_md_coordinates_print_frequency>{})\s+(?P<x_cp2k_md_coordinates_filename>{})".format(self.regexs.regex_i, self.regexs.regex_word)), SM( " MD\| Coordinates\s+(?P<x_cp2k_md_coordinates_print_frequency>{})\s+(?P<x_cp2k_md_coordinates_filename>{})".format(self.regexs.int, self.regexs.word)),
SM( " MD\| Simulation Cel\s+(?P<x_cp2k_md_simulation_cell_print_frequency>{})\s+(?P<x_cp2k_md_simulation_cell_filename>{})".format(self.regexs.regex_i, self.regexs.regex_word)), SM( " MD\| Simulation Cel\s+(?P<x_cp2k_md_simulation_cell_print_frequency>{})\s+(?P<x_cp2k_md_simulation_cell_filename>{})".format(self.regexs.int, self.regexs.word)),
SM( " MD\| Velocities\s+(?P<x_cp2k_md_velocities_print_frequency>{})\s+(?P<x_cp2k_md_velocities_filename>{})".format(self.regexs.regex_i, self.regexs.regex_word)), SM( " MD\| Velocities\s+(?P<x_cp2k_md_velocities_print_frequency>{})\s+(?P<x_cp2k_md_velocities_filename>{})".format(self.regexs.int, self.regexs.word)),
SM( " MD\| Energies\s+(?P<x_cp2k_md_energies_print_frequency>{})\s+(?P<x_cp2k_md_energies_filename>{})".format(self.regexs.regex_i, self.regexs.regex_word)), SM( " MD\| Energies\s+(?P<x_cp2k_md_energies_print_frequency>{})\s+(?P<x_cp2k_md_energies_filename>{})".format(self.regexs.int, self.regexs.word)),
SM( " MD\| Dump\s+(?P<x_cp2k_md_dump_print_frequency>{})\s+(?P<x_cp2k_md_dump_filename>{})".format(self.regexs.regex_i, self.regexs.regex_word)), SM( " MD\| Dump\s+(?P<x_cp2k_md_dump_print_frequency>{})\s+(?P<x_cp2k_md_dump_filename>{})".format(self.regexs.int, self.regexs.word)),
] ]
), ),
SM( " ************************** Velocities initialization **************************".replace("*", "\*"), SM( " ************************** Velocities initialization **************************".replace("*", "\*"),
...@@ -84,14 +84,14 @@ class CP2KMDParser(MainHierarchicalParser): ...@@ -84,14 +84,14 @@ class CP2KMDParser(MainHierarchicalParser):
subMatchers=[ subMatchers=[
self.cm.quickstep_calculation(), self.cm.quickstep_calculation(),
SM( " ******************************** GO CP2K GO! **********************************".replace("*", "\*")), SM( " ******************************** GO CP2K GO! **********************************".replace("*", "\*")),
SM( " INITIAL POTENTIAL ENERGY\[hartree\] =\s+(?P<x_cp2k_md_potential_energy_instantaneous__hartree>{})".format(self.regexs.regex_f)), SM( " INITIAL POTENTIAL ENERGY\[hartree\] =\s+(?P<x_cp2k_md_potential_energy_instantaneous__hartree>{})".format(self.regexs.float)),
SM( " INITIAL KINETIC ENERGY\[hartree\] =\s+(?P<x_cp2k_md_kinetic_energy_instantaneous__hartree>{})".format(self.regexs.regex_f)), SM( " INITIAL KINETIC ENERGY\[hartree\] =\s+(?P<x_cp2k_md_kinetic_energy_instantaneous__hartree>{})".format(self.regexs.float)),
SM( " INITIAL TEMPERATURE\[K\] =\s+(?P<x_cp2k_md_temperature_instantaneous>{})".format(self.regexs.regex_f)), SM( " INITIAL TEMPERATURE\[K\] =\s+(?P<x_cp2k_md_temperature_instantaneous>{})".format(self.regexs.float)),
SM( " INITIAL BAROSTAT TEMP\[K\] =\s+(?P<x_cp2k_md_barostat_temperature_instantaneous>{})".format(self.regexs.regex_f)), SM( " INITIAL BAROSTAT TEMP\[K\] =\s+(?P<x_cp2k_md_barostat_temperature_instantaneous>{})".format(self.regexs.float)),
SM( " INITIAL PRESSURE\[bar\] =\s+(?P<x_cp2k_md_pressure_instantaneous__bar>{})".format(self.regexs.regex_f)), SM( " INITIAL PRESSURE\[bar\] =\s+(?P<x_cp2k_md_pressure_instantaneous__bar>{})".format(self.regexs.float)),
SM( " INITIAL VOLUME\[bohr\^3\] =\s+(?P<x_cp2k_md_volume_instantaneous__bohr3>{})".format(self.regexs.regex_f)), SM( " INITIAL VOLUME\[bohr\^3\] =\s+(?P<x_cp2k_md_volume_instantaneous__bohr3>{})".format(self.regexs.float)),
SM( " INITIAL CELL LNTHS\[bohr\] =\s+(?P<x_cp2k_md_cell_length_a_instantaneous__bohr>{0})\s+(?P<x_cp2k_md_cell_length_b_instantaneous__bohr>{0})\s+(?P<x_cp2k_md_cell_length_c_instantaneous__bohr>{0})".format(self.regexs.regex_f)), SM( " INITIAL CELL LNTHS\[bohr\] =\s+(?P<x_cp2k_md_cell_length_a_instantaneous__bohr>{0})\s+(?P<x_cp2k_md_cell_length_b_instantaneous__bohr>{0})\s+(?P<x_cp2k_md_cell_length_c_instantaneous__bohr>{0})".format(self.regexs.float)),
SM( " INITIAL CELL ANGLS\[deg\] =\s+(?P<x_cp2k_md_cell_angle_a_instantaneous__deg>{0})\s+(?P<x_cp2k_md_cell_angle_b_instantaneous__deg>{0})\s+(?P<x_cp2k_md_cell_angle_c_instantaneous__deg>{0})".format(self.regexs.regex_f)), SM( " INITIAL CELL ANGLS\[deg\] =\s+(?P<x_cp2k_md_cell_angle_a_instantaneous__deg>{0})\s+(?P<x_cp2k_md_cell_angle_b_instantaneous__deg>{0})\s+(?P<x_cp2k_md_cell_angle_c_instantaneous__deg>{0})".format(self.regexs.float)),
], ],
adHoc=self.adHoc_save_md_quickstep() adHoc=self.adHoc_save_md_quickstep()
), ),
...@@ -105,20 +105,20 @@ class CP2KMDParser(MainHierarchicalParser): ...@@ -105,20 +105,20 @@ class CP2KMDParser(MainHierarchicalParser):
self.cm.quickstep_calculation(), self.cm.quickstep_calculation(),
SM( " ENSEMBLE TYPE ="), SM( " ENSEMBLE TYPE ="),
SM( " STEP NUMBER ="), SM( " STEP NUMBER ="),
SM( " TIME \[fs\] =\s+(?P<x_cp2k_md_time__fs>{})".format(self.regexs.regex_f)), SM( " TIME \[fs\] =\s+(?P<x_cp2k_md_time__fs>{})".format(self.regexs.float)),
SM( " CONSERVED QUANTITY \[hartree\] =\s+(?P<x_cp2k_md_conserved_quantity__hartree>{})".format(self.regexs.regex_f)), SM( " CONSERVED QUANTITY \[hartree\] =\s+(?P<x_cp2k_md_conserved_quantity__hartree>{})".format(self.regexs.float)),
SM( " CPU TIME \[s\] =\s+(?P<x_cp2k_md_cpu_time_instantaneous>{})\s+(?P<x_cp2k_md_cpu_time_average>{})".format(self.regexs.regex_f, self.regexs.regex_f)), SM( " CPU TIME \[s\] =\s+(?P<x_cp2k_md_cpu_time_instantaneous>{})\s+(?P<x_cp2k_md_cpu_time_average>{})".format(self.regexs.float, self.regexs.float)),
SM( " ENERGY DRIFT PER ATOM \[K\] =\s+(?P<x_cp2k_md_energy_drift_instantaneous>{})\s+(?P<x_cp2k_md_energy_drift_average>{})".format(self.regexs.regex_f, self.regexs.regex_f)), SM( " ENERGY DRIFT PER ATOM \[K\] =\s+(?P<x_cp2k_md_energy_drift_instantaneous>{})\s+(?P<x_cp2k_md_energy_drift_average>{})".format(self.regexs.float, self.regexs.float)),
SM( " POTENTIAL ENERGY\[hartree\] =\s+(?P<x_cp2k_md_potential_energy_instantaneous__hartree>{})\s+(?P<x_cp2k_md_potential_energy_average__hartree>{})".format(self.regexs.regex_f, self.regexs.regex_f)), SM( " POTENTIAL ENERGY\[hartree\] =\s+(?P<x_cp2k_md_potential_energy_instantaneous__hartree>{})\s+(?P<x_cp2k_md_potential_energy_average__hartree>{})".format(self.regexs.float, self.regexs.float)),
SM( " KINETIC ENERGY \[hartree\] =\s+(?P<x_cp2k_md_kinetic_energy_instantaneous__hartree>{})\s+(?P<x_cp2k_md_kinetic_energy_average__hartree>{})".format(self.regexs.regex_f, self.regexs.regex_f)), SM( " KINETIC ENERGY \[hartree\] =\s+(?P<x_cp2k_md_kinetic_energy_instantaneous__hartree>{})\s+(?P<x_cp2k_md_kinetic_energy_average__hartree>{})".format(self.regexs.float, self.regexs.float)),
SM( " TEMPERATURE \[K\] =\s+(?P<x_cp2k_md_temperature_instantaneous>{})\s+(?P<x_cp2k_md_temperature_average>{})".format(self.regexs.regex_f, self.regexs.regex_f)), SM( " TEMPERATURE \[K\] =\s+(?P<x_cp2k_md_temperature_instantaneous>{})\s+(?P<x_cp2k_md_temperature_average>{})".format(self.regexs.float, self.regexs.float)),
SM( " PRESSURE \[bar\] =\s+(?P<x_cp2k_md_pressure_instantaneous__bar>{0})\s+(?P<x_cp2k_md_pressure_average__bar>{0})".format(self.regexs.regex_f)), SM( " PRESSURE \[bar\] =\s+(?P<x_cp2k_md_pressure_instantaneous__bar>{0})\s+(?P<x_cp2k_md_pressure_average__bar>{0})".format(self.regexs.float)),
SM( " BAROSTAT TEMP\[K\] =\s+(?P<x_cp2k_md_barostat_temperature_instantaneous>{0})\s+(?P<x_cp2k_md_barostat_temperature_average>{0})".format(self.regexs.regex_f)), SM( " BAROSTAT TEMP\[K\] =\s+(?P<x_cp2k_md_barostat_temperature_instantaneous>{0})\s+(?P<x_cp2k_md_barostat_temperature_average>{0})".format(self.regexs.float)),
SM( " VOLUME\[bohr\^3\] =\s+(?P<x_cp2k_md_volume_instantaneous__bohr3>{0})\s+(?P<x_cp2k_md_volume_average__bohr3>{0})".format(self.regexs.regex_f)), SM( " VOLUME\[bohr\^3\] =\s+(?P<x_cp2k_md_volume_instantaneous__bohr3>{0})\s+(?P<x_cp2k_md_volume_average__bohr3>{0})".format(self.regexs.float)),
SM( " CELL LNTHS\[bohr\] =\s+(?P<x_cp2k_md_cell_length_a_instantaneous__bohr>{0})\s+(?P<x_cp2k_md_cell_length_b_instantaneous__bohr>{0})\s+(?P<x_cp2k_md_cell_length_c_instantaneous__bohr>{0})".format(self.regexs.regex_f)), SM( " CELL LNTHS\[bohr\] =\s+(?P<x_cp2k_md_cell_length_a_instantaneous__bohr>{0})\s+(?P<x_cp2k_md_cell_length_b_instantaneous__bohr>{0})\s+(?P<x_cp2k_md_cell_length_c_instantaneous__bohr>{0})".format(self.regexs.float)),
SM( " AVE. CELL LNTHS\[bohr\] =\s+(?P<x_cp2k_md_cell_length_a_average__bohr>{0})\s+(?P<x_cp2k_md_cell_length_b_average__bohr>{0})\s+(?P<x_cp2k_md_cell_length_c_average__bohr>{0})".format(self.regexs.regex_f)), SM( " AVE. CELL LNTHS\[bohr\] =\s+(?P<x_cp2k_md_cell_length_a_average__bohr>{0})\s+(?P<x_cp2k_md_cell_length_b_average__bohr>{0})\s+(?P<x_cp2k_md_cell_length_c_average__bohr>{0})".format(self.regexs.float)),
SM( " CELL ANGLS\[deg\] =\s+(?P<x_cp2k_md_cell_angle_a_instantaneous__deg>{0})\s+(?P<x_cp2k_md_cell_angle_b_instantaneous__deg>{0})\s+(?P<x_cp2k_md_cell_angle_c_instantaneous__deg>{0})".format(self.regexs.regex_f)), SM( " CELL ANGLS\[deg\] =\s+(?P<x_cp2k_md_cell_angle_a_instantaneous__deg>{0})\s+(?P<x_cp2k_md_cell_angle_b_instantaneous__deg>{0})\s+(?P<x_cp2k_md_cell_angle_c_instantaneous__deg>{0})".format(self.regexs.float)),
SM( " AVE. CELL ANGLS\[deg\] =\s+(?P<x_cp2k_md_cell_angle_a_average__deg>{0})\s+(?P<x_cp2k_md_cell_angle_b_average__deg>{0})\s+(?P<x_cp2k_md_cell_angle_c_average__deg>{0})".format(self.regexs.regex_f)), SM( " AVE. CELL ANGLS\[deg\] =\s+(?P<x_cp2k_md_cell_angle_a_average__deg>{0})\s+(?P<x_cp2k_md_cell_angle_b_average__deg>{0})\s+(?P<x_cp2k_md_cell_angle_c_average__deg>{0})".format(self.regexs.float)),
], ],
adHoc=self.adHoc_save_md_quickstep() adHoc=self.adHoc_save_md_quickstep()
), ),
...@@ -282,7 +282,7 @@ class CP2KMDParser(MainHierarchicalParser): ...@@ -282,7 +282,7 @@ class CP2KMDParser(MainHierarchicalParser):
# If NPT is run, and the cell file is not available, output the # If NPT is run, and the cell file is not available, output the
# simulation cel only on the first step to section_system # simulation cel only on the first step to section_system
if i_step == 0 and self.ensemble == "NPT" and self.cell_iterator is None: if i_step == 0 and self.ensemble == "NPT" and self.cell_iterator is None:
self.cache_service.push_array_values("simulation_cell", unit="angstrom") self.cache_service.addArrayValues("simulation_cell", unit="angstrom")
# Trajectory # Trajectory
if freqs["trajectory"][1] and self.traj_iterator is not None: if freqs["trajectory"][1] and self.traj_iterator is not None:
......
...@@ -63,7 +63,7 @@ class CP2KSinglePointParser(MainHierarchicalParser): ...@@ -63,7 +63,7 @@ class CP2KSinglePointParser(MainHierarchicalParser):
# Only in the single configuration calculations the number of scf # Only in the single configuration calculations the number of scf
# iterations is given. E.g. in geometry optimization there are multiple # iterations is given. E.g. in geometry optimization there are multiple
# scf calculations so this loses it's meaning sort of. # scf calculations so this loses it's meaning sort of.
self.cache_service.push_value("number_of_scf_iterations") self.cache_service.addValue("number_of_scf_iterations")
def onClose_x_cp2k_section_scf_iteration(self, backend, gIndex, section): def onClose_x_cp2k_section_scf_iteration(self, backend, gIndex, section):
"""Keep track of how many SCF iteration are made.""" """Keep track of how many SCF iteration are made."""
...@@ -91,8 +91,8 @@ class CP2KSinglePointParser(MainHierarchicalParser): ...@@ -91,8 +91,8 @@ class CP2KSinglePointParser(MainHierarchicalParser):
"""Stores the index of the section method. Should always be 0, but """Stores the index of the section method. Should always be 0, but
let's get it dynamically just in case there's something wrong. let's get it dynamically just in case there's something wrong.
""" """
self.cache_service.push_array_values("atom_positions", unit="angstrom") self.cache_service.addArrayValues("atom_positions", unit="angstrom")
self.cache_service.push_array_values("simulation_cell", unit="angstrom") self.cache_service.addArrayValues("simulation_cell", unit="angstrom")
#=========================================================================== #===========================================================================
# adHoc functions # adHoc functions
...@@ -1005,8 +1005,8 @@ class TestMDEnsembles(unittest.TestCase): ...@@ -1005,8 +1005,8 @@ class TestMDEnsembles(unittest.TestCase):
"angstrom" "angstrom"
) )
self.assertEqual(simulation_cell.shape[0], 11) self.assertEqual(simulation_cell.shape[0], 11)
self.assertTrue(np.array_equal(expected_cell_start, simulation_cell[0,:,:])) self.assertTrue(np.array_equal(expected_cell_start, simulation_cell[0, :, :]))
self.assertTrue(np.array_equal(expected_cell_end, simulation_cell[-1,:,:])) self.assertTrue(np.array_equal(expected_cell_end, simulation_cell[-1, :, :]))
#=============================================================================== #===============================================================================
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment