Lines Matching refs:dx
38 static inline PetscScalar dqdx(PipeField *x, PetscInt i, PetscInt ilast, PetscReal dx) in dqdx() argument
41 return (x[i + 1].q - x[i].q) / dx; in dqdx()
43 return (x[i].q - x[i - 1].q) / dx; in dqdx()
45 return (x[i + 1].q - x[i - 1].q) / (2 * dx); in dqdx()
49 static inline PetscScalar dhdx(PipeField *x, PetscInt i, PetscInt ilast, PetscReal dx) in dhdx() argument
52 return (x[i + 1].h - x[i].h) / dx; in dhdx()
54 return (x[i].h - x[i - 1].h) / dx; in dhdx()
56 return (x[i + 1].h - x[i - 1].h) / (2 * dx); in dhdx()
64 PetscReal dx = pipe->length / (info->mx - 1), dt = pipe->dt; in PipeIFunctionLocal_Lax() local
82 …f[2 * (i - 1) + 2] = (x[i].q - xold_i) + dt * (GRAV * pipe->A * dhdx(xold, i, ilast, dx) + pipe->R… in PipeIFunctionLocal_Lax()
86 f[2 * (i - 1) + 3] = (x[i].h - xold_i) + dt * c * dqdx(xold, i, ilast, dx); in PipeIFunctionLocal_Lax()