Lines Matching refs:appctx
50 AppCtx appctx; /* user-defined application context */ in main() local
63 appctx.a = 1.0; in main()
64 appctx.d = 0.0; in main()
65 PetscCall(PetscOptionsGetScalar(NULL, NULL, "-a", &appctx.a, NULL)); in main()
66 PetscCall(PetscOptionsGetScalar(NULL, NULL, "-d", &appctx.d, NULL)); in main()
67 appctx.upwind = PETSC_TRUE; in main()
68 PetscCall(PetscOptionsGetBool(NULL, NULL, "-upwind", &appctx.upwind, NULL)); in main()
94 PetscCall(TSSetRHSFunction(ts, NULL, TSComputeRHSFunctionLinear, &appctx)); in main()
95 PetscCall(TSSetRHSJacobian(ts, NULL, NULL, RHSMatrixHeat, &appctx)); in main()
96 …Call(TSSetSolutionFunction(ts, (PetscErrorCode (*)(TS, PetscReal, Vec, void *))Solution, &appctx)); in main()
119 PetscCall(InitialConditions(ts, U, &appctx)); in main()
155 PetscErrorCode InitialConditions(TS ts, Vec U, AppCtx *appctx) in InitialConditions() argument
203 PetscErrorCode Solution(TS ts, PetscReal t, Vec U, AppCtx *appctx) in Solution() argument
224 ex1 = PetscExpScalar(-36. * PETSC_PI * PETSC_PI * appctx->d * t); in Solution()
225 ex2 = PetscExpScalar(-4. * PETSC_PI * PETSC_PI * appctx->d * t); in Solution()
228 …scSinScalar(sc1 * (PetscReal)i + appctx->a * PETSC_PI * 6. * t) * ex1 + 3. * PetscSinScalar(sc2 * … in Solution()
259 AppCtx *appctx = (AppCtx *)ctx; /* user-defined application context */ in RHSMatrixHeat() local
279 v[0] = appctx->d / (h * h); in RHSMatrixHeat()
280 v[1] = -2.0 * appctx->d / (h * h); in RHSMatrixHeat()
281 v[2] = appctx->d / (h * h); in RHSMatrixHeat()
313 if (!appctx->upwind) { in RHSMatrixHeat()
315 v[0] = -.5 * appctx->a / (h); in RHSMatrixHeat()
316 v[1] = .5 * appctx->a / (h); in RHSMatrixHeat()
338 v[0] = -appctx->a / (h); in RHSMatrixHeat()
339 v[1] = appctx->a / (h); in RHSMatrixHeat()