savefile and initfile

This commit is contained in:
2022-05-27 16:09:17 -04:00
parent 6b96c2d946
commit 0cdb914b57
7 changed files with 231 additions and 21 deletions

View File

@@ -1,4 +1,5 @@
#include "navier-stokes.h"
#include "io.h"
#include <math.h>
#include <stdlib.h>
@@ -15,7 +16,8 @@ int uk(
_Complex double* u0,
_Complex double* g,
unsigned int print_freq,
unsigned int nthreads
unsigned int nthreads,
FILE* savefile
){
_Complex double* u;
_Complex double* tmp1;
@@ -65,6 +67,9 @@ int uk(
}
}
// save final entry to savefile
write_u(u, K1, K2, savefile);
ns_free_tmps(u, tmp1, tmp2, tmp3, fft1, fft2, ifft);
return(0);
}
@@ -82,7 +87,8 @@ int eea(
_Complex double* u0,
_Complex double* g,
unsigned int print_freq,
unsigned int nthreads
unsigned int nthreads,
FILE* savefile
){
_Complex double* u;
_Complex double* tmp1;
@@ -126,6 +132,9 @@ int eea(
}
}
// save final entry to savefile
write_u(u, K1, K2, savefile);
ns_free_tmps(u, tmp1, tmp2, tmp3, fft1, fft2, ifft);
return(0);
}
@@ -142,7 +151,8 @@ int quiet(
double L,
_Complex double* u0,
_Complex double* g,
unsigned int nthreads
unsigned int nthreads,
FILE* savefile
){
_Complex double* u;
_Complex double* tmp1;
@@ -162,6 +172,9 @@ int quiet(
ins_step(u, K1, K2, N1, N2, nu, delta, L, g, fft1, fft2, ifft, tmp1, tmp2, tmp3);
}
// save final entry to savefile
write_u(u, K1, K2, savefile);
ns_free_tmps(u, tmp1, tmp2, tmp3, fft1, fft2, ifft);
return(0);
}