29 #define _SHALLOW_WATER_1D_ "shallow-water-1d" 35 #define _MODEL_NDIMS_ 1 37 #define _MODEL_NVARS_ 2 43 #define _LLF_ "llf-char" 54 #define _ShallowWater1DGetFlowVar_(u,h,v) \ 64 #define _ShallowWater1DSetFlux_(f,h,v,g) \ 67 f[1] = (h) * (v) * (v) + 0.5 * (g) * (h) * (h); \ 74 #define _ShallowWater1DRoeAverage_(uavg,uL,uR,p) \ 79 _ShallowWater1DGetFlowVar_(uL,hL,vL); \ 80 _ShallowWater1DGetFlowVar_(uR,hR,vR); \ 81 h = 0.5 * (hL + hR); \ 82 v = (sqrt(hL)*vL + sqrt(hR)*vR) / (sqrt(hL) + sqrt(hR)); \ 93 #define _ShallowWater1DEigenvalues_(u,D,p,dir) \ 96 _ShallowWater1DGetFlowVar_(u,h,v); \ 98 D[0*_MODEL_NVARS_+0] = (v+c); D[0*_MODEL_NVARS_+1] = 0; \ 99 D[1*_MODEL_NVARS_+0] = 0; D[1*_MODEL_NVARS_+1] = (v-c); \ 106 #define _ShallowWater1DLeftEigenvectors_(u,L,p,dir) \ 108 double R[_MODEL_NVARS_*_MODEL_NVARS_]; \ 109 _ShallowWater1DRightEigenvectors_(u,R,p,dir); \ 110 _MatrixInvert_(R,L,_MODEL_NVARS_); \ 117 #define _ShallowWater1DRightEigenvectors_(u,R,p,dir) \ 120 _ShallowWater1DGetFlowVar_(u,h,v); \ 122 R[0*_MODEL_NVARS_+0] = 1.0; \ 123 R[1*_MODEL_NVARS_+0] = v+c; \ 124 R[0*_MODEL_NVARS_+1] = 1.0; \ 125 R[1*_MODEL_NVARS_+1] = v-c; \ 137 typedef struct shallowwater1d_parameters {
150 int (*SourceUpwind)(
double*,
double*,
double*,
double*,int,
void*,double);
Contains macros and function definitions for common matrix operations.
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.
Some basic definitions and macros.
int ShallowWater1DCleanup(void *)
int ShallowWater1DInitialize(void *, void *)
#define _MAX_STRING_SIZE_