Do not enforce symmetry on T: only the k>0 matter anyways
This commit is contained in:
parent
731244a83d
commit
5d0a1bcc6f
@ -152,7 +152,7 @@ int main (
|
||||
eea(parameters.K1, parameters.K2, parameters.N1, parameters.N2, parameters.nsteps, parameters.nu, parameters.delta, parameters.L, u0, g, parameters.irreversible, parameters.print_freq, parameters.starting_time, nthreads, savefile, (char*)argv[0], param_str, savefile_str);
|
||||
}
|
||||
else if(command==COMMAND_QUIET){
|
||||
quiet(parameters.K1, parameters.K2, parameters.N1, parameters.N2, parameters.nsteps, parameters.nu, parameters.delta, parameters.L, u0, g, parameters.irreversible, nthreads, savefile);
|
||||
quiet(parameters.K1, parameters.K2, parameters.N1, parameters.N2, parameters.nsteps, parameters.nu, parameters.delta, parameters.L, parameters.starting_time, u0, g, parameters.irreversible, nthreads, savefile);
|
||||
}
|
||||
else if(command==0){
|
||||
fprintf(stderr, "error: no command specified\n");
|
||||
|
@ -207,6 +207,7 @@ int quiet(
|
||||
double nu,
|
||||
double delta,
|
||||
double L,
|
||||
uint64_t starting_time,
|
||||
_Complex double* u0,
|
||||
_Complex double* g,
|
||||
bool irreversible,
|
||||
@ -227,7 +228,7 @@ int quiet(
|
||||
copy_u(u, u0, K1, K2);
|
||||
|
||||
// iterate
|
||||
for(t=0;nsteps==0 || t<nsteps;t++){
|
||||
for(t=starting_time;nsteps==0 || t<starting_time+nsteps;t++){
|
||||
ns_step(u, K1, K2, N1, N2, nu, delta, L, g, fft1, fft2, ifft, tmp1, tmp2, tmp3, irreversible);
|
||||
}
|
||||
|
||||
@ -511,13 +512,6 @@ 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);
|
||||
}
|
||||
|
||||
@ -534,13 +528,13 @@ int ns_T_nofft(
|
||||
int px,py;
|
||||
int qx,qy;
|
||||
|
||||
// loop over K's (needs N1>=4*K1+1 and N2>=4*K2+1)
|
||||
if (N1<4*K1+1 || N2<4*K2+1){
|
||||
fprintf(stderr,"error: N1 and N2 need t be >= 4*K1+1 and 4*K2+1 respectively\n");
|
||||
// loop over K's (needs N1>=2*K1+1 and N2>=2*K2+1)
|
||||
if (N1<2*K1+1 || N2<2*K2+1){
|
||||
fprintf(stderr,"error: N1 and N2 need t be >= 2*K1+1 and 2*K2+1 respectively\n");
|
||||
return(-1);
|
||||
}
|
||||
for(kx=-2*K1;kx<=2*K1;kx++){
|
||||
for(ky=-2*K2;ky<=2*K2;ky++){
|
||||
for(kx=-K1;kx<=K1;kx++){
|
||||
for(ky=-K2;ky<=K2;ky++){
|
||||
// init
|
||||
out[klookup(kx,ky,N1,N2)]=0.;
|
||||
|
||||
@ -558,13 +552,6 @@ int ns_T_nofft(
|
||||
}
|
||||
}
|
||||
|
||||
// enforce T(u,-k)=T(u,k)^*
|
||||
for(kx=-K1;kx<=K1;kx++){
|
||||
for(ky=-K2;ky<=K2;ky++){
|
||||
out[klookup(kx,ky,N1,N2)]=(out[klookup(kx,ky,N1,N2)]+conj(out[klookup(-kx,-ky,N1,N2)]))/2;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ int uk( int K1, int K2, int N1, int N2, uint64_t nsteps, double nu, double delta
|
||||
int eea( int K1, int K2, int N1, int N2, uint64_t nsteps, double nu, double delta, double L, _Complex double* u0, _Complex double* g, bool irreversible, uint64_t print_freq, uint64_t starting_time, unsigned int nthreads, FILE* savefile, char* cmd_string, char* params_string, char* savefile_string);
|
||||
|
||||
// compute solution as a function of time, but do not print anything (useful for debugging)
|
||||
int quiet( int K1, int K2, int N1, int N2, uint64_t nsteps, double nu, double delta, double L, _Complex double* u0, _Complex double* g, bool irreversible, unsigned int nthreads, FILE* savefile);
|
||||
int quiet( int K1, int K2, int N1, int N2, uint64_t nsteps, double nu, double delta, double L, uint64_t starting_time, _Complex double* u0, _Complex double* g, bool irreversible, unsigned int nthreads, FILE* savefile);
|
||||
|
||||
|
||||
// initialize vectors for computation
|
||||
|
Loading…
Reference in New Issue
Block a user