Lines Matching refs:Ctx
181 AppCtx *Ctx = (AppCtx *)ctx; in EventFunction() local
187 if (Ctx->rank == (i + 3) % Ctx->size) { in EventFunction()
194 if (Ctx->rank == (i + 3) % Ctx->size) { in EventFunction()
200 …if (Ctx->rank == 0) gval[n++] = (t - 5) * (t - 5) * PetscSinReal(Ctx->pi * t); // sin-event -- on … in EventFunction()
201 …if (Ctx->rank == Ctx->size - 1) gval[n++] = 0.5 * PetscCosReal(Ctx->pi * t); // cos-event -- on … in EventFunction()
210 AppCtx *Ctx = (AppCtx *)ctx; in Postevent() local
213 if (Ctx->flg) { in Postevent()
214 PetscCallBack("EventFunction", EventFunction(ts, t, U, Ctx->fvals, ctx)); in Postevent()
215 …LD, "[%d] At t = %20.16g : %" PetscInt_FMT " events triggered, fvalues =", Ctx->rank, (double)t, n… in Postevent()
216 …; j++) PetscCall(PetscSynchronizedPrintf(PETSC_COMM_WORLD, "\t%g", (double)Ctx->fvals[evs_zero[j]]… in Postevent()
221 if (Ctx->cnt + nev_zero < MAX_NEV) in Postevent()
222 …for (PetscInt i = 0; i < nev_zero; i++) Ctx->evres[Ctx->cnt++] = t; // save the repeating zeros se… in Postevent()
225 Ctx->postcnt++; // sync in Postevent()
226 if (Ctx->dtpost > 0) { in Postevent()
227 if (Ctx->postcnt % 2 == 0) PetscCall(TSSetPostEventStep(ts, Ctx->dtpost)); in Postevent()
232 …if ((Ctx->dir0 == 0 && PetscAbsReal(t - (PetscReal)4.0) < 0.01) || (Ctx->dir0 == -1 && PetscAbsRea… in Postevent()
233 …SetVtols(Ctx->rank, Ctx->size, 1e-8, 1e-26, Ctx->vtol); // for better resolution of sin-event at t… in Postevent()
234 PetscCall(TSSetEventTolerances(ts, PETSC_DECIDE, Ctx->vtol)); in Postevent()
237 SetVtols(Ctx->rank, Ctx->size, 1e-8, 1e-8, Ctx->vtol); // back to normal in Postevent()
238 PetscCall(TSSetEventTolerances(ts, PETSC_DECIDE, Ctx->vtol)); in Postevent()
241 if (Ctx->restart) PetscCall(TSRestartStep(ts)); in Postevent()