gaussian init
This commit is contained in:
parent
2a24406ca6
commit
11af4a8ece
@ -280,15 +280,13 @@ int ns_init_u(
|
||||
){
|
||||
int kx,ky;
|
||||
|
||||
/*
|
||||
srand(17);
|
||||
|
||||
// random init (set half, then the other half are the conjugates)
|
||||
for(kx=0;kx<=K1;kx++){
|
||||
for(ky=-K2;ky<=K2;ky++){
|
||||
if (kx==0 && ky<=0){
|
||||
u[klookup(kx,ky,2*K1+1,2*K2+1)]=0.;
|
||||
}
|
||||
else{
|
||||
if (kx!=0 || ky>0){
|
||||
double x=-0.5+((double) rand())/RAND_MAX;
|
||||
double y=-0.5+((double) rand())/RAND_MAX;
|
||||
u[klookup(kx,ky,2*K1+1,2*K2+1)]=x+y*I;
|
||||
@ -310,6 +308,7 @@ int ns_init_u(
|
||||
u[klookup(kx,ky,2*K1+1,2*K2+1)]=u[klookup(kx,ky,2*K1+1,2*K2+1)]*sqrt(1.54511597324389e+02/rescale);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
@ -321,14 +320,12 @@ int ns_init_u(
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
// exponentially decaying init
|
||||
// gaussian init
|
||||
for(kx=-K1;kx<=K1;kx++){
|
||||
for(ky=-K2;ky<=K2;ky++){
|
||||
u[klookup(kx,ky,2*K1+1,2*K2+1)]=exp(-sqrt(kx*kx+ky*ky));
|
||||
u[klookup(kx,ky,2*K1+1,2*K2+1)]=(kx*kx+ky*ky)*exp(-(kx*kx+ky*ky));
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user