Lines Matching refs:dmlocalts
33 static PetscErrorCode DMLocalTSGetContext(DM dm, DMTS tdm, DMTS_Local **dmlocalts) in DMLocalTSGetContext() argument
36 *dmlocalts = NULL; in DMLocalTSGetContext()
43 *dmlocalts = (DMTS_Local *)tdm->data; in DMLocalTSGetContext()
51 DMTS_Local *dmlocalts = (DMTS_Local *)ctx; in TSComputeIFunction_DMLocal() local
64 …if (dmlocalts->boundarylocal) PetscCall((*dmlocalts->boundarylocal)(dm, time, locX, locX_t, dmloca… in TSComputeIFunction_DMLocal()
71 …PetscCall((*dmlocalts->ifunctionlocal)(dm, time, locX, locX_t, locF, dmlocalts->ifunctionlocalctx)… in TSComputeIFunction_DMLocal()
93 DMTS_Local *dmlocalts = (DMTS_Local *)ctx; in TSComputeRHSFunction_DMLocal() local
103 …if (dmlocalts->boundarylocal) PetscCall((*dmlocalts->boundarylocal)(dm, time, locX, NULL, dmlocalt… in TSComputeRHSFunction_DMLocal()
108 PetscCall((*dmlocalts->rhsfunctionlocal)(dm, time, locX, locF, dmlocalts->rhsfunctionlocalctx)); in TSComputeRHSFunction_DMLocal()
113 if (dmlocalts->lumpedmassinv) { in TSComputeRHSFunction_DMLocal()
114 PetscCall(VecPointwiseMult(F, dmlocalts->lumpedmassinv, F)); in TSComputeRHSFunction_DMLocal()
115 } else if (dmlocalts->kspmass) { in TSComputeRHSFunction_DMLocal()
119 PetscCall(KSPSolve(dmlocalts->kspmass, F, tmp)); in TSComputeRHSFunction_DMLocal()
132 DMTS_Local *dmlocalts = (DMTS_Local *)ctx; in TSComputeIJacobian_DMLocal() local
136 if (dmlocalts->ijacobianlocal) { in TSComputeIJacobian_DMLocal()
141 …if (dmlocalts->boundarylocal) PetscCall((*dmlocalts->boundarylocal)(dm, time, locX, locX_t, dmloca… in TSComputeIJacobian_DMLocal()
147 …PetscCall((*dmlocalts->ijacobianlocal)(dm, time, locX, locX_t, a, A, B, dmlocalts->ijacobianlocalc… in TSComputeIJacobian_DMLocal()
162 …gSetFunction(fdcoloring, (MatFDColoringFn *)(PetscVoidFn *)TSComputeIFunction_DMLocal, dmlocalts)); in TSComputeIJacobian_DMLocal()
220 DMTS_Local *dmlocalts; in DMTSSetBoundaryLocal() local
225 PetscCall(DMLocalTSGetContext(dm, tdm, &dmlocalts)); in DMTSSetBoundaryLocal()
227 dmlocalts->boundarylocal = func; in DMTSSetBoundaryLocal()
228 dmlocalts->boundarylocalctx = ctx; in DMTSSetBoundaryLocal()
253 DMTS_Local *dmlocalts; in DMTSGetIFunctionLocal() local
258 PetscCall(DMLocalTSGetContext(dm, tdm, &dmlocalts)); in DMTSGetIFunctionLocal()
261 *func = dmlocalts->ifunctionlocal; in DMTSGetIFunctionLocal()
265 *(void **)ctx = dmlocalts->ifunctionlocalctx; in DMTSGetIFunctionLocal()
289 DMTS_Local *dmlocalts; in DMTSSetIFunctionLocal() local
294 PetscCall(DMLocalTSGetContext(dm, tdm, &dmlocalts)); in DMTSSetIFunctionLocal()
296 dmlocalts->ifunctionlocal = func; in DMTSSetIFunctionLocal()
297 dmlocalts->ifunctionlocalctx = ctx; in DMTSSetIFunctionLocal()
299 PetscCall(DMTSSetIFunction(dm, TSComputeIFunction_DMLocal, dmlocalts)); in DMTSSetIFunctionLocal()
301 PetscCall(DMTSSetIJacobian(dm, TSComputeIJacobian_DMLocal, dmlocalts)); in DMTSSetIFunctionLocal()
325 DMTS_Local *dmlocalts; in DMTSGetIJacobianLocal() local
330 PetscCall(DMLocalTSGetContext(dm, tdm, &dmlocalts)); in DMTSGetIJacobianLocal()
333 *func = dmlocalts->ijacobianlocal; in DMTSGetIJacobianLocal()
337 *(void **)ctx = dmlocalts->ijacobianlocalctx; in DMTSGetIJacobianLocal()
359 DMTS_Local *dmlocalts; in DMTSSetIJacobianLocal() local
364 PetscCall(DMLocalTSGetContext(dm, tdm, &dmlocalts)); in DMTSSetIJacobianLocal()
366 dmlocalts->ijacobianlocal = func; in DMTSSetIJacobianLocal()
367 dmlocalts->ijacobianlocalctx = ctx; in DMTSSetIJacobianLocal()
369 PetscCall(DMTSSetIJacobian(dm, TSComputeIJacobian_DMLocal, dmlocalts)); in DMTSSetIJacobianLocal()
394 DMTS_Local *dmlocalts; in DMTSGetRHSFunctionLocal() local
399 PetscCall(DMLocalTSGetContext(dm, tdm, &dmlocalts)); in DMTSGetRHSFunctionLocal()
402 *func = dmlocalts->rhsfunctionlocal; in DMTSGetRHSFunctionLocal()
406 *(void **)ctx = dmlocalts->rhsfunctionlocalctx; in DMTSGetRHSFunctionLocal()
430 DMTS_Local *dmlocalts; in DMTSSetRHSFunctionLocal() local
435 PetscCall(DMLocalTSGetContext(dm, tdm, &dmlocalts)); in DMTSSetRHSFunctionLocal()
437 dmlocalts->rhsfunctionlocal = func; in DMTSSetRHSFunctionLocal()
438 dmlocalts->rhsfunctionlocalctx = ctx; in DMTSSetRHSFunctionLocal()
440 PetscCall(DMTSSetRHSFunction(dm, TSComputeRHSFunction_DMLocal, dmlocalts)); in DMTSSetRHSFunctionLocal()
462 DMTS_Local *dmlocalts; in DMTSCreateRHSMassMatrix() local
468 PetscCall(DMLocalTSGetContext(dm, tdm, &dmlocalts)); in DMTSCreateRHSMassMatrix()
469 PetscCall(DMCreateMassMatrix(dm, dm, &dmlocalts->mass)); in DMTSCreateRHSMassMatrix()
470 PetscCall(KSPCreate(PetscObjectComm((PetscObject)dm), &dmlocalts->kspmass)); in DMTSCreateRHSMassMatrix()
472 PetscCall(KSPSetOptionsPrefix(dmlocalts->kspmass, prefix)); in DMTSCreateRHSMassMatrix()
473 PetscCall(KSPAppendOptionsPrefix(dmlocalts->kspmass, "mass_")); in DMTSCreateRHSMassMatrix()
474 PetscCall(KSPSetFromOptions(dmlocalts->kspmass)); in DMTSCreateRHSMassMatrix()
475 PetscCall(KSPSetOperators(dmlocalts->kspmass, dmlocalts->mass, dmlocalts->mass)); in DMTSCreateRHSMassMatrix()
498 DMTS_Local *dmlocalts; in DMTSCreateRHSMassMatrixLumped() local
503 PetscCall(DMLocalTSGetContext(dm, tdm, &dmlocalts)); in DMTSCreateRHSMassMatrixLumped()
504 PetscCall(DMCreateMassMatrixLumped(dm, NULL, &dmlocalts->lumpedmassinv)); in DMTSCreateRHSMassMatrixLumped()
505 PetscCall(VecReciprocal(dmlocalts->lumpedmassinv)); in DMTSCreateRHSMassMatrixLumped()
506 PetscCall(VecViewFromOptions(dmlocalts->lumpedmassinv, NULL, "-lumped_mass_inv_view")); in DMTSCreateRHSMassMatrixLumped()
525 DMTS_Local *dmlocalts; in DMTSDestroyRHSMassMatrix() local
530 PetscCall(DMLocalTSGetContext(dm, tdm, &dmlocalts)); in DMTSDestroyRHSMassMatrix()
531 PetscCall(VecDestroy(&dmlocalts->lumpedmassinv)); in DMTSDestroyRHSMassMatrix()
532 PetscCall(MatDestroy(&dmlocalts->mass)); in DMTSDestroyRHSMassMatrix()
533 PetscCall(KSPDestroy(&dmlocalts->kspmass)); in DMTSDestroyRHSMassMatrix()