16 double*,
double*,
int,
void*,
double);
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");
int(* PrintStep)(void *, void *, double)
double FPPowerSystemComputeCFL(void *, void *, double, double)
double FPPowerSystemComputeDiffNumber(void *, void *, double, double)
int(* GFunction)(double *, double *, int, void *, double)
MPI related function definitions.
char SplitHyperbolicFlux[_MAX_STRING_SIZE_]
Some basic definitions and macros.
int(* Upwind)(double *, double *, double *, double *, double *, double *, int, void *, double)
int FPPowerSystemPrintStep(void *, void *, double)
int(* FFunction)(double *, double *, int, void *, double)
int FPPowerSystemDiffusion(double *, double *, int, void *, double)
double(* ComputeCFL)(void *, void *, double, double)
Structure containing all solver-specific variables and functions.
#define _MAX_STRING_SIZE_
Contains structure definition for hypar.
int FPPowerSystemPostStep(double *, void *, void *, double, int)
double(* ComputeDiffNumber)(void *, void *, double, double)
int FPPowerSystemAdvection(double *, double *, int, void *, double)
int(* PostStep)(double *, void *, void *, double, int)
Structure of MPI-related variables.
int FPPowerSystemInitialize(void *s, void *m)
int FPPowerSystemUpwind(double *, double *, double *, double *, double *, double *, int, void *, double)
Contains macros and function definitions for common array operations.