Commit 944d4f1d authored by Hagen-Henrik Kowalski's avatar Hagen-Henrik Kowalski
Browse files

Added

program_name
program_version
configuration_periodic_dimensions
single_configuration_calculation_to_system_ref
single_configuration_to_calculation_method_ref

And free energy is now given per atom not per cell
parent ea9a8d16
Pipeline #9280 passed with stage
in 37 minutes and 59 seconds
#### phonopy parser based on the original work of Joerg Mayer on phonopy-FHI-aims
#### phonopy parser written by Hagen-Henrik Kowalski and based on the original work of Joerg Mayer on phonopy-FHI-aims
import numpy as np
from PhononModulesNomad import *
......@@ -21,7 +21,7 @@ from nomadcore.parser_backend import *
from nomadcore.local_meta_info import loadJsonFile, InfoKindEl
parser_info = {"name": "parser_phonopy", "version": "0.1"}
parser_info = {"name": "parser_phonopy", "version": "1.0"}
path = "../../../../nomad-meta-info/meta_info/nomad_meta_info/phonopy.nomadmetainfo.json"
metaInfoPath = os.path.normpath(
......@@ -33,15 +33,20 @@ metaInfoEnv, warns = loadJsonFile(filePath=metaInfoPath,
def parse(name):
pbc = np.array((1, 1, 1), bool)
Parse = JsonParseEventsWriterBackend(metaInfoEnv)
Parse.startedParsingSession(name, parser_info)
sRun = Parse.openSection("section_run")
Parse.addValue("program_name", "Phonopy")
Parse.addValue("program_version", parser_info["version"])
Basesystem = Parse.openSection("section_system")
Parse.addArrayValues("configuration_periodic_dimensions", pbc)
Parse.addArrayValues("atom_labels", symbols)
Parse.addArrayValues("atom_positions", positions)
Parse.addArrayValues("simulation_cell", cell)
Parse.closeSection("section_system", Basesystem)
Supercellsystem = Parse.openSection("section_system")
Parse.addArrayValues("configuration_periodic_dimensions", pbc)
Parse.addArrayValues("atom_labels", super_sym)
Parse.addArrayValues("atom_positions", super_pos)
Parse.addArrayValues("simulation_cell", s_cell)
......@@ -53,6 +58,8 @@ def parse(name):
Parse.addValue("x_phonopy_displacement", displacement)
Parse.closeSection("section_method", method)
results = Parse.openSection("section_single_configuration_calculation")
Parse.addValue("single_configuration_calculation_to_system_ref", Basesystem)
Parse.addValue("single_configuration_to_calculation_method_ref", method)
Parse.addArrayValues("hessian_matrix", FC2)
GP = Get_Properties(FC2, cell, positions, symbols, supercell_matrix, sym, displacement)
GP.prem_emit(Parse, results)
......
#### phonopy parser based on the original work of Joerg Mayer on phonopy-FHI-aims
#### phonopy parser written by Hagen-Henrik Kowalski and based on the original work of Joerg Mayer on phonopy-FHI-aims
import numpy as np
import past
......@@ -212,6 +212,9 @@ class Get_Properties():
#### setting parameters
self.parameters = generate_kPath_ase(cell, symmetry_thresh)
####
#### getting number of atoms
self.num_of_atoms = num_of_atoms
......@@ -359,6 +362,10 @@ class Get_Properties():
#parser_info = self.parser_info
T, fe, entropy, cv = self.get_thermodynamical_properties(mesh = mesh, t_max = t_max, t_min = t_min, t_step = t_step)
#### deviding free energy by number of atoms to obtain free energy per atom
fe = fe/self.num_of_atoms
####
#### converting units
eVtoJoules = convert_unit_function('eV', 'joules')
eVperKtoJoules = convert_unit_function('eV*K**-1', 'joules*K**-1')
......
Supports Markdown
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