50 fprintf(stderr,
"Error in ShallowWater1DInitialize(): nvars has to be %d.\n",
_MODEL_NVARS_);
54 fprintf(stderr,
"Error in ShallowWater1DInitialize(): ndims has to be %d.\n",
_MODEL_NDIMS_);
66 if (!count) printf(
"Reading physical model inputs from file \"physics.inp\".\n");
67 in = fopen(
"physics.inp",
"r");
68 if (!in) printf(
"Warning: File \"physics.inp\" not found. Using default values.\n");
71 ferr = fscanf(in,
"%s",word);
if (ferr != 1)
return(1);
72 if (!strcmp(word,
"begin")){
73 while (strcmp(word,
"end")){
74 ferr = fscanf(in,
"%s",word);
if (ferr != 1)
return(1);
75 if (!strcmp(word,
"gravity")) {
76 ferr = fscanf(in,
"%lf",&physics->
g);
77 if (ferr != 1)
return(1);
78 }
else if (!strcmp(word,
"topography_type")) {
79 ferr = fscanf(in,
"%d",&physics->
bt_type);
80 if (ferr != 1)
return(1);
81 }
else if (!strcmp(word,
"upwinding")) {
83 if (ferr != 1)
return(1);
84 }
else if (strcmp(word,
"end")) {
86 ferr = fscanf(in,
"%s",useless);
if (ferr != 1)
return(ferr);
87 printf(
"Warning: keyword %s in file \"physics.inp\" with value %s not ",word,useless);
88 printf(
"recognized or extraneous. Ignoring.\n");
92 fprintf(stderr,
"Error: Illegal format in file \"physics.inp\".\n");
114 if (!mpi->
rank) fprintf(stderr,
"Error in ShallowWater1DInitialize(): %s is not a valid upwinding scheme.\n",
Structure containing variables and parameters specific to the 1D Shallow Water equations. This structure contains the physical parameters, variables, and function pointers specific to the 1D ShallowWater equations.
int(* PhysicsOutput)(void *, void *, double)
int ShallowWater1DInitialize(void *s, void *m)
int ShallowWater1DSource(double *, double *, void *, void *, double)
1D Shallow Water Equations
MPI related function definitions.
int ShallowWater1DRoeAverage(double *, double *, double *, void *)
int ShallowWater1DUpwindLLF(double *, double *, 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.
int(* SourceUpwind)(double *, double *, double *, double *, int, void *, double)
int ShallowWater1DJacobian(double *, double *, void *, int, int, int)
int(* SFunction)(double *, double *, void *, void *, double)
int(* PhysicsInput)(void *, void *, int, int, int *)
int(* Upwind)(double *, double *, double *, double *, double *, double *, int, void *, double)
int ShallowWater1DTopography(void *, void *, int, int, int *)
int MPIBroadcast_character(char *, int, int, void *)
int(* FFunction)(double *, double *, int, void *, double)
int MPIBroadcast_double(double *, int, int, void *)
double(* ComputeCFL)(void *, void *, double, double)
Structure containing all solver-specific variables and functions.
#define _MAX_STRING_SIZE_
int ShallowWater1DModifiedSolution(double *, double *, int, void *, void *, double)
Contains structure definition for hypar.
int ShallowWater1DSourceUpwindRoe(double *, double *, double *, double *, int, void *, double)
int ShallowWater1DRightEigenvectors(double *, double *, void *, int)
int ShallowWater1DFlux(double *, double *, int, void *, double)
int(* JFunction)(double *, double *, void *, int, int, int)
char upw_choice[_MAX_STRING_SIZE_]
double ShallowWater1DComputeCFL(void *, void *, double, double)
Structure of MPI-related variables.
int npoints_local_wghosts
int ShallowWater1DUpwindRoe(double *, double *, double *, double *, double *, double *, int, void *, double)
int ShallowWater1DLeftEigenvectors(double *, double *, void *, int)
Contains macros and function definitions for common array operations.
int(* GetRightEigenvectors)(double *, double *, void *, int)
int(* GetLeftEigenvectors)(double *, double *, void *, int)
int(* UFunction)(double *, double *, int, void *, void *, double)
int ShallowWater1DSourceUpwindLLF(double *, double *, double *, double *, int, void *, double)
int ShallowWater1DWriteTopography(void *, void *, double)