Home
last modified time | relevance | path

Searched refs:mctx (Results 1 – 21 of 21) sorted by relevance

/petsc/src/ts/tutorials/autodiff/adolc-utils/
H A Dmatfree.cxx32 AdolcMatCtx *mctx; in PetscAdolcIJacobianVectorProduct() local
42 PetscCall(MatShellGetContext(A_shell, &mctx)); in PetscAdolcIJacobianVectorProduct()
43 m = mctx->m; in PetscAdolcIJacobianVectorProduct()
44 n = mctx->n; in PetscAdolcIJacobianVectorProduct()
47 PetscCall(TSGetDM(mctx->ts, &da)); in PetscAdolcIJacobianVectorProduct()
53 PetscCall(VecGetArrayRead(mctx->localX0, &x0)); in PetscAdolcIJacobianVectorProduct()
58 PetscCall(PetscLogEventBegin(mctx->event1, 0, 0, 0, 0)); in PetscAdolcIJacobianVectorProduct()
59 fos_forward(mctx->tag1, m, n, 0, x0, x1, NULL, action); in PetscAdolcIJacobianVectorProduct()
68 PetscCall(PetscLogEventEnd(mctx->event1, 0, 0, 0, 0)); in PetscAdolcIJacobianVectorProduct()
74 PetscCall(PetscLogEventBegin(mctx->event2, 0, 0, 0, 0)); in PetscAdolcIJacobianVectorProduct()
[all …]
/petsc/src/ts/tutorials/advection-diffusion-reaction/
H A Dex5adj_mf.c60 MCtx *mctx; in MyRHSMatMultTranspose() local
70 PetscCall(MatShellGetContext(A_shell, &mctx)); in MyRHSMatMultTranspose()
71 appctx = mctx->appctx; in MyRHSMatMultTranspose()
72 PetscCall(TSGetDM(mctx->ts, &da)); in MyRHSMatMultTranspose()
89 PetscCall(DMDAVecGetArrayRead(da, mctx->U, &u)); in MyRHSMatMultTranspose()
111 PetscCall(DMDAVecRestoreArrayRead(da, mctx->U, &u)); in MyRHSMatMultTranspose()
119 MCtx *mctx; in MyIMatMultTranspose() local
129 PetscCall(MatShellGetContext(A_shell, &mctx)); in MyIMatMultTranspose()
130 appctx = mctx->appctx; in MyIMatMultTranspose()
131 PetscCall(TSGetDM(mctx->ts, &da)); in MyIMatMultTranspose()
[all …]
/petsc/src/ksp/ksp/interface/ftn-custom/
H A Dzitfuncf.c92 …monitor)(KSP *, PetscInt *, PetscReal *, void *, PetscErrorCode *), void *mctx, void (*monitordest… in kspmonitorset_() argument
97 …*ierr = KSPMonitorSet(*ksp, (KSPMonitorFn *)KSPMonitorResidual, *(PetscViewerAndFormat **)mctx, (P… in kspmonitorset_()
99 …*ierr = KSPMonitorSet(*ksp, (KSPMonitorFn *)KSPMonitorSolution, *(PetscViewerAndFormat **)mctx, (P… in kspmonitorset_()
101 …t(*ksp, (KSPMonitorFn *)KSPMonitorTrueResidual, *(PetscViewerAndFormat **)mctx, (PetscCtxDestroyFn… in kspmonitorset_()
103 …(*ksp, (KSPMonitorFn *)KSPMonitorSingularValue, *(PetscViewerAndFormat **)mctx, (PetscCtxDestroyFn… in kspmonitorset_()
105 …et(*ksp, (KSPMonitorFn *)KSPGMRESMonitorKrylov, *(PetscViewerAndFormat **)mctx, (PetscCtxDestroyFn… in kspmonitorset_()
107 …cObject)*ksp, PETSC_FORTRAN_CALLBACK_CLASS, &_cb.monitor, (PetscFortranCallbackFn *)monitor, mctx); in kspmonitorset_()
109 …PETSC_FORTRAN_CALLBACK_CLASS, &_cb.monitordestroy, (PetscFortranCallbackFn *)monitordestroy, mctx); in kspmonitorset_()
/petsc/src/ksp/ksp/utils/lmvm/
H A Dlmvmimpl.c243 Mat_LMVM *mctx; in MatCopy_LMVM() local
252 mctx = (Mat_LMVM *)M->data; in MatCopy_LMVM()
256 mctx->nupdates = bctx->nupdates; in MatCopy_LMVM()
257 mctx->nrejects = bctx->nrejects; in MatCopy_LMVM()
258 mctx->k = bctx->k; in MatCopy_LMVM()
260 PetscCall(VecCopy(bctx->Xprev, mctx->Xprev)); in MatCopy_LMVM()
261 PetscCall(VecCopy(bctx->Fprev, mctx->Fprev)); in MatCopy_LMVM()
263 PetscCall(LMBasisCopy(bctx->basis[LMBASIS_S], mctx->basis[LMBASIS_S])); in MatCopy_LMVM()
264 PetscCall(LMBasisCopy(bctx->basis[LMBASIS_Y], mctx->basis[LMBASIS_Y])); in MatCopy_LMVM()
265 mctx->do_not_cache_J0_products = bctx->do_not_cache_J0_products; in MatCopy_LMVM()
[all …]
/petsc/src/ts/tutorials/autodiff/
H A Dadr_ex5adj_mf.cxx419 AdolcMatCtx *mctx; in IJacobianMatFree() local
423 PetscCall(MatShellGetContext(A_shell, &mctx)); in IJacobianMatFree()
425 mctx->time = t; in IJacobianMatFree()
426 mctx->shift = a; in IJacobianMatFree()
427 if (mctx->ts != ts) mctx->ts = ts; in IJacobianMatFree()
428 PetscCall(VecCopy(X, mctx->X)); in IJacobianMatFree()
429 PetscCall(VecCopy(Xdot, mctx->Xdot)); in IJacobianMatFree()
431 PetscCall(DMGlobalToLocalBegin(da, mctx->X, INSERT_VALUES, mctx->localX0)); in IJacobianMatFree()
432 PetscCall(DMGlobalToLocalEnd(da, mctx->X, INSERT_VALUES, mctx->localX0)); in IJacobianMatFree()
/petsc/src/sys/classes/viewer/interface/
H A Dviewers.c117 … *nmctx, PetscCtxDestroyFn *nmdestroy, PetscErrorCode (*mon)(void), void *mctx, PetscCtxDestroyFn … in PetscMonitorCompare() argument
123 if (nmctx == mctx) *identical = PETSC_TRUE; in PetscMonitorCompare()
125 … PetscViewerAndFormat *old = (PetscViewerAndFormat *)mctx, *newo = (PetscViewerAndFormat *)nmctx; in PetscMonitorCompare()
/petsc/src/ksp/ksp/utils/lmvm/rescale/
H A Dsymbrdnrescale.c370 PETSC_INTERN PetscErrorCode SymBroydenRescaleCopy(SymBroydenRescale bctx, SymBroydenRescale mctx) in SymBroydenRescaleCopy() argument
373 mctx->scale_type = bctx->scale_type; in SymBroydenRescaleCopy()
374 mctx->theta = bctx->theta; in SymBroydenRescaleCopy()
375 mctx->alpha = bctx->alpha; in SymBroydenRescaleCopy()
376 mctx->beta = bctx->beta; in SymBroydenRescaleCopy()
377 mctx->rho = bctx->rho; in SymBroydenRescaleCopy()
378 mctx->delta = bctx->delta; in SymBroydenRescaleCopy()
379 mctx->delta_min = bctx->delta_min; in SymBroydenRescaleCopy()
380 mctx->delta_max = bctx->delta_max; in SymBroydenRescaleCopy()
381 mctx->tol = bctx->tol; in SymBroydenRescaleCopy()
[all …]
/petsc/src/ts/utils/dmplexlandau/tutorials/
H A Dex1.c83 MaxwellianCtx *mctx = (MaxwellianCtx *)actx; in maxwellian() local
84 PetscReal theta = 2 * mctx->kT_m / (mctx->v_0 * mctx->v_0); /* theta = 2kT/mc^2 */ in maxwellian()
88 …0] += alphai * mctx->n * PetscPowReal(PETSC_PI * theta, -1.5) * PetscExpReal(-(alphai * x[0] * x[0… in maxwellian()
89 …phai * mctx->n * PetscPowReal(PETSC_PI * theta, -1.5) * PetscExpReal(-(alphai * (x[0] * x[0] + x[1… in maxwellian()
/petsc/src/dm/impls/stag/tests/
H A Dex18.c90 DMStagAnalysisKSPMonitorContext mctx; in main() local
208 mctx.dm = dmuu; in main()
209 mctx.solRef = NULL; /* Reference solution not computed for u-u only */ in main()
210 mctx.solPrev = NULL; /* Populated automatically */ in main()
211 PetscCall(CreateNumericalReferenceSolution(Auu, fu, &mctx.solRefNum)); in main()
212 PetscCall(KSPMonitorSet(ksp, DMStagAnalysisKSPMonitor, &mctx, NULL)); in main()
220 PetscCall(VecDestroy(&mctx.solPrev)); in main()
221 PetscCall(VecDestroy(&mctx.solRef)); in main()
222 PetscCall(VecDestroy(&mctx.solRefNum)); in main()
674 PetscErrorCode DMStagAnalysisKSPMonitor(KSP ksp, PetscInt it, PetscReal rnorm, void *mctx) in DMStagAnalysisKSPMonitor() argument
[all …]
/petsc/src/snes/interface/ftn-custom/
H A Dzsnesf.c363 …(*func)(SNES *, PetscInt *, PetscReal *, void *, PetscErrorCode *), void *mctx, void (*mondestroy)… in snesmonitorset_() argument
367 …etscInt, PetscReal, void *))SNESMonitorDefault, *(PetscViewerAndFormat **)mctx, (PetscCtxDestroyFn… in snesmonitorset_()
369 …tscInt, PetscReal, void *))SNESMonitorSolution, *(PetscViewerAndFormat **)mctx, (PetscCtxDestroyFn… in snesmonitorset_()
371 …, PetscReal, void *))SNESMonitorSolutionUpdate, *(PetscViewerAndFormat **)mctx, (PetscCtxDestroyFn… in snesmonitorset_()
373 …tscObject)*snes, PETSC_FORTRAN_CALLBACK_CLASS, &_cb.monitor, (PetscFortranCallbackFn *)func, mctx); in snesmonitorset_()
375 …)*snes, PETSC_FORTRAN_CALLBACK_CLASS, &_cb.mondestroy, (PetscFortranCallbackFn *)mondestroy, mctx); in snesmonitorset_()
/petsc/src/ksp/ksp/utils/lmvm/diagbrdn/
H A Ddiagbrdn.c69 SymBroydenRescale mctx = (SymBroydenRescale)mdata->ctx; in MatCopy_DiagBrdn() local
72 PetscCall(SymBroydenRescaleCopy(bctx, mctx)); in MatCopy_DiagBrdn()
/petsc/src/ts/utils/
H A Ddmdats.c343 PetscErrorCode TSMonitorDMDARayDestroy(PetscCtxRt mctx) in TSMonitorDMDARayDestroy() argument
345 TSMonitorDMDARayCtx *rayctx = *(TSMonitorDMDARayCtx **)mctx; in TSMonitorDMDARayDestroy()
356 PetscErrorCode TSMonitorDMDARay(TS ts, PetscInt steps, PetscReal time, Vec u, void *mctx) in TSMonitorDMDARay() argument
358 TSMonitorDMDARayCtx *rayctx = (TSMonitorDMDARayCtx *)mctx; in TSMonitorDMDARay()
/petsc/src/ts/interface/ftn-custom/
H A Dztsf.c281 …c)(TS *, PetscInt *, PetscReal *, Vec *, void *, PetscErrorCode *), void *mctx, void (*d)(void *, … in tsmonitorset_() argument
285 …cInt, PetscReal, Vec, void *))TSMonitorDefault, *(PetscViewerAndFormat **)mctx, (PetscCtxDestroyFn… in tsmonitorset_()
287 …PetscObject)*ts, PETSC_FORTRAN_CALLBACK_CLASS, &_cb.monitor, (PetscFortranCallbackFn *)func, mctx); in tsmonitorset_()
288 …PetscObject)*ts, PETSC_FORTRAN_CALLBACK_CLASS, &_cb.mondestroy, (PetscFortranCallbackFn *)d, mctx); in tsmonitorset_()
/petsc/src/snes/linesearch/interface/
H A Dlinesearch.c99 …NESLineSearch ls, PetscErrorCode (*f)(SNESLineSearch ls, PetscCtx mctx), PetscCtx mctx, PetscCtxDe… in SNESLineSearchMonitorSet() argument
106 …PetscCall(PetscMonitorCompare((PetscErrorCode (*)(void))(PetscVoidFn *)f, mctx, monitordestroy, (P… in SNESLineSearchMonitorSet()
112 ls->monitorcontext[ls->numbermonitors++] = mctx; in SNESLineSearchMonitorSet()
/petsc/src/ts/interface/
H A Dtsmon.c124 …or)(TS ts, PetscInt steps, PetscReal time, Vec u, PetscCtx ctx), PetscCtx mctx, PetscCtxDestroyFn … in TSMonitorSet() argument
131 …PetscCall(PetscMonitorCompare((PetscErrorCode (*)(void))(PetscVoidFn *)monitor, mctx, mdestroy, (P… in TSMonitorSet()
137 ts->monitorcontext[ts->numbermonitors++] = mctx; in TSMonitorSet()
/petsc/src/ts/utils/dmplexlandau/
H A Dplexland.c804 MaxwellianCtx *mctx = (MaxwellianCtx *)actx; in maxwellian() local
806 …PetscReal v2 = 0, theta = 2 * mctx->kT_m / (mctx->v_0 * mctx->v_0), shift; /* theta = 2kT/mc^… in maxwellian()
812 if (mctx->shift < 0) shift = -mctx->shift; in maxwellian()
814 u[0] = mctx->n * PetscPowReal(PETSC_PI * theta, -1.5) * (PetscExpReal(-v2 / theta)); in maxwellian()
815 shift = mctx->shift; in maxwellian()
822 u[0] += mctx->n * PetscPowReal(PETSC_PI * theta, -1.5) * (PetscExpReal(-v2 / theta)); in maxwellian()
/petsc/src/sys/objects/
H A Doptions.c2128 …ar name[], const char value[], PetscOptionSource source, PetscCtx mctx), PetscCtx mctx, PetscCtxDe… in PetscOptionsMonitorSet() argument
2137 options->monitorcontext[options->numbermonitors++] = mctx; in PetscOptionsMonitorSet()
/petsc/doc/manual/
H A Dsnes.md869 …rrorCode (*mon)(SNES snes, PetscInt its, PetscReal norm, PetscCtx mctx), PetscCtx mctx, (PetscCtxD…
873 `its` and `mctx` respectively denote the iteration number and an
/petsc/src/snes/interface/
H A Dsnes.c4262 … snes, PetscErrorCode (*f)(SNES, PetscInt, PetscReal, PetscCtx), PetscCtx mctx, PetscCtxDestroyFn … in SNESMonitorSet() argument
4269 …PetscCall(PetscMonitorCompare((PetscErrorCode (*)(void))(PetscVoidFn *)f, mctx, monitordestroy, (P… in SNESMonitorSet()
4275 snes->monitorcontext[snes->numbermonitors++] = mctx; in SNESMonitorSet()
/petsc/src/dm/interface/
H A Ddm.c9015 PetscErrorCode DMMonitorSet(DM dm, PetscErrorCode (*f)(DM, void *), void *mctx, PetscCtxDestroyFn *… in DMMonitorSet() argument
9022 …PetscCall(PetscMonitorCompare((PetscErrorCode (*)(void))(PetscVoidFn *)f, mctx, monitordestroy, (P… in DMMonitorSet()
9028 dm->monitorcontext[dm->numbermonitors++] = mctx; in DMMonitorSet()
/petsc/src/ts/tutorials/
H A Dex53.c2006 static PetscErrorCode SolutionMonitor(TS ts, PetscInt steps, PetscReal time, Vec u, void *mctx) in SolutionMonitor() argument