31 fprintf(stderr,
"Error in FPPowerSystemInitialize(): nvars has to be %d.\n",
_MODEL_NVARS_);
35 fprintf(stderr,
"Error in FPPowerSystemInitialize(): ndims has to be %d.\n",
_MODEL_NDIMS_);
49 physics->
O_s = 120*(4.0*atan(1.0));
55 if ((!mpi->
rank) && (!count)) printf(
"Reading physical model inputs from file \"physics.inp\".\n");
56 in = fopen(
"physics.inp",
"r");
58 fprintf(stderr,
"Error: File \"physics.inp\" not found.\n");
62 ferr = fscanf(in,
"%s",word);
if (ferr != 1)
return(1);
63 if (!strcmp(word,
"begin")){
64 while (strcmp(word,
"end")){
65 ferr = fscanf(in,
"%s",word);
if (ferr != 1)
return(1);
66 if (!strcmp(word,
"inertia")) {ferr=fscanf(in,
"%lf",&physics->
H );
if(ferr!=1)
return(1);}
67 else if (!strcmp(word,
"omega_s")) {ferr=fscanf(in,
"%lf",&physics->
O_s);
if(ferr!=1)
return(1);}
68 else if (!strcmp(word,
"E" )) {ferr=fscanf(in,
"%lf",&physics->
E );
if(ferr!=1)
return(1);}
69 else if (!strcmp(word,
"V" )) {ferr=fscanf(in,
"%lf",&physics->
V );
if(ferr!=1)
return(1);}
70 else if (!strcmp(word,
"g1" )) {ferr=fscanf(in,
"%lf",&physics->
g1 );
if(ferr!=1)
return(1);}
71 else if (!strcmp(word,
"g2" )) {ferr=fscanf(in,
"%lf",&physics->
g2 );
if(ferr!=1)
return(1);}
72 else if (!strcmp(word,
"D" )) {ferr=fscanf(in,
"%lf",&physics->
D );
if(ferr!=1)
return(1);}
73 else if (!strcmp(word,
"PM_min" )) {ferr=fscanf(in,
"%lf",&physics->
Pm );
if(ferr!=1)
return(1);}
74 else if (!strcmp(word,
"lambda" )) {ferr=fscanf(in,
"%lf",&physics->
l );
if(ferr!=1)
return(1);}
75 else if (!strcmp(word,
"q" )) {ferr=fscanf(in,
"%lf",&physics->
q );
if(ferr!=1)
return(1);}
76 else if (!strcmp(word,
"tf" )) {ferr=fscanf(in,
"%lf",&physics->
tf );
if(ferr!=1)
return(1);}
77 else if (!strcmp(word,
"tcl" )) {ferr=fscanf(in,
"%lf",&physics->
tcl);
if(ferr!=1)
return(1);}
80 fprintf(stderr,
"Error: Illegal format in file \"physics.inp\".\n");
88 fprintf(stderr,
"Error in FPPowerSystemInitialize: This physical model does not have a splitting ");
89 fprintf(stderr,
"of the hyperbolic term defined.\n");
double(* ComputeCFL)(void *, void *, double, double)
int FPPowerSystemAdvection(double *f, double *u, int dir, void *s, double t)
double FPPowerSystemComputeDiffNumber(void *s, void *m, double dt, double t)
int(* Upwind)(double *, double *, double *, double *, double *, double *, int, void *, double)
int(* FFunction)(double *, double *, int, void *, double)
int FPPowerSystemDiffusion(double *f, double *u, int dir, void *s, double t)
#define _MAX_STRING_SIZE_
double(* ComputeDiffNumber)(void *, void *, double, double)
char SplitHyperbolicFlux[_MAX_STRING_SIZE_]
int(* PrintStep)(void *, void *, double)
double FPPowerSystemComputeCFL(void *s, void *m, double dt, double t)
int FPPowerSystemPrintStep(void *, void *, double)
int FPPowerSystemUpwind(double *, double *, double *, double *, double *, double *, int, void *, double)
Structure of MPI-related variables.
Structure containing all solver-specific variables and functions.
int FPPowerSystemPostStep(double *, void *, void *, double, int)
int(* GFunction)(double *, double *, int, void *, double)
int(* PostStep)(double *, void *, void *, double, int)