Lines Matching refs:pf
27 PetscErrorCode PFSet(PF pf, PetscErrorCode (*apply)(void *, PetscInt, const PetscScalar *, PetscSca… in PFSet() argument
30 PetscValidHeaderSpecific(pf, PF_CLASSID, 1); in PFSet()
31 pf->data = ctx; in PFSet()
32 pf->ops->destroy = destroy; in PFSet()
33 pf->ops->apply = apply; in PFSet()
34 pf->ops->applyvec = applyvec; in PFSet()
35 pf->ops->view = view; in PFSet()
51 PetscErrorCode PFDestroy(PF *pf) in PFDestroy() argument
54 if (!*pf) PetscFunctionReturn(PETSC_SUCCESS); in PFDestroy()
55 PetscValidHeaderSpecific(*pf, PF_CLASSID, 1); in PFDestroy()
56 if (--((PetscObject)*pf)->refct > 0) PetscFunctionReturn(PETSC_SUCCESS); in PFDestroy()
58 PetscCall(PFViewFromOptions(*pf, NULL, "-pf_view")); in PFDestroy()
60 PetscCall(PetscObjectSAWsViewOff((PetscObject)*pf)); in PFDestroy()
62 if ((*pf)->ops->destroy) PetscCall((*(*pf)->ops->destroy)((*pf)->data)); in PFDestroy()
63 PetscCall(PetscHeaderDestroy(pf)); in PFDestroy()
84 PetscErrorCode PFCreate(MPI_Comm comm, PetscInt dimin, PetscInt dimout, PF *pf) in PFCreate() argument
89 PetscAssertPointer(pf, 4); in PFCreate()
90 *pf = NULL; in PFCreate()
102 *pf = newpf; in PFCreate()
122 PetscErrorCode PFApplyVec(PF pf, Vec x, Vec y) in PFApplyVec() argument
128 PetscValidHeaderSpecific(pf, PF_CLASSID, 1); in PFApplyVec()
138 lsize = pf->dimin * lsize / pf->dimout; in PFApplyVec()
149 …pf->dimin * (n / pf->dimin)) == n, PETSC_COMM_SELF, PETSC_ERR_ARG_SIZ, "Local input vector length … in PFApplyVec()
150 …pf->dimout * (p / pf->dimout)) == p, PETSC_COMM_SELF, PETSC_ERR_ARG_SIZ, "Local output vector leng… in PFApplyVec()
151 …pf->dimin) == (p / pf->dimout), PETSC_COMM_SELF, PETSC_ERR_ARG_SIZ, "Local vector lengths %" Petsc… in PFApplyVec()
153 …if (pf->ops->applyvec) PetscCallBack("PF callback apply to vector", (*pf->ops->applyvec)(pf->data,… in PFApplyVec()
159 n = n / pf->dimin; in PFApplyVec()
162 PetscCallBack("PF callback apply to array", (*pf->ops->apply)(pf->data, n, xx, yy)); in PFApplyVec()
189 PetscErrorCode PFApply(PF pf, PetscInt n, const PetscScalar *x, PetscScalar *y) in PFApply() argument
192 PetscValidHeaderSpecific(pf, PF_CLASSID, 1); in PFApply()
197 PetscCallBack("PF callback apply", (*pf->ops->apply)(pf->data, n, x, y)); in PFApply()
250 PetscErrorCode PFView(PF pf, PetscViewer viewer) in PFView() argument
256 PetscValidHeaderSpecific(pf, PF_CLASSID, 1); in PFView()
257 if (!viewer) PetscCall(PetscViewerASCIIGetStdout(PetscObjectComm((PetscObject)pf), &viewer)); in PFView()
259 PetscCheckSameComm(pf, 1, viewer, 2); in PFView()
264 PetscCall(PetscObjectPrintClassNamePrefixType((PetscObject)pf, viewer)); in PFView()
265 if (pf->ops->view) { in PFView()
267 PetscCallBack("PF callback view", (*pf->ops->view)(pf->data, viewer)); in PFView()
328 PetscErrorCode PFGetType(PF pf, PFType *type) in PFGetType() argument
331 PetscValidHeaderSpecific(pf, PF_CLASSID, 1); in PFGetType()
333 *type = ((PetscObject)pf)->type_name; in PFGetType()
357 PetscErrorCode PFSetType(PF pf, PFType type, PetscCtx ctx) in PFSetType() argument
363 PetscValidHeaderSpecific(pf, PF_CLASSID, 1); in PFSetType()
366 PetscCall(PetscObjectTypeCompare((PetscObject)pf, type, &match)); in PFSetType()
369 PetscTryTypeMethod(pf, destroy); in PFSetType()
370 pf->data = NULL; in PFSetType()
374 …PetscCheck(r, PetscObjectComm((PetscObject)pf), PETSC_ERR_ARG_UNKNOWN_TYPE, "Unable to find reques… in PFSetType()
375 pf->ops->destroy = NULL; in PFSetType()
376 pf->ops->view = NULL; in PFSetType()
377 pf->ops->apply = NULL; in PFSetType()
378 pf->ops->applyvec = NULL; in PFSetType()
381 PetscCall((*r)(pf, ctx)); in PFSetType()
383 PetscCall(PetscObjectChangeTypeName((PetscObject)pf, type)); in PFSetType()
403 PetscErrorCode PFSetFromOptions(PF pf) in PFSetFromOptions() argument
409 PetscValidHeaderSpecific(pf, PF_CLASSID, 1); in PFSetFromOptions()
411 PetscObjectOptionsBegin((PetscObject)pf); in PFSetFromOptions()
413 if (flg) PetscCall(PFSetType(pf, type, NULL)); in PFSetFromOptions()
414 PetscTryTypeMethod(pf, setfromoptions, PetscOptionsObject); in PFSetFromOptions()
417 PetscCall(PetscObjectProcessOptionsHandlers((PetscObject)pf, PetscOptionsObject)); in PFSetFromOptions()