Lines Matching refs:snes

25 PetscErrorCode SNESShellSetSolve(SNES snes, PetscErrorCode (*solve)(SNES snes, Vec xout))  in SNESShellSetSolve()  argument
28 PetscValidHeaderSpecific(snes, SNES_CLASSID, 1); in SNESShellSetSolve()
29 PetscTryMethod(snes, "SNESShellSetSolve_C", (SNES, PetscErrorCode (*)(SNES, Vec)), (snes, solve)); in SNESShellSetSolve()
33 static PetscErrorCode SNESDestroy_Shell(SNES snes) in SNESDestroy_Shell() argument
36 PetscCall(PetscFree(snes->data)); in SNESDestroy_Shell()
61 PetscErrorCode SNESShellGetContext(SNES snes, PetscCtxRt ctx) in SNESShellGetContext() argument
66 PetscValidHeaderSpecific(snes, SNES_CLASSID, 1); in SNESShellGetContext()
68 PetscCall(PetscObjectTypeCompare((PetscObject)snes, SNESSHELL, &flg)); in SNESShellGetContext()
70 else *(void **)ctx = ((SNES_Shell *)snes->data)->ctx; in SNESShellGetContext()
87 PetscErrorCode SNESShellSetContext(SNES snes, PetscCtx ctx) in SNESShellSetContext() argument
89 SNES_Shell *shell = (SNES_Shell *)snes->data; in SNESShellSetContext()
93 PetscValidHeaderSpecific(snes, SNES_CLASSID, 1); in SNESShellSetContext()
94 PetscCall(PetscObjectTypeCompare((PetscObject)snes, SNESSHELL, &flg)); in SNESShellSetContext()
99 static PetscErrorCode SNESSolve_Shell(SNES snes) in SNESSolve_Shell() argument
101 SNES_Shell *shell = (SNES_Shell *)snes->data; in SNESSolve_Shell()
104 …PetscCheck(shell->solve, PetscObjectComm((PetscObject)snes), PETSC_ERR_ARG_WRONGSTATE, "Must call … in SNESSolve_Shell()
105 snes->reason = SNES_CONVERGED_ITS; in SNESSolve_Shell()
106 PetscCall((*shell->solve)(snes, snes->vec_sol)); in SNESSolve_Shell()
110 static PetscErrorCode SNESShellSetSolve_Shell(SNES snes, PetscErrorCode (*solve)(SNES, Vec)) in SNESShellSetSolve_Shell() argument
112 SNES_Shell *shell = (SNES_Shell *)snes->data; in SNESShellSetSolve_Shell()
127 PETSC_EXTERN PetscErrorCode SNESCreate_Shell(SNES snes) in SNESCreate_Shell() argument
132 snes->ops->destroy = SNESDestroy_Shell; in SNESCreate_Shell()
133 snes->ops->solve = SNESSolve_Shell; in SNESCreate_Shell()
135 snes->usesksp = PETSC_FALSE; in SNESCreate_Shell()
136 snes->usesnpc = PETSC_FALSE; in SNESCreate_Shell()
138 snes->alwayscomputesfinalresidual = PETSC_FALSE; in SNESCreate_Shell()
140 PetscCall(SNESParametersInitialize(snes)); in SNESCreate_Shell()
143 snes->data = (void *)shell; in SNESCreate_Shell()
144 …PetscCall(PetscObjectComposeFunction((PetscObject)snes, "SNESShellSetSolve_C", SNESShellSetSolve_S… in SNESCreate_Shell()