50 fprintf(stderr,
"Error in ShallowWater2DInitialize(): nvars has to be %d.\n",
_MODEL_NVARS_);
54 fprintf(stderr,
"Error in ShallowWater2DInitialize(): ndims has to be %d.\n",
_MODEL_NDIMS_);
69 if (!count) printf(
"Reading physical model inputs from file \"physics.inp\".\n");
70 in = fopen(
"physics.inp",
"r");
71 if (!in) printf(
"Warning: File \"physics.inp\" not found. Using default values.\n");
74 ferr = fscanf(in,
"%s",word);
if (ferr != 1)
return(1);
75 if (!strcmp(word,
"begin")){
76 while (strcmp(word,
"end")){
77 ferr = fscanf(in,
"%s",word);
if (ferr != 1)
return(1);
78 if (!strcmp(word,
"gravity")) {
79 ferr = fscanf(in,
"%lf",&physics->
g);
80 if (ferr != 1)
return(1);
81 }
else if (!strcmp(word,
"topography_type")) {
82 ferr = fscanf(in,
"%d",&physics->
bt_type);
83 if (ferr != 1)
return(1);
84 }
else if (!strcmp(word,
"coriolis_fhat")) {
85 ferr = fscanf(in,
"%lf",&physics->
fhat);
86 if (ferr != 1)
return(1);
87 }
else if (!strcmp(word,
"coriolis_beta")) {
88 ferr = fscanf(in,
"%lf",&physics->
beta);
89 if (ferr != 1)
return(1);
90 }
else if (!strcmp(word,
"coriolis_D")) {
91 ferr = fscanf(in,
"%lf",&physics->
D);
92 if (ferr != 1)
return(1);
93 }
else if (!strcmp(word,
"upwinding")) {
95 if (ferr != 1)
return(1);
96 }
else if (strcmp(word,
"end")) {
98 ferr = fscanf(in,
"%s",useless);
if (ferr != 1)
return(ferr);
99 printf(
"Warning: keyword %s in file \"physics.inp\" with value %s not ",word,useless);
100 printf(
"recognized or extraneous. Ignoring.\n");
104 fprintf(stderr,
"Error: Illegal format in file \"physics.inp\".\n");
129 if (!mpi->
rank) fprintf(stderr,
"Error in ShallowWater2DInitialize(): %s is not a valid upwinding scheme.\n",
int ShallowWater2DLeftEigenvectors(double *u, double *L, void *p, int dir)
int npoints_local_wghosts
int(* JFunction)(double *, double *, void *, int, int, int)
double(* ComputeCFL)(void *, void *, double, double)
int MPIBroadcast_double(double *, int, int, void *)
int ShallowWater2DRoeAverage(double *uavg, double *uL, double *uR, void *p)
int(* Upwind)(double *, double *, double *, double *, double *, double *, int, void *, double)
int(* GetRightEigenvectors)(double *, double *, void *, int)
MPI related function definitions.
int(* PhysicsOutput)(void *, void *, double)
int ShallowWater2DWriteTopography(void *, void *, double)
int ShallowWater2DSource(double *, double *, void *, void *, double)
int(* FFunction)(double *, double *, int, void *, double)
int(* PhysicsInput)(void *, void *, int, int, int *)
int ShallowWater2DUpwindRoe(double *, double *, double *, double *, double *, double *, int, void *, double)
int ShallowWater2DTopography(void *, void *, int, int, int *)
#define _MAX_STRING_SIZE_
char upw_choice[_MAX_STRING_SIZE_]
int(* AveragingFunction)(double *, double *, double *, void *)
int ShallowWater2DUpwindLLF(double *, double *, double *, double *, double *, double *, int, void *, double)
int(* SourceUpwind)(double *, double *, double *, double *, int, void *, double)
2D Shallow Water Equations
int ShallowWater2DRightEigenvectors(double *u, double *R, void *p, int dir)
double ShallowWater2DComputeCFL(void *s, void *m, double dt, double t)
int(* GetLeftEigenvectors)(double *, double *, void *, int)
int(* SFunction)(double *, double *, void *, void *, double)
int ShallowWater2DModifiedSolution(double *, double *, int, void *, void *, double)
int ShallowWater2DJacobian(double *, double *, void *, int, int, int)
Contains structure definition for hypar.
int(* UFunction)(double *, double *, int, void *, void *, double)
int MPIBroadcast_character(char *, int, int, void *)
int ShallowWater2DInitialize(void *, void *)
Some basic definitions and macros.
int ShallowWater2DSourceUpwindLLF(double *, double *, double *, double *, int, void *, double)
Contains macros and function definitions for common array operations.
int ShallowWater2DSourceUpwindRoe(double *, double *, double *, double *, int, void *, double)
Structure of MPI-related variables.
Structure containing variables and parameters specific to the 2D Shallow Water equations. This structure contains the physical parameters, variables, and function pointers specific to the 2D ShallowWater equations.
int ShallowWater2DFlux(double *f, double *u, int dir, void *s, double t)
Structure containing all solver-specific variables and functions.
int MPIBroadcast_integer(int *, int, int, void *)