mirror of
https://github.com/triqs/dft_tools
synced 2024-08-29 23:33:43 +02:00
Some changes wien2k_converter
convert_bands_input and convert_parproj_input can now be called without calling convert_dft_input directly before.
This commit is contained in:
parent
b24a836372
commit
60c6466ace
@ -256,6 +256,16 @@ class Wien2kConverter(ConverterTools):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
if not (mpi.is_master_node()): return
|
if not (mpi.is_master_node()): return
|
||||||
|
|
||||||
|
# get needed data from hdf file
|
||||||
|
ar = HDFArchive(self.hdf_file,'a')
|
||||||
|
things_to_read = ['SP','SO','n_shells','n_k','n_orbitals','shells']
|
||||||
|
|
||||||
|
for it in things_to_read:
|
||||||
|
if not hasattr(self,it): setattr(self,it,ar[self.dft_subgrp][it])
|
||||||
|
self.n_spin_blocs = self.SP + 1 - self.SO
|
||||||
|
del ar
|
||||||
|
|
||||||
mpi.report("Reading input from %s..."%self.parproj_file)
|
mpi.report("Reading input from %s..."%self.parproj_file)
|
||||||
|
|
||||||
dens_mat_below = [ [numpy.zeros([self.shells[ish]['dim'],self.shells[ish]['dim']],numpy.complex_) for ish in range(self.n_shells)]
|
dens_mat_below = [ [numpy.zeros([self.shells[ish]['dim'],self.shells[ish]['dim']],numpy.complex_) for ish in range(self.n_shells)]
|
||||||
@ -332,10 +342,19 @@ class Wien2kConverter(ConverterTools):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
if not (mpi.is_master_node()): return
|
if not (mpi.is_master_node()): return
|
||||||
mpi.report("Reading input from %s..."%self.band_file)
|
|
||||||
|
|
||||||
R = ConverterTools.read_fortran_file(self,self.band_file,self.fortran_to_replace)
|
|
||||||
try:
|
try:
|
||||||
|
# get needed data from hdf file
|
||||||
|
ar = HDFArchive(self.hdf_file,'a')
|
||||||
|
things_to_read = ['SP','SO','n_corr_shells','n_shells','corr_shells','shells','energy_unit']
|
||||||
|
|
||||||
|
for it in things_to_read:
|
||||||
|
if not hasattr(self,it): setattr(self,it,ar[self.dft_subgrp][it])
|
||||||
|
self.n_spin_blocs = self.SP + 1 - self.SO
|
||||||
|
del ar
|
||||||
|
|
||||||
|
mpi.report("Reading input from %s..."%self.band_file)
|
||||||
|
R = ConverterTools.read_fortran_file(self,self.band_file,self.fortran_to_replace)
|
||||||
n_k = int(R.next())
|
n_k = int(R.next())
|
||||||
|
|
||||||
# read the list of n_orbitals for all k points
|
# read the list of n_orbitals for all k points
|
||||||
@ -392,10 +411,13 @@ class Wien2kConverter(ConverterTools):
|
|||||||
for j in range(n_orbitals[ik,isp]):
|
for j in range(n_orbitals[ik,isp]):
|
||||||
proj_mat_all[ik,isp,ish,ir,i,j] += 1j * R.next()
|
proj_mat_all[ik,isp,ish,ir,i,j] += 1j * R.next()
|
||||||
|
|
||||||
|
R.close()
|
||||||
|
|
||||||
|
except KeyError:
|
||||||
|
raise "convert_bands_input : Needed data not found in hdf file. Consider calling convert_dft_input first!"
|
||||||
except StopIteration : # a more explicit error if the file is corrupted.
|
except StopIteration : # a more explicit error if the file is corrupted.
|
||||||
raise "Wien2k_converter : reading file band_file failed!"
|
raise "Wien2k_converter : reading file band_file failed!"
|
||||||
|
|
||||||
R.close()
|
|
||||||
# Reading done!
|
# Reading done!
|
||||||
|
|
||||||
# Save it to the HDF:
|
# Save it to the HDF:
|
||||||
|
@ -711,8 +711,8 @@ class SumkDFTTools(SumkDFT):
|
|||||||
if(iw + iOm_mesh[iq] >= n_om or self.omega[iw] < -self.Om_mesh[iq] + energy_window[0] or self.omega[iw] > self.Om_mesh[iq] + energy_window[1]): continue
|
if(iw + iOm_mesh[iq] >= n_om or self.omega[iw] < -self.Om_mesh[iq] + energy_window[0] or self.omega[iw] > self.Om_mesh[iq] + energy_window[1]): continue
|
||||||
|
|
||||||
self.Gamma_w[direction][iq, iw] += (numpy.dot(numpy.dot(numpy.dot(vel_R[v_i, v_i, dir_to_int[direction[0]]],
|
self.Gamma_w[direction][iq, iw] += (numpy.dot(numpy.dot(numpy.dot(vel_R[v_i, v_i, dir_to_int[direction[0]]],
|
||||||
A_kw[isp][A_i, A_i, iw]), vel_R[v_i, v_i, dir_to_int[direction[1]]]),
|
A_kw[isp][A_i, A_i, iw + iOm_mesh[iq]]), vel_R[v_i, v_i, dir_to_int[direction[1]]]),
|
||||||
A_kw[isp][A_i, A_i, iw + iOm_mesh[iq]]).trace().real * self.bz_weights[ik])
|
A_kw[isp][A_i, A_i, iw ]).trace().real * self.bz_weights[ik])
|
||||||
|
|
||||||
for direction in self.directions:
|
for direction in self.directions:
|
||||||
self.Gamma_w[direction] = (mpi.all_reduce(mpi.world, self.Gamma_w[direction], lambda x, y : x + y)
|
self.Gamma_w[direction] = (mpi.all_reduce(mpi.world, self.Gamma_w[direction], lambda x, y : x + y)
|
||||||
|
Loading…
Reference in New Issue
Block a user