Lines Matching refs:X0

13 …Vec          X0, X, Xdot; /* Storage for u^n, u^n + dt a_{11} k_1, and time derivative u^{n+1}_t */  member
45 static PetscErrorCode TSThetaGetX0AndXdot(TS ts, DM dm, Vec *X0, Vec *Xdot) in TSThetaGetX0AndXdot() argument
50 if (X0) { in TSThetaGetX0AndXdot()
51 if (dm && dm != ts->dm) PetscCall(DMGetNamedGlobalVector(dm, "TSTheta_X0", X0)); in TSThetaGetX0AndXdot()
52 else *X0 = ts->vec_sol; in TSThetaGetX0AndXdot()
61 static PetscErrorCode TSThetaRestoreX0AndXdot(TS ts, DM dm, Vec *X0, Vec *Xdot) in TSThetaRestoreX0AndXdot() argument
64 if (X0) { in TSThetaRestoreX0AndXdot()
65 if (dm && dm != ts->dm) PetscCall(DMRestoreNamedGlobalVector(dm, "TSTheta_X0", X0)); in TSThetaRestoreX0AndXdot()
82 Vec X0, Xdot, X0_c, Xdot_c; in DMRestrictHook_TSTheta() local
85 PetscCall(TSThetaGetX0AndXdot(ts, fine, &X0, &Xdot)); in DMRestrictHook_TSTheta()
87 PetscCall(MatRestrict(restrct, X0, X0_c)); in DMRestrictHook_TSTheta()
91 PetscCall(TSThetaRestoreX0AndXdot(ts, fine, &X0, &Xdot)); in DMRestrictHook_TSTheta()
105 Vec X0, Xdot, X0_sub, Xdot_sub; in DMSubDomainRestrictHook_TSTheta() local
108 PetscCall(TSThetaGetX0AndXdot(ts, dm, &X0, &Xdot)); in DMSubDomainRestrictHook_TSTheta()
111 PetscCall(VecScatterBegin(gscat, X0, X0_sub, INSERT_VALUES, SCATTER_FORWARD)); in DMSubDomainRestrictHook_TSTheta()
112 PetscCall(VecScatterEnd(gscat, X0, X0_sub, INSERT_VALUES, SCATTER_FORWARD)); in DMSubDomainRestrictHook_TSTheta()
117 PetscCall(TSThetaRestoreX0AndXdot(ts, dm, &X0, &Xdot)); in DMSubDomainRestrictHook_TSTheta()
131 PetscCall(TSComputeRHSFunction(quadts, th->ptime0, th->X0, ts->vec_costintegrand)); in TSThetaEvaluateCostIntegral()
187 PetscCall(TSResizeRegisterVec(ts, "ts:theta:X0", th->X0)); in TSResizeRegister_Theta()
191 PetscCall(TSResizeRetrieveVec(ts, "ts:theta:X0", &th->X0)); in TSResizeRegister_Theta()
192 PetscCall(PetscObjectReference((PetscObject)th->X0)); in TSResizeRegister_Theta()
206 if (th->vec_sol_prev) PetscCall(VecCopy(th->X0, th->vec_sol_prev)); in TSStep_Theta()
207 PetscCall(VecCopy(ts->vec_sol, th->X0)); in TSStep_Theta()
214 PetscCall(VecCopy(th->X0, th->X)); in TSStep_Theta()
219 PetscCall(TSComputeIFunction(ts, ts->ptime, th->X0, th->Xdot, th->affine, PETSC_FALSE)); in TSStep_Theta()
231 …PetscCall(VecAXPBYPCZ(th->Xdot, -th->shift, th->shift, 0, th->X0, th->X)); /* th->Xdot is needed b… in TSStep_Theta()
237 PetscCall(VecCopy(th->X0, ts->vec_sol)); in TSStep_Theta()
247 PetscCall(VecCopy(th->X0, ts->vec_sol)); in TSStep_Theta()
379 …PetscCall(VecAXPBYPCZ(th->Xdot, -1. / adjoint_time_step, 1.0 / adjoint_time_step, 0, th->X0, ts->v… in TSAdjointStepBEuler_Private()
448 …PetscCall(VecAXPBYPCZ(th->X0, 1.0 / (1.0 - th->Theta), th->Theta / (th->Theta - 1.0), 0, th->X, ts… in TSAdjointStep_Theta()
527 PetscCall(TSComputeSNESJacobian(ts, th->X0, J, Jpre)); in TSAdjointStep_Theta()
530 if (quadts) PetscCall(TSComputeRHSJacobian(quadts, adjoint_ptime, th->X0, quadJ, NULL)); in TSAdjointStep_Theta()
549 …PetscCall(TSComputeIHessianProductFunctionUU(ts, adjoint_ptime, th->X0, VecsDeltaLam, ts->vec_sens… in TSAdjointStep_Theta()
553 …PetscCall(TSComputeIHessianProductFunctionUP(ts, adjoint_ptime, th->X0, VecsDeltaLam, ts->vec_dir,… in TSAdjointStep_Theta()
568 PetscCall(VecAXPBYPCZ(th->Xdot, -th->shift, th->shift, 0, th->X0, ts->vec_sol)); in TSAdjointStep_Theta()
604 …PetscCall(TSComputeIJacobianP(ts, adjoint_ptime, th->X0, th->Xdot, 1. / ((th->Theta - 1.0) * adjoi… in TSAdjointStep_Theta()
605 if (quadts) PetscCall(TSComputeRHSJacobianP(quadts, adjoint_ptime, th->X0, quadJp)); in TSAdjointStep_Theta()
621 …PetscCall(TSComputeIHessianProductFunctionPU(ts, adjoint_ptime, th->X0, VecsDeltaLam, ts->vec_sens… in TSAdjointStep_Theta()
625 …PetscCall(TSComputeIHessianProductFunctionPP(ts, adjoint_ptime, th->X0, VecsDeltaLam, ts->vec_dir,… in TSAdjointStep_Theta()
654 PetscCall(VecAXPBYPCZ(th->Xdot, -th->shift, th->shift, 0, th->X0, th->X)); in TSAdjointStep_Theta()
715 vecs[1] = th->X0; in TSEvaluateWLTE_Theta()
765 … PetscCall(TSComputeIJacobian(ts, th->ptime0, th->X0, th->Xdot, th->shift, J, Jpre, PETSC_FALSE)); in TSForwardStep_Theta()
772 …PetscCall(TSComputeIJacobianP(ts, th->ptime0, th->X0, th->Xdot, th->shift, ts->Jacp, PETSC_FALSE)); in TSForwardStep_Theta()
775 PetscCall(VecAXPBYPCZ(th->Xdot, -th->shift, th->shift, 0, th->X0, ts->vec_sol)); in TSForwardStep_Theta()
788 PetscCall(VecAXPBYPCZ(th->Xdot, -th->shift, th->shift, 0, th->X0, th->X)); in TSForwardStep_Theta()
810 PetscCall(TSComputeRHSJacobian(quadts, th->ptime0, th->X0, quadJ, NULL)); in TSForwardStep_Theta()
811 PetscCall(TSComputeRHSJacobianP(quadts, th->ptime0, th->X0, quadJp)); in TSForwardStep_Theta()
895 PetscCall(VecDestroy(&th->X0)); in TSReset_Theta()
946 Vec X0, Xdot; in SNESTSFormFunction_Theta() local
953 PetscCall(TSThetaGetX0AndXdot(ts, dm, &X0, &Xdot)); in SNESTSFormFunction_Theta()
954 if (x != X0) { in SNESTSFormFunction_Theta()
955 PetscCall(VecAXPBYPCZ(Xdot, -shift, shift, 0, X0, x)); in SNESTSFormFunction_Theta()
964 PetscCall(TSThetaRestoreX0AndXdot(ts, dm, &X0, &Xdot)); in SNESTSFormFunction_Theta()
1036 if (!th->X0) PetscCall(VecDuplicate(ts->vec_sol, &th->X0)); in TSSetUp_Theta()
1177 th->Stages[0] = th->X0; in TSGetStages_Theta()