HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ShallowWater1DJacobian.c
Go to the documentation of this file.
1 
6 #include <mathfunctions.h>
7 #include <matmult_native.h>
9 
15  double *Jac,
16  double *u,
17  void *p,
18  int dir,
19  int nvars,
20  int upw
23  )
24 {
25  ShallowWater1D *param = (ShallowWater1D*) p;
28 
29  /* get the eigenvalues and left,right eigenvectors */
30  _ShallowWater1DEigenvalues_ (u,D,param,0);
33 
34  int aupw = absolute(upw), k;
35  k = 0; D[k] = absolute( (1-aupw)*D[k] + 0.5*aupw*(1+upw)*max(0,D[k]) + 0.5*aupw*(1-upw)*min(0,D[k]) );
36  k = 3; D[k] = absolute( (1-aupw)*D[k] + 0.5*aupw*(1+upw)*max(0,D[k]) + 0.5*aupw*(1-upw)*min(0,D[k]) );
37 
38  MatMult2(2,DL,D,L);
39  MatMult2(2,Jac,R,DL);
40 
41  return(0);
42 }
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.
#define _MODEL_NVARS_
Definition: euler1d.h:58
#define MatMult2(N, A, X, Y)
#define _ShallowWater1DLeftEigenvectors_(u, L, p, dir)
Contains function definitions for common mathematical functions.
#define _ShallowWater1DEigenvalues_(u, D, p, dir)
#define _ShallowWater1DRightEigenvectors_(u, R, p, dir)
int ShallowWater1DJacobian(double *, double *, void *, int, int, int)
1D Shallow Water Equations
#define absolute(a)
Definition: math_ops.h:32
#define max(a, b)
Definition: math_ops.h:18
#define min(a, b)
Definition: math_ops.h:14
Contains macros and function definitions for common matrix multiplication.