Lyapunov command in main
This commit is contained in:
parent
b31fab8eae
commit
15bcb8b467
@ -20,6 +20,7 @@ limitations under the License.
|
|||||||
#define COMMAND_ENSTROPHY 2
|
#define COMMAND_ENSTROPHY 2
|
||||||
#define COMMAND_QUIET 3
|
#define COMMAND_QUIET 3
|
||||||
#define COMMAND_RESUME 4
|
#define COMMAND_RESUME 4
|
||||||
|
#define COMMAND_LYAPUNOV 5
|
||||||
|
|
||||||
#define DRIVING_ZERO 1
|
#define DRIVING_ZERO 1
|
||||||
#define DRIVING_TEST 2
|
#define DRIVING_TEST 2
|
||||||
|
@ -27,6 +27,7 @@ limitations under the License.
|
|||||||
#include "dstring.h"
|
#include "dstring.h"
|
||||||
#include "init.h"
|
#include "init.h"
|
||||||
#include "int_tools.h"
|
#include "int_tools.h"
|
||||||
|
#include "lyapunov.h"
|
||||||
#include "navier-stokes.h"
|
#include "navier-stokes.h"
|
||||||
|
|
||||||
|
|
||||||
@ -55,6 +56,8 @@ typedef struct nstrophy_parameters {
|
|||||||
bool keep_en_cst;
|
bool keep_en_cst;
|
||||||
FILE* initfile;
|
FILE* initfile;
|
||||||
FILE* drivingfile;
|
FILE* drivingfile;
|
||||||
|
double lyapunov_reset;
|
||||||
|
double D_epsilon;
|
||||||
} nstrophy_parameters;
|
} nstrophy_parameters;
|
||||||
|
|
||||||
// usage message
|
// usage message
|
||||||
@ -279,6 +282,9 @@ int main (
|
|||||||
else if(command==COMMAND_QUIET){
|
else if(command==COMMAND_QUIET){
|
||||||
quiet(parameters.K1, parameters.K2, parameters.N1, parameters.N2, parameters.final_time, parameters.nu, parameters.delta, parameters.L, parameters.adaptive_tolerance, parameters.adaptive_factor, parameters.max_delta, parameters.adaptive_norm, parameters.starting_time, u0, g, parameters.irreversible, parameters.keep_en_cst, parameters.init_en, parameters.algorithm, nthreads, savefile);
|
quiet(parameters.K1, parameters.K2, parameters.N1, parameters.N2, parameters.final_time, parameters.nu, parameters.delta, parameters.L, parameters.adaptive_tolerance, parameters.adaptive_factor, parameters.max_delta, parameters.adaptive_norm, parameters.starting_time, u0, g, parameters.irreversible, parameters.keep_en_cst, parameters.init_en, parameters.algorithm, nthreads, savefile);
|
||||||
}
|
}
|
||||||
|
else if(command==COMMAND_LYAPUNOV){
|
||||||
|
lyapunov(parameters.K1, parameters.K2, parameters.N1, parameters.N2, parameters.final_time, parameters.lyapunov_reset, parameters.nu, parameters.D_epsilon, parameters.delta, parameters.L, parameters.adaptive_tolerance, parameters.adaptive_factor, parameters.max_delta, parameters.adaptive_norm, u0, g, parameters.irreversible, parameters.keep_en_cst, parameters.init_en, parameters.algorithm, parameters.starting_time, nthreads);
|
||||||
|
}
|
||||||
else if(command==0){
|
else if(command==0){
|
||||||
fprintf(stderr, "error: no command specified\n");
|
fprintf(stderr, "error: no command specified\n");
|
||||||
print_usage();
|
print_usage();
|
||||||
@ -501,6 +507,9 @@ int read_args(
|
|||||||
*command=COMMAND_RESUME;
|
*command=COMMAND_RESUME;
|
||||||
flag=CP_FLAG_RESUME;
|
flag=CP_FLAG_RESUME;
|
||||||
}
|
}
|
||||||
|
else if(strcmp(argv[i], "lyapunov")==0){
|
||||||
|
*command=COMMAND_LYAPUNOV;
|
||||||
|
}
|
||||||
else{
|
else{
|
||||||
fprintf(stderr, "error: unrecognized command: '%s'\n",argv[i]);
|
fprintf(stderr, "error: unrecognized command: '%s'\n",argv[i]);
|
||||||
return(-1);
|
return(-1);
|
||||||
|
Loading…
Reference in New Issue
Block a user