DOUBLEPRECISION=1 # Mode of double precision: not defined: single; 1: full double precision 2: mixed, 3: mixed, fewer single precisions; unless short of memory, use 1.
INPUT_IN_DOUBLEPRECISION # initial conditions are in double precision
OUTPUT_IN_DOUBLEPRECISION # snapshot files will be written in double precision
RiemannProblem: Samples the solution of a Riemann problem at a given time at positions xx
\param[in] xx, array, shape (n,), 1d coordinate of grid
\param[in] x0, float initial coordinate of discontinuety
\param[in] W_L, array, shape(3,), density, velocity and pressure of left state
\param[in] W_R, array, shape(3,), density, velocity and pressure of right state
\param[in] gamma, float, adiabatic index of gas
\param[in] time, time since initial conditions
\return xx, W, x_shock; xx: as input; W: array, shape(n,3) densiy, velocity and pressure at pos xx
x_shock: postition of charactaeristic features
"""
## some auxiliary quantitites
a_L=np.sqrt(gamma*W_L[2]/W_L[0])## sound speeds
a_R=np.sqrt(gamma*W_R[2]/W_R[0])
gm1=gamma-1.0## gamma +- 1
gp1=gamma+1.0
gamma_ratio=gm1/gp1
PosOfCharacteristics=np.zeros(5)## 0: left most to 4: right most; 2 is rarefaction; if 0 and 1 (3 and 4) have the same value, there is a shock, otherwise rarefaction wave
## calculate central pressure; initial guess: arithmetic mean
print("CheckWidthOfDiscontinuities: density jump at contact discontinuity resolved by %d cells (5th to 95th precentile), tolerance: %d" \
%(i_high[0]-i_low[0],MaxNumerOfCells))
else:
print("CheckWidthOfDiscontinuities: density, velocity and pressure jump at shock resolved by %d, %d and %d cells (5th to 95th precentile), tolerance: %d" \