Skip to content

Commit 96a081c

Browse files
committed
Add value check for TwoCenterIntegrator.
1 parent 6d1d220 commit 96a081c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

source/source_basis/module_nao/two_center_integrator.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ void TwoCenterIntegrator::calculate(const int itype1,
4848
return;
4949
}
5050

51+
if (m1 > l1 || m1 < -l1 || m2 > l2 || m2 < -l2)
52+
{
53+
ModuleBase::WARNING("TwoCenterIntegrator", "m should be in range [-l, l].");
54+
return;
55+
}
56+
5157
// unit vector along R
5258
ModuleBase::Vector3<double> uR = (R == 0.0 ? ModuleBase::Vector3<double>(0., 0., 1.) : vR / R);
5359

0 commit comments

Comments
 (0)