Lines Matching refs:Ctx
192 AppCtx *Ctx = (AppCtx *)ctx; in EventFunction() local
197 if (Ctx->rank == 0) { in EventFunction()
198 …if (Ctx->F == 0 || Ctx->F == -1) gval[n++] = PetscSinReal(Ctx->pi * t) / Ctx->pi; // FUNC-0, roots… in EventFunction()
199 …if (Ctx->F == 1 || Ctx->F == -1) gval[n++] = PetscLogReal(t); // FUNC-2, root 1 in EventFunction()
200 …if (Ctx->F == 2 || Ctx->F == -1) { // FUNC-3, root 1 in EventFunction()
204 …if (Ctx->F == 3 || Ctx->F == -1) gval[n++] = t - PetscExpReal(PetscSinReal(t)) + 1; … in EventFunction()
205 …if (Ctx->F == 4 || Ctx->F == -1) gval[n++] = (1e10 * PetscPowReal(t, 1 / t) - 1) / 100; … in EventFunction()
206 …if (Ctx->F == 5 || Ctx->F == -1) gval[n++] = PetscLogReal(t - 0.02) * PetscLogReal(t - 0.02) * Pet… in EventFunction()
207 …if (Ctx->F == 6 || Ctx->F == -1) gval[n++] = 4 * PetscCosReal(t) - PetscExpReal(t); … in EventFunction()
208 …if (Ctx->F == 7 || Ctx->F == -1) gval[n++] = (20.0 * t - 1) / (19.0 * t) / 10; … in EventFunction()
209 …if (Ctx->F == 8 || Ctx->F == -1) gval[n++] = ((t - 1) * PetscExpReal(-20 * t) + PetscPowReal(t, 20… in EventFunction()
210 …if (Ctx->F == 9 || Ctx->F == -1) gval[n++] = (t * t * (t * t / 3.0 + PetscSqrtReal(2.0) * PetscSin… in EventFunction()
211 …if (Ctx->F == 10 || Ctx->F == -1) gval[n++] = ((t * t + 1) * PetscSinReal(t) - PetscExpReal(PetscS… in EventFunction()
212 …if (Ctx->F == 11 || Ctx->F == -1) gval[n++] = 2 * t - 5; … in EventFunction()
222 AppCtx *Ctx = (AppCtx *)ctx; in Postevent() local
225 if (Ctx->flg) { in Postevent()
226 PetscCallBack("EventFunction", EventFunction(ts, t, U, Ctx->fvals, ctx)); in Postevent()
227 …LD, "[%d] At t = %20.16g : %" PetscInt_FMT " events triggered, fvalues =", Ctx->rank, (double)t, n… in Postevent()
228 …; j++) PetscCall(PetscSynchronizedPrintf(PETSC_COMM_WORLD, "\t%g", (double)Ctx->fvals[evs_zero[j]]… in Postevent()
233 if (Ctx->cnt + nev_zero < MAX_NEV) in Postevent()
234 …for (PetscInt i = 0; i < nev_zero; i++) Ctx->evres[Ctx->cnt++] = t; // save the repeating zeros se… in Postevent()
237 Ctx->postcnt++; // sync in Postevent()
238 if (Ctx->dtpost > 0) { in Postevent()
239 if (Ctx->postcnt % 2 == 0) PetscCall(TSSetPostEventStep(ts, Ctx->dtpost)); in Postevent()
244 if (Ctx->restart) PetscCall(TSRestartStep(ts)); in Postevent()