Compute energy

This commit is contained in:
2022-05-19 18:35:33 +02:00
parent 146903265a
commit 6fbcb86658
3 changed files with 60 additions and 1 deletions

View File

@@ -21,6 +21,7 @@ int set_parameter(char* lhs, char* rhs, int* K1, int* K2, int* N1, int* N2, unsi
#define COMMAND_UK 1
#define COMMAND_ENSTROPHY 2
#define COMMAND_QUIET 3
#define COMMAND_ENERGY 4
#define DRIVING_ZERO 1
#define DRIVING_TEST 2
@@ -72,8 +73,11 @@ int main (
if (command==COMMAND_UK){
uk(K1, K2, N1, N2, nsteps, nu, delta, g, print_freq, nthreads);
}
else if (command==COMMAND_ENERGY){
energy(K1, K2, N1, N2, nsteps, nu, delta, g, print_freq, nthreads);
}
else if(command==COMMAND_ENSTROPHY){
enstrophy(K1, K2, N1, N2, nsteps, nu, delta, g, print_freq, nthreads);
energy(K1, K2, N1, N2, nsteps, nu, delta, g, print_freq, nthreads);
}
else if(command==COMMAND_QUIET){
quiet(K1, K2, N1, N2, nsteps, nu, delta, g, nthreads);
@@ -173,6 +177,9 @@ int read_args(
else if(strcmp(argv[i], "quiet")==0){
*command=COMMAND_QUIET;
}
else if(strcmp(argv[i], "energy")==0){
*command=COMMAND_ENERGY;
}
else{
fprintf(stderr, "error: unrecognized command: '%s'\n",argv[i]);
return(-1);