Fix bug: every column of tangent flow needs to be evolved

This commit is contained in:
Ian Jauslin 2025-01-31 17:45:25 -05:00
parent 3fa3a86066
commit a47ec7896b

View File

@ -214,6 +214,7 @@ int lyapunov_D_step(
){ ){
int lx,ly; int lx,ly;
double alpha; double alpha;
int n;
// compute fft of u for future use // compute fft of u for future use
lyapunov_fft_u_T(u,K1,K2,N1,N2,fftu1,fftu2,fftu3,fftu4); lyapunov_fft_u_T(u,K1,K2,N1,N2,fftu1,fftu2,fftu3,fftu4);
@ -237,17 +238,18 @@ int lyapunov_D_step(
// loop over columns // loop over columns
for(lx=0;lx<=K1;lx++){ for(lx=0;lx<=K1;lx++){
for(ly=(lx>0 ? -K2 : 1);ly<=K2;ly++){ for(ly=(lx>0 ? -K2 : 1);ly<=K2;ly++){
for(n=0;n<=1;n++){
// do not use adaptive step algorithms for the tangent flow: it must be locked to the same times as u // do not use adaptive step algorithms for the tangent flow: it must be locked to the same times as u
if(algorithm==ALGORITHM_RK2){ if(algorithm==ALGORITHM_RK2){
lyapunov_D_step_rk2(flow+2*klookup_sym(lx,ly,K2)*MATSIZE, u, K1, K2, N1, N2, alpha, delta, L, g, tmp4, fftu1, fftu2, fftu3, fftu4, fft1, ifft, tmp1, tmp2, irreversible); lyapunov_D_step_rk2(flow+(2*klookup_sym(lx,ly,K2)+n)*MATSIZE, u, K1, K2, N1, N2, alpha, delta, L, g, tmp4, fftu1, fftu2, fftu3, fftu4, fft1, ifft, tmp1, tmp2, irreversible);
} else if (algorithm==ALGORITHM_RK4) { } else if (algorithm==ALGORITHM_RK4) {
lyapunov_D_step_rk4(flow+2*klookup_sym(lx,ly,K2)*MATSIZE, u, K1, K2, N1, N2, alpha, delta, L, g, tmp4, fftu1, fftu2, fftu3, fftu4, fft1, ifft, tmp1, tmp2, tmp3, irreversible); lyapunov_D_step_rk4(flow+(2*klookup_sym(lx,ly,K2)+n)*MATSIZE, u, K1, K2, N1, N2, alpha, delta, L, g, tmp4, fftu1, fftu2, fftu3, fftu4, fft1, ifft, tmp1, tmp2, tmp3, irreversible);
} else { } else {
fprintf(stderr,"bug: unknown algorithm for tangent flow: %u, contact ian.jauslin@rutgers.edu\n",algorithm); fprintf(stderr,"bug: unknown algorithm for tangent flow: %u, contact ian.jauslin@rutgers.edu\n",algorithm);
} }
} }
} }
}
return(0); return(0);
} }