Enforce reality directly in RK
This commit is contained in:
parent
1616b6bbae
commit
184b46f756
@ -348,6 +348,13 @@ int ns_step(
|
||||
}
|
||||
}
|
||||
|
||||
// enforce u(-k)=u(k)^*
|
||||
for(kx=-K1;kx<=K1;kx++){
|
||||
for(ky=-K2;ky<=K2;ky++){
|
||||
u[klookup(kx,ky,2*K1+1,2*K2+1)]=(u[klookup(kx,ky,2*K1+1,2*K2+1)]+conj(u[klookup(-kx,-ky,2*K1+1,2*K2+1)]))/2;
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
@ -470,12 +477,14 @@ int ns_T(
|
||||
// inverse fft
|
||||
fftw_execute(ifft.fft_plan);
|
||||
|
||||
/*
|
||||
// enforce T(u,-k)=T(u,k)^*
|
||||
for(kx=-K1;kx<=K1;kx++){
|
||||
for(ky=-K2;ky<=K2;ky++){
|
||||
ifft.fft[klookup(kx,ky,N1,N2)]=(ifft.fft[klookup(kx,ky,N1,N2)]+conj(ifft.fft[klookup(-kx,-ky,N1,N2)]))/2;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user