Lines Matching refs:x_ptr
209 const PetscScalar *x_ptr; in FormFunctionGradient() local
221 PetscCall(VecGetArrayRead(user_ptr->U, &x_ptr)); in FormFunctionGradient()
223 …*f = (x_ptr[0] - user_ptr->ob[0]) * (x_ptr[0] - user_ptr->ob[0]) + (x_ptr[1] - user_ptr->ob[… in FormFunctionGradient()
224 y_ptr[0] = 2. * (x_ptr[0] - user_ptr->ob[0]); in FormFunctionGradient()
225 y_ptr[1] = 2. * (x_ptr[1] - user_ptr->ob[1]); in FormFunctionGradient()
227 PetscCall(VecRestoreArrayRead(user_ptr->U, &x_ptr)); in FormFunctionGradient()
239 PetscScalar *x_ptr; in FormHessian() local
245 PetscCall(VecGetArray(user_ptr->Dir, &x_ptr)); in FormHessian()
246 x_ptr[0] = 1.; in FormHessian()
247 x_ptr[1] = 0.; in FormHessian()
248 PetscCall(VecRestoreArray(user_ptr->Dir, &x_ptr)); in FormHessian()
254 PetscCall(VecGetArray(user_ptr->Dir, &x_ptr)); in FormHessian()
255 x_ptr[0] = 0.; in FormHessian()
256 x_ptr[1] = 1.; in FormHessian()
257 PetscCall(VecRestoreArray(user_ptr->Dir, &x_ptr)); in FormHessian()
288 PetscScalar *x_ptr, *y_ptr; in Adjoint2() local
303 PetscCall(VecGetArray(U, &x_ptr)); in Adjoint2()
305 y_ptr[0] = 2. * (x_ptr[0] - ctx->ob[0]); in Adjoint2()
306 y_ptr[1] = 2. * (x_ptr[1] - ctx->ob[1]); in Adjoint2()
308 PetscCall(VecRestoreArray(U, &x_ptr)); in Adjoint2()
310 PetscCall(MatDenseGetColumn(tlmsen, 0, &x_ptr)); in Adjoint2()
312 y_ptr[0] = 2. * x_ptr[0]; in Adjoint2()
313 y_ptr[1] = 2. * x_ptr[1]; in Adjoint2()
315 PetscCall(MatDenseRestoreColumn(tlmsen, &x_ptr)); in Adjoint2()
325 PetscCall(VecGetArray(ctx->Lambda2[0], &x_ptr)); in Adjoint2()
326 arr[0] = x_ptr[0]; in Adjoint2()
327 arr[1] = x_ptr[1]; in Adjoint2()
328 PetscCall(VecRestoreArray(ctx->Lambda2[0], &x_ptr)); in Adjoint2()
401 PetscScalar *x_ptr, arr[4]; in main() local
457 PetscCall(VecGetArray(user.U, &x_ptr)); in main()
458 x_ptr[0] = 2.0; in main()
459 x_ptr[1] = -2.0 / 3.0 + 10.0 / (81.0 * user.mu) - 292.0 / (2187.0 * user.mu * user.mu); in main()
460 PetscCall(VecRestoreArray(user.U, &x_ptr)); in main()
467 PetscCall(VecGetArray(user.U, &x_ptr)); in main()
468 user.ob[0] = x_ptr[0]; in main()
469 user.ob[1] = x_ptr[1]; in main()
470 PetscCall(VecRestoreArray(user.U, &x_ptr)); in main()
473 PetscCall(VecGetArray(x, &x_ptr)); in main()
474 x_ptr[0] = ic1; in main()
475 x_ptr[1] = ic2; in main()
476 PetscCall(VecRestoreArray(x, &x_ptr)); in main()
490 PetscCall(VecGetArray(user.Dir, &x_ptr)); in main()
491 x_ptr[0] = 1.; in main()
492 x_ptr[1] = 0.; in main()
493 PetscCall(VecRestoreArray(user.Dir, &x_ptr)); in main()
498 PetscCall(VecGetArray(user.Dir, &x_ptr)); in main()
499 x_ptr[0] = 0.; in main()
500 x_ptr[1] = 1.; in main()
501 PetscCall(VecRestoreArray(user.Dir, &x_ptr)); in main()