Welcome! Log In Create A New Profile

Advanced

Bug in "divideInPlace" for Scalarfields

Posted by kkkk  
Bug in "divideInPlace" for Scalarfields
January 30, 2017 08:12AM
Dear Palabos Developers,

there is a bug in the A_dividedBy_B_inplace_functionalXD (in dataAnalysisFunctionalXD.hh) which is used to divideInPlace a scalarfield by another one. The process routine reads

Language: C++
template<typename T> void A_dividedBy_B_inplace_functional3D<T>::process ( Box3D domain, ScalarField3D<T>& A, ScalarField3D<T>& B) { Dot3D offset = computeRelativeDisplacement(A,B); for (plint iX=domain.x0; iX<=domain.x1; ++iX) { for (plint iY=domain.y0; iY<=domain.y1; ++iY) { for (plint iZ=domain.z0; iZ<=domain.z1; ++iZ) { A.get(iX,iY,iZ) -= B.get(iX+offset.x,iY+offset.y,iZ+offset.z); } } } }

but it should be

Language: C++
template<typename T> void A_dividedBy_B_inplace_functional3D<T>::process ( Box3D domain, ScalarField3D<T>& A, ScalarField3D<T>& B) { Dot3D offset = computeRelativeDisplacement(A,B); for (plint iX=domain.x0; iX<=domain.x1; ++iX) { for (plint iY=domain.y0; iY<=domain.y1; ++iY) { for (plint iZ=domain.z0; iZ<=domain.z1; ++iZ) { A.get(iX,iY,iZ) /= B.get(iX+offset.x,iY+offset.y,iZ+offset.z); } } } }

Probably some copy paste error from the A_minus_B_inplace_functionalXD. The functional for tensorfield division in place is correct. This mistake is present for both 2D and 3D.

Regards,

kk
Re: Bug in "divideInPlace" for Scalarfields
January 30, 2017 08:25AM
Dear kk,

thank you very much for this bug report! The code will be corrected in the upcoming Palabos release.

Best,
Dimitris
Sorry, you do not have permission to post/reply in this forum.