Use 'enstrophy' instead of energy, and print enstrophy*alpha
This commit is contained in:
parent
e5a126f45a
commit
7c007e9342
@ -1,5 +1,5 @@
|
||||
#define COMMAND_UK 1
|
||||
#define COMMAND_EEA 2
|
||||
#define COMMAND_ENSTROPHY 2
|
||||
#define COMMAND_QUIET 3
|
||||
|
||||
#define DRIVING_ZERO 1
|
||||
|
@ -155,10 +155,10 @@ int main (
|
||||
if (command==COMMAND_UK){
|
||||
uk(parameters.K1, parameters.K2, parameters.N1, parameters.N2, parameters.nsteps, parameters.nu, parameters.delta, parameters.L, u0, g, parameters.irreversible, parameters.algorithm, parameters.print_freq, parameters.starting_time, nthreads, savefile);
|
||||
}
|
||||
else if(command==COMMAND_EEA){
|
||||
else if(command==COMMAND_ENSTROPHY){
|
||||
// register signal handler to handle aborts
|
||||
signal(SIGINT, sig_handler);
|
||||
eea(parameters.K1, parameters.K2, parameters.N1, parameters.N2, parameters.nsteps, parameters.nu, parameters.delta, parameters.L, u0, g, parameters.irreversible, parameters.algorithm, parameters.print_freq, parameters.starting_time, nthreads, savefile, (char*)argv[0], param_str, savefile_str);
|
||||
enstrophy(parameters.K1, parameters.K2, parameters.N1, parameters.N2, parameters.nsteps, parameters.nu, parameters.delta, parameters.L, u0, g, parameters.irreversible, parameters.algorithm, 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, parameters.starting_time, u0, g, parameters.irreversible, parameters.algorithm, nthreads, savefile);
|
||||
@ -322,8 +322,8 @@ int read_args(
|
||||
if(strcmp(argv[i], "uk")==0){
|
||||
*command=COMMAND_UK;
|
||||
}
|
||||
else if(strcmp(argv[i], "energy")==0){
|
||||
*command=COMMAND_EEA;
|
||||
else if(strcmp(argv[i], "enstrophy")==0){
|
||||
*command=COMMAND_ENSTROPHY;
|
||||
}
|
||||
else if(strcmp(argv[i], "quiet")==0){
|
||||
*command=COMMAND_QUIET;
|
||||
|
@ -84,8 +84,8 @@ int uk(
|
||||
return(0);
|
||||
}
|
||||
|
||||
// compute energy, enstrophy, alpha as a function of time in the I-NS equation
|
||||
int eea(
|
||||
// compute enstrophy, alpha as a function of time
|
||||
int enstrophy(
|
||||
int K1,
|
||||
int K2,
|
||||
int N1,
|
||||
@ -179,7 +179,7 @@ int eea(
|
||||
fprintf(savefile," -p \"%s;starting_time=%lu;nsteps=%lu;init=file:%s\"", params, t+1, (nsteps+starting_time < t+1 ? 0 : nsteps+starting_time-t-1), savefile_string);
|
||||
free(params);
|
||||
}
|
||||
fprintf(savefile," energy\n");
|
||||
fprintf(savefile," enstrophy\n");
|
||||
|
||||
// save final u to savefile
|
||||
if(savefile==stderr || savefile==stdout){
|
||||
|
@ -20,8 +20,8 @@ typedef struct fft_vects {
|
||||
// compute u_k
|
||||
int uk( 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 algorithm, uint64_t print_freq, uint64_t starting_time, unsigned int nthreadsl, FILE* savefile);
|
||||
|
||||
// compute energy, enstrophy and alpha
|
||||
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, unsigned int algorithm, uint64_t print_freq, uint64_t starting_time, unsigned int nthreads, FILE* savefile, char* cmd_string, char* params_string, char* savefile_string);
|
||||
// compute enstrophy and alpha
|
||||
int enstrophy( 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 algorithm, 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, uint64_t starting_time, _Complex double* u0, _Complex double* g, bool irreversible, unsigned int algorithm, unsigned int nthreads, FILE* savefile);
|
||||
|
Loading…
Reference in New Issue
Block a user