Use 'enstrophy' instead of energy, and print enstrophy*alpha

This commit is contained in:
Ian Jauslin 2023-05-10 19:29:31 -04:00
parent e5a126f45a
commit 7c007e9342
4 changed files with 10 additions and 10 deletions

View File

@ -1,5 +1,5 @@
#define COMMAND_UK 1 #define COMMAND_UK 1
#define COMMAND_EEA 2 #define COMMAND_ENSTROPHY 2
#define COMMAND_QUIET 3 #define COMMAND_QUIET 3
#define DRIVING_ZERO 1 #define DRIVING_ZERO 1

View File

@ -155,10 +155,10 @@ int main (
if (command==COMMAND_UK){ 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); 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 // register signal handler to handle aborts
signal(SIGINT, sig_handler); 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){ 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); 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){ if(strcmp(argv[i], "uk")==0){
*command=COMMAND_UK; *command=COMMAND_UK;
} }
else if(strcmp(argv[i], "energy")==0){ else if(strcmp(argv[i], "enstrophy")==0){
*command=COMMAND_EEA; *command=COMMAND_ENSTROPHY;
} }
else if(strcmp(argv[i], "quiet")==0){ else if(strcmp(argv[i], "quiet")==0){
*command=COMMAND_QUIET; *command=COMMAND_QUIET;

View File

@ -84,8 +84,8 @@ int uk(
return(0); return(0);
} }
// compute energy, enstrophy, alpha as a function of time in the I-NS equation // compute enstrophy, alpha as a function of time
int eea( int enstrophy(
int K1, int K1,
int K2, int K2,
int N1, 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); 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); free(params);
} }
fprintf(savefile," energy\n"); fprintf(savefile," enstrophy\n");
// save final u to savefile // save final u to savefile
if(savefile==stderr || savefile==stdout){ if(savefile==stderr || savefile==stdout){

View File

@ -20,8 +20,8 @@ typedef struct fft_vects {
// compute u_k // 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); 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 // compute 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); 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) // 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); 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);