mirror of
https://github.com/triqs/dft_tools
synced 2024-09-01 16:53:43 +02:00
Corrects a bug in convert_misc_input
This commit is contained in:
parent
8db46b16b5
commit
a24c7869b1
@ -380,6 +380,7 @@ class Wien2kConverter(ConverterTools):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
if not (mpi.is_master_node()): return
|
if not (mpi.is_master_node()): return
|
||||||
|
things_to_save = []
|
||||||
|
|
||||||
# Read relevant data from .oubwin/up/dn files
|
# Read relevant data from .oubwin/up/dn files
|
||||||
#############################################
|
#############################################
|
||||||
@ -397,7 +398,6 @@ class Wien2kConverter(ConverterTools):
|
|||||||
for isp, f in enumerate(files):
|
for isp, f in enumerate(files):
|
||||||
if os.path.exists(f):
|
if os.path.exists(f):
|
||||||
mpi.report("Reading input from %s..."%f)
|
mpi.report("Reading input from %s..."%f)
|
||||||
|
|
||||||
R = ConverterTools.read_fortran_file(self, f, self.fortran_to_replace)
|
R = ConverterTools.read_fortran_file(self, f, self.fortran_to_replace)
|
||||||
assert int(R.next()) == n_k, "convert_misc_input: Number of k-points is inconsistent in oubwin file!"
|
assert int(R.next()) == n_k, "convert_misc_input: Number of k-points is inconsistent in oubwin file!"
|
||||||
assert int(R.next()) == SO, "convert_misc_input: SO is inconsistent in oubwin file!"
|
assert int(R.next()) == SO, "convert_misc_input: SO is inconsistent in oubwin file!"
|
||||||
@ -406,6 +406,7 @@ class Wien2kConverter(ConverterTools):
|
|||||||
band_window[isp][ik,0] = R.next() # lowest band
|
band_window[isp][ik,0] = R.next() # lowest band
|
||||||
band_window[isp][ik,1] = R.next() # highest band
|
band_window[isp][ik,1] = R.next() # highest band
|
||||||
R.next()
|
R.next()
|
||||||
|
things_to_save.append('band_window')
|
||||||
|
|
||||||
R.close() # Reading done!
|
R.close() # Reading done!
|
||||||
|
|
||||||
@ -426,6 +427,7 @@ class Wien2kConverter(ConverterTools):
|
|||||||
temp = R.readline().strip().split()
|
temp = R.readline().strip().split()
|
||||||
lattice_constants = numpy.array([float(t) for t in temp[0:3]])
|
lattice_constants = numpy.array([float(t) for t in temp[0:3]])
|
||||||
lattice_angles = numpy.array([float(t) for t in temp[3:6]]) * numpy.pi / 180.0
|
lattice_angles = numpy.array([float(t) for t in temp[3:6]]) * numpy.pi / 180.0
|
||||||
|
things_to_save.extend(['lattice_type', 'lattice_constants', 'lattice_angles'])
|
||||||
except IOError:
|
except IOError:
|
||||||
raise "convert_misc_input: reading file %s failed" %self.struct_file
|
raise "convert_misc_input: reading file %s failed" %self.struct_file
|
||||||
|
|
||||||
@ -454,13 +456,14 @@ class Wien2kConverter(ConverterTools):
|
|||||||
sym_i[ir, ic] = float(temp[ic])
|
sym_i[ir, ic] = float(temp[ic])
|
||||||
R.readline()
|
R.readline()
|
||||||
rot_symmetries.append(sym_i)
|
rot_symmetries.append(sym_i)
|
||||||
|
things_to_save.extend(['n_symmetries', 'rot_symmetries'])
|
||||||
|
things_to_save.append('rot_symmetries')
|
||||||
except IOError:
|
except IOError:
|
||||||
raise "convert_misc_input: reading file %s failed" %self.outputs_file
|
raise "convert_misc_input: reading file %s failed" %self.outputs_file
|
||||||
|
|
||||||
# Save it to the HDF:
|
# Save it to the HDF:
|
||||||
ar=HDFArchive(self.hdf_file,'a')
|
ar=HDFArchive(self.hdf_file,'a')
|
||||||
if not (misc_subgrp in ar): ar.create_group(misc_subgrp)
|
if not (misc_subgrp in ar): ar.create_group(misc_subgrp)
|
||||||
things_to_save = ['band_window', 'lattice_type', 'lattice_constants', 'lattice_angles', 'n_symmetries', 'rot_symmetries']
|
|
||||||
for it in things_to_save: ar[misc_subgrp][it] = locals()[it]
|
for it in things_to_save: ar[misc_subgrp][it] = locals()[it]
|
||||||
del ar
|
del ar
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user