Bug in "divideInPlace" for Scalarfields

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

[code=“cpp”]
template
void A_dividedBy_B_inplace_functional3D::process (
Box3D domain, ScalarField3D& A, ScalarField3D& 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

[code="cpp"]
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

Dear kk,

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

Best,
Dimitris