separate function to compute flux vectors and Jacobi matrices