| /petsc/src/ts/tests/ |
| H A D | ex18.c | 57 const PetscScalar *xdot, *x; in IFunction() local 62 PetscCall(VecGetArrayRead(Xdot, &xdot)); in IFunction() 66 f[0] = x[0] * xdot[0] - x[0] * x[1]; in IFunction() 69 f[0] = xdot[0] - x[0]; in IFunction() 70 f[1] = xdot[1] - x[1]; in IFunction() 72 PetscCall(VecRestoreArrayRead(Xdot, &xdot)); in IFunction() 80 const PetscScalar *xdot, *x; in IJacobian() local 84 PetscCall(VecGetArrayRead(Xdot, &xdot)); in IJacobian() 87 PetscCall(MatSetValue(B, 0, 0, shift * x[0] + xdot[0] - x[1], INSERT_VALUES)); in IJacobian() 96 PetscCall(VecRestoreArrayRead(Xdot, &xdot)); in IJacobian()
|
| H A D | ex25.c | 163 Field *x, *xdot, *f; in FormIFunction() local 184 PetscCall(DMDAVecGetArrayRead(da, Xdot, &xdot)); in FormIFunction() 196 f[i].u = hx * xdot[i].u - user->alpha * (x[i - 1].u - 2. * x[i].u + x[i + 1].u) / hx; in FormIFunction() 197 f[i].v = hx * xdot[i].v - user->alpha * (x[i - 1].v - 2. * x[i].v + x[i + 1].v) / hx; in FormIFunction() 203 PetscCall(DMDAVecRestoreArrayRead(da, Xdot, &xdot)); in FormIFunction() 251 Field *x, *xdot; in FormIJacobian() local 260 PetscCall(DMDAVecGetArrayRead(da, Xdot, &xdot)); in FormIJacobian() 284 PetscCall(DMDAVecRestoreArrayRead(da, Xdot, &xdot)); in FormIJacobian()
|
| H A D | ex26.c | 72 PetscErrorCode IFunction(TS ts, PetscReal t, Vec x, Vec xdot, Vec f, PetscCtx ctx) in IFunction() argument 75 PetscCall(VecCopy(xdot, f)); in IFunction() 80 PetscErrorCode IJacobian(TS ts, PetscReal t, Vec x, Vec xdot, PetscReal shift, Mat A, Mat B, PetscC… in IJacobian() argument
|
| /petsc/src/ts/tutorials/ |
| H A D | ex8.c | 34 const PetscScalar *x, *xdot; in RoberFunction() local 38 PetscCall(VecGetArrayRead(Xdot, &xdot)); in RoberFunction() 40 f[0] = xdot[0] + 0.04 * x[0] - 1e4 * x[1] * x[2]; in RoberFunction() 41 f[1] = xdot[1] - 0.04 * x[0] + 1e4 * x[1] * x[2] + 3e7 * PetscSqr(x[1]); in RoberFunction() 42 f[2] = xdot[2] - 3e7 * PetscSqr(x[1]); in RoberFunction() 44 PetscCall(VecRestoreArrayRead(Xdot, &xdot)); in RoberFunction() 53 const PetscScalar *x, *xdot; in RoberJacobian() local 57 PetscCall(VecGetArrayRead(Xdot, &xdot)); in RoberJacobian() 69 PetscCall(VecRestoreArrayRead(Xdot, &xdot)); in RoberJacobian() 125 const PetscScalar *x, *xdot; in CEFunction() local [all …]
|
| H A D | ex49.c | 31 const PetscScalar *x, *xdot; in IFunction() local 36 PetscCall(VecGetArrayRead(Xdot, &xdot)); in IFunction() 38 f[0] = xdot[0] - x[1]; in IFunction() 39 f[1] = xdot[1] - user->mu * ((1.0 - x[0] * x[0]) * x[1] - x[0]); in IFunction() 41 PetscCall(VecRestoreArrayRead(Xdot, &xdot)); in IFunction()
|
| H A D | ex23fwdadj.c | 32 const PetscScalar *x, *xdot; in IFunction() local 37 PetscCall(VecGetArrayRead(Xdot, &xdot)); in IFunction() 39 f[0] = user->c * xdot[0] - user->b * x[0]; in IFunction() 41 PetscCall(VecRestoreArrayRead(Xdot, &xdot)); in IFunction() 73 const PetscScalar *x, *xdot; in IJacobianP() local 78 PetscCall(VecGetArrayRead(Xdot, &xdot)); in IJacobianP() 80 if (user->der == 1) J[0][0] = xdot[0]; in IJacobianP()
|
| H A D | ex22.c | 149 const Field *x, *xdot; in FormIFunction() local 157 PetscCall(DMDAVecGetArrayRead(da, Xdot, (void *)&xdot)); in FormIFunction() 162 f[i][0] = xdot[i][0] + user->k[0] * x[i][0] - user->k[1] * x[i][1] - user->s[0]; in FormIFunction() 163 f[i][1] = xdot[i][1] - user->k[0] * x[i][0] + user->k[1] * x[i][1] - user->s[1]; in FormIFunction() 168 PetscCall(DMDAVecRestoreArrayRead(da, Xdot, (void *)&xdot)); in FormIFunction() 235 const Field *x, *xdot; in FormIJacobian() local 243 PetscCall(DMDAVecGetArrayRead(da, Xdot, (void *)&xdot)); in FormIJacobian() 259 PetscCall(DMDAVecRestoreArrayRead(da, Xdot, (void *)&xdot)); in FormIJacobian()
|
| H A D | ex20fwd.c | 38 const PetscScalar *x, *xdot; in IFunction() local 43 PetscCall(VecGetArrayRead(Xdot, &xdot)); in IFunction() 45 f[0] = xdot[0] - x[1]; in IFunction() 46 f[1] = c21 * (xdot[0] - x[1]) + xdot[1] - user->mu * ((1.0 - x[0] * x[0]) * x[1] - x[0]); in IFunction() 48 PetscCall(VecRestoreArrayRead(Xdot, &xdot)); in IFunction()
|
| H A D | ex25.c | 141 Field *x, *xdot, *f; in FormIFunction() local 162 PetscCall(DMDAVecGetArrayRead(da, Xdot, &xdot)); in FormIFunction() 174 f[i].u = hx * xdot[i].u - user->alpha * (x[i - 1].u - 2. * x[i].u + x[i + 1].u) / hx; in FormIFunction() 175 f[i].v = hx * xdot[i].v - user->alpha * (x[i - 1].v - 2. * x[i].v + x[i + 1].v) / hx; in FormIFunction() 181 PetscCall(DMDAVecRestoreArrayRead(da, Xdot, &xdot)); in FormIFunction() 229 Field *x, *xdot; in FormIJacobian() local 238 PetscCall(DMDAVecGetArrayRead(da, Xdot, &xdot)); in FormIJacobian() 262 PetscCall(DMDAVecRestoreArrayRead(da, Xdot, &xdot)); in FormIJacobian()
|
| H A D | ex20.c | 50 const PetscScalar *x, *xdot; in IFunction() local 55 PetscCall(VecGetArrayRead(Xdot, &xdot)); in IFunction() 57 f[0] = xdot[0] - x[1]; in IFunction() 58 f[1] = xdot[1] - user->mu * ((1.0 - x[0] * x[0]) * x[1] - x[0]); in IFunction() 60 PetscCall(VecRestoreArrayRead(Xdot, &xdot)); in IFunction()
|
| H A D | ex16.c | 98 const PetscScalar *x, *xdot; in IFunction() local 103 PetscCall(VecGetArrayRead(Xdot, &xdot)); in IFunction() 105 f[0] = xdot[0] + (user->imex ? 0 : x[1]); in IFunction() 106 f[1] = xdot[1] - user->mu * ((1. - x[0] * x[0]) * x[1] - x[0]); in IFunction() 108 PetscCall(VecRestoreArrayRead(Xdot, &xdot)); in IFunction()
|
| H A D | ex19.c | 74 const PetscScalar *x, *xdot; in IFunction() local 78 PetscCall(VecGetArrayRead(Xdot, &xdot)); in IFunction() 80 f[0] = xdot[0] + x[1]; in IFunction() 83 PetscCall(VecRestoreArrayRead(Xdot, &xdot)); in IFunction()
|
| H A D | ex8.py | 14 def function(self, ts,t,x,xdot,f): argument 20 da.globalToLocal(xdot,xxdot) 29 def jacobian(self,ts,t,x,xdot,shift,J,P): argument
|
| H A D | ex10.c | 172 const RDNode *x, *xdot, *f; in RDStateView() local 179 PetscCall(DMDAVecGetArrayRead(rd->da, Xdot, (void *)&xdot)); in RDStateView() 182 …E), (double)PetscRealPart(x[i].T), (double)PetscRealPart(xdot[i].E), (double)PetscRealPart(xdot[i]… in RDStateView() 186 PetscCall(DMDAVecRestoreArrayRead(rd->da, Xdot, (void *)&xdot)); in RDStateView() 241 … *Theta, PetscReal *dt, Vec *X0loc, RDNode **x0, Vec *Xloc, RDNode **x, Vec *Xloc_t, RDNode **xdot) in RDGetLocalArrays() argument 270 PetscCall(DMDAVecGetArray(rd->da, *Xloc_t, xdot)); in RDGetLocalArrays() 274 …storeLocalArrays(RD rd, Vec *X0loc, RDNode **x0, Vec *Xloc, RDNode **x, Vec *Xloc_t, RDNode **xdot) in RDRestoreLocalArrays() argument 279 PetscCall(DMDAVecRestoreArray(rd->da, *Xloc_t, xdot)); in RDRestoreLocalArrays() 314 RDNode *x, *x0, *xdot, *f; in RDIFunction_FD() local 321 PetscCall(RDGetLocalArrays(rd, ts, X, Xdot, &Theta, &dt, &X0loc, &x0, &Xloc, &x, &Xloc_t, &xdot)); in RDIFunction_FD() [all …]
|
| /petsc/src/binding/petsc4py/demo/legacy/ode/ |
| H A D | rober.py | 23 def evalFunction(self, ts, t, x, xdot, f): argument 25 xdot[0] + 0.04 * x[0] - 1e4 * x[1] * x[2], 26 xdot[1] - 0.04 * x[0] + 1e4 * x[1] * x[2] + 3e7 * x[1] ** 2, 27 xdot[2] - 3e7 * x[1] ** 2, 31 def evalJacobian(self, ts, t, x, xdot, a, A, B): argument
|
| H A D | orego.py | 22 def evalFunction(self, ts, t, x, xdot, f): argument 25 xdot[0] - 77.27 * (x[1] + x[0] * (1 - 8.375e-6 * x[0] - x[1])), 26 xdot[1] - 1 / 77.27 * (x[2] - (1 + x[0]) * x[1]), 27 xdot[2] - 0.161 * (x[0] - x[2]), 31 def evalJacobian(self, ts, t, x, xdot, a, A, B): argument
|
| H A D | ce.py | 26 def evalFunction(self, ts, t, x, xdot, f): argument 28 f[0] = xdot[0] + lam * (x[0] - cos(t)) 31 def evalJacobian(self, ts, t, x, xdot, a, A, B): argument
|
| /petsc/src/binding/petsc4py/demo/legacy/perftest/ |
| H A D | App.f90 | 7 real(kind=C_DOUBLE), intent(in) :: x(nx,ny,nz), xdot(nx,ny,nz) local 9 call formfunction_f(nx, ny, nz, h, t, x, xdot, f) 56 real(kind=8), intent(in) :: x(nx,ny,nz), xdot(nx,ny,nz) local 95 xdot(i,j,k) + &
|
| H A D | driver.c | 32 const PetscScalar *xdot; in FormFunction() local 38 PetscCall(VecGetArrayRead(Xdot,&xdot)); in FormFunction() 41 formFunction(&app->nx,&app->ny,&app->nz,app->h,&t,x,xdot,f); in FormFunction() 44 PetscCall(VecRestoreArrayRead(Xdot,&xdot)); in FormFunction()
|
| H A D | App.pyf | 6 subroutine formFunction(nx, ny, nz, h, t, x, xdot, f) 12 real(kind=8), intent(in) :: x(nx,ny,nz), xdot(nx,ny,nz)
|
| /petsc/src/ts/interface/ |
| H A D | tseig.c | 100 Vec xdot; in TSMonitorSPEig() local 107 PetscCall(VecDuplicate(v, &xdot)); in TSMonitorSPEig() 126 PetscCall(VecSetRandom(xdot, ctx->rand)); in TSMonitorSPEig() 127 PetscCall(KSPSolve(ksp, xdot, xdot)); in TSMonitorSPEig() 128 PetscCall(VecDestroy(&xdot)); in TSMonitorSPEig()
|
| /petsc/src/ts/tutorials/eimex/ |
| H A D | ct_vdp_imex.c | 185 const PetscScalar *x, *xdot; in IFunction() local 189 PetscCall(VecGetArrayRead(Xdot, &xdot)); in IFunction() 191 f[0] = xdot[0]; in IFunction() 192 f[1] = xdot[1] - ((1. - x[0] * x[0]) * x[1] - x[0]) / user->mu; in IFunction() 194 PetscCall(VecRestoreArrayRead(Xdot, &xdot)); in IFunction()
|
| H A D | allen_cahn.c | 131 const PetscScalar *x, *xdot; in FormIFunction() local 137 PetscCall(VecGetArrayRead(Xdot, &xdot)); in FormIFunction() 140 for (i = 0; i < mx; i++) f[i] = xdot[i] - x[i] * (1. - x[i] * x[i]); in FormIFunction() 143 PetscCall(VecRestoreArrayRead(Xdot, &xdot)); in FormIFunction()
|
| /petsc/src/ts/utils/ |
| H A D | dmdats.c | 54 void *x, *f, *xdot; in TSComputeIFunction_DMDA() local 70 PetscCall(DMDAVecGetArray(dm, Xdotloc, &xdot)); in TSComputeIFunction_DMDA() 75 PetscCall((*dmdats->ifunctionlocal)(&info, ptime, x, xdot, f, dmdats->ifunctionlocalctx)); in TSComputeIFunction_DMDA() 85 PetscCall((*dmdats->ifunctionlocal)(&info, ptime, x, xdot, f, dmdats->ifunctionlocalctx)); in TSComputeIFunction_DMDA() 98 PetscCall(DMDAVecRestoreArray(dm, Xdotloc, &xdot)); in TSComputeIFunction_DMDA() 109 void *x, *xdot; in TSComputeIJacobian_DMDA() local 124 PetscCall(DMDAVecGetArray(dm, Xdotloc, &xdot)); in TSComputeIJacobian_DMDA() 126 …PetscCall((*dmdats->ijacobianlocal)(&info, ptime, x, xdot, shift, A, B, dmdats->ijacobianlocalctx)… in TSComputeIJacobian_DMDA() 129 PetscCall(DMDAVecRestoreArray(dm, Xdotloc, &xdot)); in TSComputeIJacobian_DMDA()
|
| /petsc/src/ts/impls/pseudo/ |
| H A D | posindep.c | 10 Vec xdot; /* work vector for time derivative of state */ member 72 PetscCall(VecZeroEntries(pseudo->xdot)); in TSPseudoComputeFunction() 73 PetscCall(TSComputeIFunction(ts, ts->ptime, solution, pseudo->xdot, pseudo->func, PETSC_FALSE)); in TSPseudoComputeFunction() 151 PetscCall(VecDestroy(&pseudo->xdot)); in TSReset_Pseudo() 173 *Xdot = pseudo->xdot; in TSPseudoGetXdot() 226 else PetscCall(VecWAXPY(Y, 1, pseudo->func, pseudo->xdot)); in SNESTSFormFunction_Pseudo() 228 PetscCall(VecAXPBYPCZ(pseudo->xdot, -mdt, mdt, 0, ts->vec_sol0, X)); in SNESTSFormFunction_Pseudo() 229 PetscCall(TSComputeIFunction(ts, ts->ptime + ts->time_step, X, pseudo->xdot, Y, PETSC_FALSE)); in SNESTSFormFunction_Pseudo() 260 PetscCall(VecDuplicate(ts->vec_sol, &pseudo->xdot)); in TSSetUp_Pseudo()
|