diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.cpp b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.cpp index ae6e007053a..f809c3f2c20 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.cpp +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.cpp @@ -138,24 +138,24 @@ PsatdAlgorithmComoving::pushSpectralFields (SpectralFieldData& f) const const Complex X4 = X4_arr(i,j,k); // Update E - fields(i,j,k,Idx.Ex) = std::nan(""); //C*Ex_old + S_ck*c2*I*(ky_mod*Bz_old - kz_mod*By_old) - //+ X4*Jx - I*(X2*rho_new - X3*rho_old)*kx_mod; + fields(i,j,k,Idx.Ex) = C*Ex_old + S_ck*c2*I*(ky_mod*Bz_old - kz_mod*By_old) + + X4*Jx - I*(X2*rho_new - X3*rho_old)*kx_mod; - fields(i,j,k,Idx.Ey) = std::nan(""); //C*Ey_old + S_ck*c2*I*(kz_mod*Bx_old - kx_mod*Bz_old) - //+ X4*Jy - I*(X2*rho_new - X3*rho_old)*ky_mod; + fields(i,j,k,Idx.Ey) = C*Ey_old + S_ck*c2*I*(kz_mod*Bx_old - kx_mod*Bz_old) + + X4*Jy - I*(X2*rho_new - X3*rho_old)*ky_mod; - fields(i,j,k,Idx.Ez) = std::nan(""); //C*Ez_old + S_ck*c2*I*(kx_mod*By_old - ky_mod*Bx_old) - //+ X4*Jz - I*(X2*rho_new - X3*rho_old)*kz_mod; + fields(i,j,k,Idx.Ez) = C*Ez_old + S_ck*c2*I*(kx_mod*By_old - ky_mod*Bx_old) + + X4*Jz - I*(X2*rho_new - X3*rho_old)*kz_mod; // Update B - fields(i,j,k,Idx.Bx) = std::nan(""); //C*Bx_old - S_ck*I*(ky_mod*Ez_old - kz_mod*Ey_old) - //+ X1*I*(ky_mod*Jz - kz_mod*Jy); + fields(i,j,k,Idx.Bx) = C*Bx_old - S_ck*I*(ky_mod*Ez_old - kz_mod*Ey_old) + + X1*I*(ky_mod*Jz - kz_mod*Jy); - fields(i,j,k,Idx.By) = std::nan(""); //C*By_old - S_ck*I*(kz_mod*Ex_old - kx_mod*Ez_old) - //+ X1*I*(kz_mod*Jx - kx_mod*Jz); + fields(i,j,k,Idx.By) = C*By_old - S_ck*I*(kz_mod*Ex_old - kx_mod*Ez_old) + + X1*I*(kz_mod*Jx - kx_mod*Jz); - fields(i,j,k,Idx.Bz) = std::nan(""); //C*Bz_old - S_ck*I*(kx_mod*Ey_old - ky_mod*Ex_old) - //+ X1*I*(kx_mod*Jy - ky_mod*Jx); + fields(i,j,k,Idx.Bz) = C*Bz_old - S_ck*I*(kx_mod*Ey_old - ky_mod*Ex_old) + + X1*I*(kx_mod*Jy - ky_mod*Jx); }); } } diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJConstantInTime.cpp b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJConstantInTime.cpp index 78422f8a408..991bf981924 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJConstantInTime.cpp +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmJConstantInTime.cpp @@ -845,18 +845,18 @@ PsatdAlgorithmJConstantInTime::VayDeposition (SpectralFieldData& field_data) #endif // Compute Jx - if (kx_mod != 0._rt) { fields(i,j,k,Idx.Jx_mid) = std::nan(""); } //I * Dx / kx_mod; } - else { fields(i,j,k,Idx.Jx_mid) = std::nan(""); } //0._rt; } + if (kx_mod != 0._rt) { fields(i,j,k,Idx.Jx_mid) = I * Dx / kx_mod; } + else { fields(i,j,k,Idx.Jx_mid) = 0._rt; } #if defined(WARPX_DIM_3D) // Compute Jy - if (ky_mod != 0._rt) { fields(i,j,k,Idx.Jy_mid) = std::nan(""); } //I * Dy / ky_mod; } - else { fields(i,j,k,Idx.Jy_mid) = std::nan(""); } //0._rt; } + if (ky_mod != 0._rt) { fields(i,j,k,Idx.Jy_mid) = I * Dy / ky_mod; } + else { fields(i,j,k,Idx.Jy_mid) = 0._rt; } #endif // Compute Jz - if (kz_mod != 0._rt) { fields(i,j,k,Idx.Jz_mid) = std::nan(""); } //I * Dz / kz_mod; } - else { fields(i,j,k,Idx.Jz_mid) = std::nan(""); } //0._rt; } + if (kz_mod != 0._rt) { fields(i,j,k,Idx.Jz_mid) = I * Dz / kz_mod; } + else { fields(i,j,k,Idx.Jz_mid) = 0._rt; } }); } }