Lines Matching refs:ctx

47   AppCtx      ctx;  in main()  local
63 PetscCall(TSSetRHSFunction(ts, tsrhs, TSFunctionRHS, &ctx)); in main()
64 PetscCall(TSSetIFunction(ts, NULL, TSFunctionI, &ctx)); in main()
65 ctx.f = f; in main()
66 ctx.F = F; in main()
68 PetscCall(VecCreateMPI(PETSC_COMM_WORLD, 1, PETSC_DETERMINE, &ctx.U)); in main()
69 PetscCall(VecCreateMPI(PETSC_COMM_WORLD, 1, PETSC_DETERMINE, &ctx.V)); in main()
70 PetscCall(VecCreateMPI(PETSC_COMM_WORLD, 1, PETSC_DETERMINE, &ctx.UF)); in main()
71 PetscCall(VecCreateMPI(PETSC_COMM_WORLD, 1, PETSC_DETERMINE, &ctx.VF)); in main()
74 PetscCall(VecScatterCreate(ctx.U, NULL, UV, is, &ctx.scatterU)); in main()
78 PetscCall(VecScatterCreate(ctx.V, NULL, UV, is, &ctx.scatterV)); in main()
85 PetscCall(VecDestroy(&ctx.U)); in main()
86 PetscCall(VecDestroy(&ctx.V)); in main()
87 PetscCall(VecDestroy(&ctx.UF)); in main()
88 PetscCall(VecDestroy(&ctx.VF)); in main()
89 PetscCall(VecScatterDestroy(&ctx.scatterU)); in main()
90 PetscCall(VecScatterDestroy(&ctx.scatterV)); in main()
102 AppCtx *ctx = (AppCtx *)actx; in TSFunctionRHS() local
106 PetscCall(VecScatterBegin(ctx->scatterU, UV, ctx->U, INSERT_VALUES, SCATTER_REVERSE)); in TSFunctionRHS()
107 PetscCall(VecScatterEnd(ctx->scatterU, UV, ctx->U, INSERT_VALUES, SCATTER_REVERSE)); in TSFunctionRHS()
108 PetscCall(VecScatterBegin(ctx->scatterV, UV, ctx->V, INSERT_VALUES, SCATTER_REVERSE)); in TSFunctionRHS()
109 PetscCall(VecScatterEnd(ctx->scatterV, UV, ctx->V, INSERT_VALUES, SCATTER_REVERSE)); in TSFunctionRHS()
110 PetscCall((*ctx->f)(t, ctx->U, ctx->V, ctx->UF)); in TSFunctionRHS()
111 PetscCall(VecScatterBegin(ctx->scatterU, ctx->UF, F, INSERT_VALUES, SCATTER_FORWARD)); in TSFunctionRHS()
112 PetscCall(VecScatterEnd(ctx->scatterU, ctx->UF, F, INSERT_VALUES, SCATTER_FORWARD)); in TSFunctionRHS()
122 AppCtx *ctx = (AppCtx *)actx; in TSFunctionI() local
126 PetscCall(VecScatterBegin(ctx->scatterU, UV, ctx->U, INSERT_VALUES, SCATTER_REVERSE)); in TSFunctionI()
127 PetscCall(VecScatterEnd(ctx->scatterU, UV, ctx->U, INSERT_VALUES, SCATTER_REVERSE)); in TSFunctionI()
128 PetscCall(VecScatterBegin(ctx->scatterV, UV, ctx->V, INSERT_VALUES, SCATTER_REVERSE)); in TSFunctionI()
129 PetscCall(VecScatterEnd(ctx->scatterV, UV, ctx->V, INSERT_VALUES, SCATTER_REVERSE)); in TSFunctionI()
130 PetscCall((*ctx->F)(t, ctx->U, ctx->V, ctx->VF)); in TSFunctionI()
131 PetscCall(VecScatterBegin(ctx->scatterV, ctx->VF, F, INSERT_VALUES, SCATTER_FORWARD)); in TSFunctionI()
132 PetscCall(VecScatterEnd(ctx->scatterV, ctx->VF, F, INSERT_VALUES, SCATTER_FORWARD)); in TSFunctionI()