Commits

Sam Preston committed 55015f6

Fixed bug in FluidKernelFFT, clearly DC component (zero component in freq. domain) should only be replaced for inverse operator -- zero freq. is in null space of L operator, should be zero after application of L

  • Participants
  • Parent commits 8afd856

Comments (0)

Files changed (2)

File Code/Cxx/src/alg/CFluidKernelFFT.cxx

 		}
 	}
 
-    if(this->mGamma == 0.f)
+    if(inverse && this->mGamma == static_cast<T>(0))
       {
       this->mFFTArrayX[0] = zeroFreqX;
       this->mFFTArrayY[0] = zeroFreqY;

File Code/Cxx/src/alg/GFluidKernelFFT.cu

     // element of FFT arrays) and replace it after kernel
     ComplexT<T> zeroFreqX={0.f,0.f}, 
        zeroFreqY={0.f,0.f}, zeroFreqZ={0.f,0.f};
-    if (this->mGamma == 0.f){
+    if (inverseOp && this->mGamma == static_cast<T>(0)){
        cudaMemcpy(&zeroFreqX,this->mFFTArrayX,
 		  sizeof(ComplexT<T>),cudaMemcpyDeviceToHost);
        cudaMemcpy(&zeroFreqY,this->mFFTArrayY,
          }
     }
 
-    if (this->mGamma == 0.f){
+    if (inverseOp && this->mGamma == static_cast<T>(0)){
        cudaMemcpy(this->mFFTArrayX,&zeroFreqX,
 		  sizeof(ComplexT<T>),cudaMemcpyHostToDevice);
        cudaMemcpy(this->mFFTArrayY,&zeroFreqY,