Skip to content

Commit ed4b173

Browse files
committed
modify scf_for_phonons factory to allow nosmearing
1 parent b5bd8df commit ed4b173

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

abipy/abio/factories.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1356,10 +1356,9 @@ def hybrid_scf_input(gs_input: AbinitInput,
13561356

13571357
def scf_for_phonons(structure, pseudos, kppa=None, ecut=None, pawecutdg=None, nband=None, accuracy="normal",
13581358
spin_mode="polarized", smearing="fermi_dirac:0.1 eV", charge=0.0, scf_algorithm=None,
1359-
shift_mode="Symmetric") -> AbinitInput:
1359+
shift_mode="Symmetric", nbdbuf=4) -> AbinitInput:
13601360

13611361
# add the band for nbdbuf, if needed
1362-
nbdbuf = 4
13631362
if nband is not None:
13641363
nband += nbdbuf
13651364

@@ -1368,7 +1367,7 @@ def scf_for_phonons(structure, pseudos, kppa=None, ecut=None, pawecutdg=None, nb
13681367
scf_algorithm=scf_algorithm, shift_mode=shift_mode)
13691368

13701369
# with no bands set and no smearing the minimum number of bands plus some nbdbuf
1371-
if nband is None and smearing is None:
1370+
if nband is None and (smearing is None or smearing == "nosmearing"):
13721371
nval = structure.num_valence_electrons(pseudos)
13731372
nval -= abiinput['charge']
13741373
nband = int(round(nval / 2) + nbdbuf)

0 commit comments

Comments
 (0)