Skip to content

Commit 735bfa1

Browse files
committed
update assert of nrxx, which can be 0 in some cases
1 parent 30ac4f6 commit 735bfa1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

source/source_hamilt/module_xc/xc_functional_libxc_tools.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,12 @@ std::vector<std::vector<double>> XC_Functional_Libxc::cal_dh(
245245
const double tpiba,
246246
const Charge* const chr)
247247
{
248-
assert(nrxx>0);
248+
//assert(nrxx>0); // this line will cause bug
249249
std::vector<std::vector<ModuleBase::Vector3<double>>> h(
250250
nspin,
251251
std::vector<ModuleBase::Vector3<double>>(nrxx) );
252252

253-
if( 1==nspin )
253+
if( nspin==1 )
254254
{
255255
#ifdef _OPENMP
256256
#pragma omp parallel for schedule(static, 1024)
@@ -292,7 +292,7 @@ ModuleBase::matrix XC_Functional_Libxc::convert_v_nspin4(
292292
const std::vector<double> &amag,
293293
const ModuleBase::matrix &v)
294294
{
295-
assert(nrxx>0);
295+
//assert(nrxx>0);
296296
assert(PARAM.inp.nspin==4);
297297
constexpr double vanishing_charge = 1.0e-10;
298298
ModuleBase::matrix v_nspin4(PARAM.inp.nspin, nrxx);

0 commit comments

Comments
 (0)