Ian Jauslin
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/driving.c')
-rw-r--r--src/driving.c50
1 files changed, 31 insertions, 19 deletions
diff --git a/src/driving.c b/src/driving.c
index f12c5fe..70c2564 100644
--- a/src/driving.c
+++ b/src/driving.c
@@ -1,28 +1,40 @@
#include "driving.h"
+#include "navier-stokes.h"
#include <math.h>
-_Complex double g_test(
- int kx,
- int ky
+// test driving function
+int g_test(
+ _Complex double* g,
+ int K1,
+ int K2
){
- //return sqrt(kx*kx*ky*ky)*exp(-(kx*kx+ky*ky));
- if(kx==2 && ky==-1){
- return 0.5+sqrt(3)/2*I;
+ int kx,ky;
+ for(kx=-K1;kx<=K1;kx++){
+ for (ky=-K2;ky<=K2;ky++){
+ if(kx==2 && ky==-1){
+ g[klookup(kx,ky,K1,K2)]=0.5+sqrt(3)/2*I;
+ }
+ else if(kx==-2 && ky==1){
+ g[klookup(kx,ky,K1,K2)]=0.5-sqrt(3)/2*I;
+ }
+ else{
+ g[klookup(kx,ky,K1,K2)]=0.;
+ }
+ }
}
- else if(kx==-2 && ky==1){
- return 0.5-sqrt(3)/2*I;
- }
- return 0.;
+
+ return 0;
}
-#define UNUSED(x) (void)(x)
-_Complex double g_zero(
- int kx,
- int ky
+int g_zero(
+ _Complex double* g,
+ int K1,
+ int K2
){
- // avoid unused variable warnings
- UNUSED(kx);
- UNUSED(ky);
- return 0.;
-}
+ int i;
+ for(i=0;i<(2*K1+1)*(2*K2+1);i++){
+ g[i]=0.;
+ }
+ return 0;
+}