Initialize output arrays to zero in fdderivs_c.C and fderivs_c.C

This commit is contained in:
2026-02-26 11:48:28 +08:00
committed by CGH0S7
parent d2c2214fa1
commit dfb79e3e11
2 changed files with 9 additions and 0 deletions

View File

@@ -73,6 +73,10 @@ void fdderivs(const int ex[3],
/* 输出清零fxx,fyy,fzz,fxy,fxz,fyz = 0 */
const size_t all = (size_t)ex1 * (size_t)ex2 * (size_t)ex3;
for (size_t p = 0; p < all; ++p) {
fxx[p] = ZEO; fyy[p] = ZEO; fzz[p] = ZEO;
fxy[p] = ZEO; fxz[p] = ZEO; fyz[p] = ZEO;
}
/*
* Fortran:

View File

@@ -74,6 +74,11 @@ void fderivs(const int ex[3],
// fx = fy = fz = 0
const size_t all = (size_t)ex1 * (size_t)ex2 * (size_t)ex3;
for (size_t p = 0; p < all; ++p) {
fx[p] = ZEO;
fy[p] = ZEO;
fz[p] = ZEO;
}
/*
* Fortran loops: