Lines Matching refs:kdm
52 static PetscErrorCode DMTSDestroy(DMTS *kdm) in DMTSDestroy() argument
55 if (!*kdm) PetscFunctionReturn(PETSC_SUCCESS); in DMTSDestroy()
56 PetscValidHeaderSpecific(*kdm, DMTS_CLASSID, 1); in DMTSDestroy()
57 if (--((PetscObject)*kdm)->refct > 0) { in DMTSDestroy()
58 *kdm = NULL; in DMTSDestroy()
61 PetscCall(DMTSUnsetRHSFunctionContext_DMTS(*kdm)); in DMTSDestroy()
62 PetscCall(DMTSUnsetRHSJacobianContext_DMTS(*kdm)); in DMTSDestroy()
63 PetscCall(DMTSUnsetIFunctionContext_DMTS(*kdm)); in DMTSDestroy()
64 PetscCall(DMTSUnsetIJacobianContext_DMTS(*kdm)); in DMTSDestroy()
65 PetscCall(DMTSUnsetI2FunctionContext_DMTS(*kdm)); in DMTSDestroy()
66 PetscCall(DMTSUnsetI2JacobianContext_DMTS(*kdm)); in DMTSDestroy()
67 PetscTryTypeMethod(*kdm, destroy); in DMTSDestroy()
68 PetscCall(PetscHeaderDestroy(kdm)); in DMTSDestroy()
72 PetscErrorCode DMTSLoad(DMTS kdm, PetscViewer viewer) in DMTSLoad() argument
75 PetscCall(PetscViewerBinaryRead(viewer, &kdm->ops->ifunction, 1, NULL, PETSC_FUNCTION)); in DMTSLoad()
76 PetscCall(PetscViewerBinaryRead(viewer, &kdm->ops->ifunctionview, 1, NULL, PETSC_FUNCTION)); in DMTSLoad()
77 PetscCall(PetscViewerBinaryRead(viewer, &kdm->ops->ifunctionload, 1, NULL, PETSC_FUNCTION)); in DMTSLoad()
78 if (kdm->ops->ifunctionload) { in DMTSLoad()
81 PetscCall(PetscContainerGetPointer(kdm->ifunctionctxcontainer, &ctx)); in DMTSLoad()
82 PetscCall((*kdm->ops->ifunctionload)(&ctx, viewer)); in DMTSLoad()
84 PetscCall(PetscViewerBinaryRead(viewer, &kdm->ops->ijacobian, 1, NULL, PETSC_FUNCTION)); in DMTSLoad()
85 PetscCall(PetscViewerBinaryRead(viewer, &kdm->ops->ijacobianview, 1, NULL, PETSC_FUNCTION)); in DMTSLoad()
86 PetscCall(PetscViewerBinaryRead(viewer, &kdm->ops->ijacobianload, 1, NULL, PETSC_FUNCTION)); in DMTSLoad()
87 if (kdm->ops->ijacobianload) { in DMTSLoad()
90 PetscCall(PetscContainerGetPointer(kdm->ijacobianctxcontainer, &ctx)); in DMTSLoad()
91 PetscCall((*kdm->ops->ijacobianload)(&ctx, viewer)); in DMTSLoad()
96 PetscErrorCode DMTSView(DMTS kdm, PetscViewer viewer) in DMTSView() argument
107 PetscCall(PetscFPTFind(kdm->ops->ifunction, &fname)); in DMTSView()
109 PetscCall(PetscFPTFind(kdm->ops->ijacobian, &fname)); in DMTSView()
132 funcstruct.ifunction = kdm->ops->ifunction; in DMTSView()
133 funcviewstruct.ifunctionview = kdm->ops->ifunctionview; in DMTSView()
134 funcloadstruct.ifunctionload = kdm->ops->ifunctionload; in DMTSView()
138 if (kdm->ops->ifunctionview) { in DMTSView()
141 PetscCall(PetscContainerGetPointer(kdm->ifunctionctxcontainer, &ctx)); in DMTSView()
142 PetscCall((*kdm->ops->ifunctionview)(ctx, viewer)); in DMTSView()
144 jacstruct.ijacobian = kdm->ops->ijacobian; in DMTSView()
145 jacviewstruct.ijacobianview = kdm->ops->ijacobianview; in DMTSView()
146 jacloadstruct.ijacobianload = kdm->ops->ijacobianload; in DMTSView()
150 if (kdm->ops->ijacobianview) { in DMTSView()
153 PetscCall(PetscContainerGetPointer(kdm->ijacobianctxcontainer, &ctx)); in DMTSView()
154 PetscCall((*kdm->ops->ijacobianview)(ctx, viewer)); in DMTSView()
160 static PetscErrorCode DMTSCreate(MPI_Comm comm, DMTS *kdm) in DMTSCreate() argument
164 …PetscCall(PetscHeaderCreate(*kdm, DMTS_CLASSID, "DMTS", "DMTS", "DMTS", comm, DMTSDestroy, DMTSVie… in DMTSCreate()
214 PetscErrorCode DMTSCopy(DMTS kdm, DMTS nkdm) in DMTSCopy() argument
217 PetscValidHeaderSpecific(kdm, DMTS_CLASSID, 1); in DMTSCopy()
219 nkdm->ops->rhsfunction = kdm->ops->rhsfunction; in DMTSCopy()
220 nkdm->ops->rhsjacobian = kdm->ops->rhsjacobian; in DMTSCopy()
221 nkdm->ops->ifunction = kdm->ops->ifunction; in DMTSCopy()
222 nkdm->ops->ijacobian = kdm->ops->ijacobian; in DMTSCopy()
223 nkdm->ops->i2function = kdm->ops->i2function; in DMTSCopy()
224 nkdm->ops->i2jacobian = kdm->ops->i2jacobian; in DMTSCopy()
225 nkdm->ops->solution = kdm->ops->solution; in DMTSCopy()
226 nkdm->ops->destroy = kdm->ops->destroy; in DMTSCopy()
227 nkdm->ops->duplicate = kdm->ops->duplicate; in DMTSCopy()
229 nkdm->solutionctx = kdm->solutionctx; in DMTSCopy()
230 nkdm->rhsfunctionctxcontainer = kdm->rhsfunctionctxcontainer; in DMTSCopy()
231 nkdm->rhsjacobianctxcontainer = kdm->rhsjacobianctxcontainer; in DMTSCopy()
232 nkdm->ifunctionctxcontainer = kdm->ifunctionctxcontainer; in DMTSCopy()
233 nkdm->ijacobianctxcontainer = kdm->ijacobianctxcontainer; in DMTSCopy()
234 nkdm->i2functionctxcontainer = kdm->i2functionctxcontainer; in DMTSCopy()
235 nkdm->i2jacobianctxcontainer = kdm->i2jacobianctxcontainer; in DMTSCopy()
243 nkdm->data = kdm->data; in DMTSCopy()
252 PetscTryTypeMethod(kdm, duplicate, nkdm); in DMTSCopy()