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(* PhysicsOutput)(void *, void *, double)
MPI related function definitions.
int ShallowWater2DLeftEigenvectors(double *, double *, void *, int)
char upw_choice[_MAX_STRING_SIZE_]
int(* SourceUpwind)(double *, double *, double *, double *, int, void *, double)
int MPIBroadcast_integer(int *, int, int, void *)
int(* AveragingFunction)(double *, double *, double *, void *)
Some basic definitions and macros.
double ShallowWater2DComputeCFL(void *, void *, double, double)
int ShallowWater2DTopography(void *, void *, int, int, int *)
int(* SFunction)(double *, double *, void *, void *, double)
2D Shallow Water Equations
int(* PhysicsInput)(void *, void *, int, int, int *)
int(* Upwind)(double *, double *, double *, double *, double *, double *, int, void *, double)
int MPIBroadcast_character(char *, int, int, void *)
int(* FFunction)(double *, double *, int, void *, double)
int ShallowWater2DModifiedSolution(double *, double *, int, void *, void *, double)
int ShallowWater2DSource(double *, double *, void *, void *, double)
int MPIBroadcast_double(double *, int, int, void *)
double(* ComputeCFL)(void *, void *, double, double)
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.
Structure containing all solver-specific variables and functions.
#define _MAX_STRING_SIZE_
int ShallowWater2DFlux(double *, double *, int, void *, double)
int ShallowWater2DJacobian(double *, double *, void *, int, int, int)
Contains structure definition for hypar.
int ShallowWater2DRightEigenvectors(double *, double *, void *, int)
int ShallowWater2DUpwindLLF(double *, double *, double *, double *, double *, double *, int, void *, double)
int ShallowWater2DWriteTopography(void *, void *, double)
int(* JFunction)(double *, double *, void *, int, int, int)
int ShallowWater2DSourceUpwindLLF(double *, double *, double *, double *, int, void *, double)
int ShallowWater2DSourceUpwindRoe(double *, double *, double *, double *, int, void *, double)
Structure of MPI-related variables.
int npoints_local_wghosts
Contains macros and function definitions for common array operations.
int(* GetRightEigenvectors)(double *, double *, void *, int)
int ShallowWater2DInitialize(void *s, void *m)
int(* GetLeftEigenvectors)(double *, double *, void *, int)
int ShallowWater2DRoeAverage(double *, double *, double *, void *)
int(* UFunction)(double *, double *, int, void *, void *, double)
int ShallowWater2DUpwindRoe(double *, double *, double *, double *, double *, double *, int, void *, double)