Handle "empty" irreps in finiterectlat-scatter.py (not tested!)

This commit is contained in:
Marek Nečada 2022-06-24 01:13:44 +03:00
parent bb15a2b035
commit ecac798529
2 changed files with 6 additions and 3 deletions

View File

@ -204,7 +204,7 @@ ir_contained = np.ones((nsp, nelem, ss.nirreps), dtype=bool)
for iri in range(ss.nirreps): for iri in range(ss.nirreps):
if ss.saecv_sizes[iri] == 0: if ss.saecv_sizes[iri] == 0:
logging.info('irrep %d/%d has an empty VSWF set, skipping') logging.info('irrep %d/%d has an empty VSWF set, skipping' % (iri, ss.nirreps))
continue continue
logging.info("processing irrep %d/%d" % (iri, ss.nirreps)) logging.info("processing irrep %d/%d" % (iri, ss.nirreps))
LU = None # to trigger garbage collection before the next call LU = None # to trigger garbage collection before the next call

View File

@ -70,8 +70,8 @@ ndir = a.theta.shape[0]
k_cart_arr = np.empty((nfreq, ndir, 3), dtype=float) k_cart_arr = np.empty((nfreq, ndir, 3), dtype=float)
wavenumbers = np.empty((nfreq,), dtype=float) wavenumbers = np.empty((nfreq,), dtype=float)
σ_ext_arr_ir = np.empty((nfreq, ndir, ss.nirreps), dtype=float) σ_ext_arr_ir = np.zeros((nfreq, ndir, ss.nirreps), dtype=float)
σ_scat_arr_ir = np.empty((nfreq, ndir, ss.nirreps), dtype=float) σ_scat_arr_ir = np.zeros((nfreq, ndir, ss.nirreps), dtype=float)
outfile_tmp = defaultprefix + ".tmp" if a.output is None else a.output + ".tmp" outfile_tmp = defaultprefix + ".tmp" if a.output is None else a.output + ".tmp"
@ -90,6 +90,9 @@ for i, omega in enumerate(ap.allomegas):
k_cart_arr[i] = sph2cart(k_sph_list) k_cart_arr[i] = sph2cart(k_sph_list)
for iri in range(ss.nirreps): for iri in range(ss.nirreps):
if ss.saecv_sizes[iri] == 0:
logging.info('irrep %d/%d has an empty VSWF set, skipping' % (iri, ss.nirreps))
continue
logging.info("processing irrep %d/%d" % (iri, ss.nirreps)) logging.info("processing irrep %d/%d" % (iri, ss.nirreps))
LU = None # to trigger garbage collection before the next call LU = None # to trigger garbage collection before the next call
translation_matrix = None translation_matrix = None