Skip to content

Commit 33cedb4

Browse files
authored
fix(debug): remove incorrect assert for nullptr in Overlap and EKinetic constructors (#7460)
Remove assert(this->SR != nullptr) in Overlap constructor and assert(this->hsk != nullptr) in EKinetic constructor. These pointers can be nullptr in normal operation (e.g., for force calculation), so the assert was incorrectly triggering when DEBUG_INFO=ON. Fixes #7021
1 parent 9b5ff76 commit 33cedb4

2 files changed

Lines changed: 0 additions & 2 deletions

File tree

source/source_lcao/module_operator_lcao/ekinetic.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ hamilt::EKinetic<hamilt::OperatorLCAO<TK, TR>>::EKinetic(
2222
this->ucell = ucell_in;
2323
#ifdef __DEBUG
2424
assert(this->ucell != nullptr);
25-
assert(this->hsk != nullptr);
2625
#endif
2726
// initialize HR to allocate sparse Ekinetic matrix memory
2827
// Only initialize if hR_in is not nullptr (for force calculation, hR_in can be nullptr)

source/source_lcao/module_operator_lcao/overlap.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ hamilt::Overlap<hamilt::OperatorLCAO<TK, TR>>::Overlap(HS_Matrix_K<TK>* hsk_in,
106106
this->SR = SR_in;
107107
#ifdef __DEBUG
108108
assert(this->ucell != nullptr);
109-
assert(this->SR != nullptr);
110109
#endif
111110
// Initialize SR to allocate sparse overlap matrix memory.
112111
// Only initialize if SR_in is not nullptr (for force calculation, SR_in can be nullptr).

0 commit comments

Comments
 (0)