Skip to content

Commit 084fde5

Browse files
committed
Fix: Fix the bug caused by assert(!has_soc)
1 parent 07dceb9 commit 084fde5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

source/module_cell/read_pp_complete.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void Pseudopot_upf::complete_default_h(Atom_pseudo& pp)
5858

5959
if (pp.jjj.empty()) {
6060
pp.jjj = std::vector<double>(pp.nbeta, 0.0);
61-
assert(!pp.has_so);
61+
assert(!pp.has_so or pp.nbeta == 0);
6262
for (int i=0; i<pp.nbeta; i++)
6363
{
6464
pp.jjj[i] = 0;
@@ -67,7 +67,7 @@ void Pseudopot_upf::complete_default_h(Atom_pseudo& pp)
6767

6868
if (pp.nn.empty()) {
6969
pp.nn = std::vector<int>(pp.nchi, 0);
70-
assert(!pp.has_so);
70+
assert(!pp.has_so or pp.nchi == 0);
7171
for (int i=0; i<pp.nchi; i++)
7272
{
7373
pp.nn[i] = 0;
@@ -76,7 +76,7 @@ void Pseudopot_upf::complete_default_h(Atom_pseudo& pp)
7676

7777
if (pp.jchi.empty()) {
7878
pp.jchi = std::vector<double>(pp.nchi, 0.0);
79-
assert(!pp.has_so);
79+
assert(!pp.has_so or pp.nchi == 0);
8080
for (int i=0; i<pp.nchi; i++)
8181
{
8282
pp.jchi[i] = 0;
@@ -120,7 +120,7 @@ void Pseudopot_upf::complete_default_atom(Atom_pseudo& pp)
120120

121121
if (pp.rho_atc.empty()) {
122122
pp.rho_atc = std::vector<double>(pp.mesh, 0.0);
123-
assert(!pp.nlcc);
123+
assert(!pp.nlcc or pp.mesh == 0);
124124
}
125125

126126
bool br = false;

0 commit comments

Comments
 (0)