Lines Matching refs:app
39 AppCtx *app = (AppCtx *)ctx; in PostEvent() local
54 v[0] = -app->Cr * v[0]; in PostEvent()
57 app->bounces++; in PostEvent()
59 if (app->bounces >= app->maxbounces) { // 'app->bounces' may be different on different processes in PostEvent()
60 …tf(PETSC_COMM_SELF, "Processor [%d]: Ball bounced %" PetscInt_FMT " times\n", rank, app->bounces)); in PostEvent()
70 AppCtx *app = (AppCtx *)ctx; in I2Function() local
78 Res = a[0] + 9.8 + 0.5 * app->Cd * v[0] * v[0] * PetscSignReal(PetscRealPart(v[0])); in I2Function()
91 AppCtx *app = (AppCtx *)ctx; in I2Jacobian() local
100 Jac = shiftA + shiftV * app->Cd * v[0]; in I2Jacobian()
124 AppCtx app; in main() local
133 app.Cd = 0.0; in main()
134 app.Cr = 0.9; in main()
135 app.bounces = 0; in main()
136 app.maxbounces = 10; in main()
138 PetscCall(PetscOptionsReal("-Cd", "Drag coefficient", "", app.Cd, &app.Cd, NULL)); in main()
139 PetscCall(PetscOptionsReal("-Cr", "Restitution coefficient", "", app.Cr, &app.Cr, NULL)); in main()
140 …PetscCall(PetscOptionsInt("-maxbounces", "Maximum number of bounces", "", app.maxbounces, &app.max… in main()
156 …PetscCall(TSSetEventHandler(ts, 1, direction, terminate, Event, PostEvent, &app)); // each process… in main()
162 PetscCall(TSSetI2Function(ts, F, I2Function, &app)); in main()
163 PetscCall(TSSetI2Jacobian(ts, J, J, I2Jacobian, &app)); in main()