Lines Matching refs:snes
16 PetscErrorCode SNESFASSetType(SNES snes, SNESFASType fastype) in SNESFASSetType() argument
21 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASSetType()
22 PetscValidLogicalCollectiveEnum(snes, fastype, 2); in SNESFASSetType()
23 fas = (SNES_FAS *)snes->data; in SNESFASSetType()
44 PetscErrorCode SNESFASGetType(SNES snes, SNESFASType *fastype) in SNESFASGetType() argument
49 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASGetType()
51 fas = (SNES_FAS *)snes->data; in SNESFASGetType()
74 PetscErrorCode SNESFASSetLevels(SNES snes, PetscInt levels, MPI_Comm *comms) in SNESFASSetLevels() argument
84 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASSetLevels()
85 fas = (SNES_FAS *)snes->data; in SNESFASSetLevels()
86 PetscCall(PetscObjectGetComm((PetscObject)snes, &comm)); in SNESFASSetLevels()
91 PetscUseTypeMethod(snes, reset); in SNESFASSetLevels()
96 prevsnes = snes; in SNESFASSetLevels()
98 PetscCall(SNESGetOptionsPrefix(snes, &optionsprefix)); in SNESFASSetLevels()
99 PetscCall(PetscObjectComposedDataSetInt((PetscObject)snes, PetscMGLevelId, levels - 1)); in SNESFASSetLevels()
104 fas->fine = snes; in SNESFASSetLevels()
114 … PetscCall(PetscObjectIncrementTabLevel((PetscObject)fas->next, (PetscObject)snes, levels - i)); in SNESFASSetLevels()
139 PetscErrorCode SNESFASGetLevels(SNES snes, PetscInt *levels) in SNESFASGetLevels() argument
144 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASGetLevels()
146 fas = (SNES_FAS *)snes->data; in SNESFASGetLevels()
165 PetscErrorCode SNESFASGetCycleSNES(SNES snes, PetscInt level, SNES *lsnes) in SNESFASGetCycleSNES() argument
171 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASGetCycleSNES()
173 fas = (SNES_FAS *)snes->data; in SNESFASGetCycleSNES()
174 …PetscCheck(level <= fas->levels - 1, PetscObjectComm((PetscObject)snes), PETSC_ERR_ARG_OUTOFRANGE,… in SNESFASGetCycleSNES()
175 …PetscCheck(fas->level == fas->levels - 1, PetscObjectComm((PetscObject)snes), PETSC_ERR_ARG_OUTOFR… in SNESFASGetCycleSNES()
177 *lsnes = snes; in SNESFASGetCycleSNES()
182 …PetscCheck(fas->level == level, PetscObjectComm((PetscObject)snes), PETSC_ERR_PLIB, "SNESFAS level… in SNESFASGetCycleSNES()
203 PetscErrorCode SNESFASSetNumberSmoothUp(SNES snes, PetscInt n) in SNESFASSetNumberSmoothUp() argument
208 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASSetNumberSmoothUp()
209 fas = (SNES_FAS *)snes->data; in SNESFASSetNumberSmoothUp()
211 …if (!fas->smoothu && fas->level != 0) PetscCall(SNESFASCycleCreateSmoother_Private(snes, &fas->smo… in SNESFASSetNumberSmoothUp()
234 PetscErrorCode SNESFASSetNumberSmoothDown(SNES snes, PetscInt n) in SNESFASSetNumberSmoothDown() argument
239 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASSetNumberSmoothDown()
240 fas = (SNES_FAS *)snes->data; in SNESFASSetNumberSmoothDown()
241 if (!fas->smoothd) PetscCall(SNESFASCycleCreateSmoother_Private(snes, &fas->smoothd)); in SNESFASSetNumberSmoothDown()
268 PetscErrorCode SNESFASSetContinuation(SNES snes, PetscBool continuation) in SNESFASSetContinuation() argument
275 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASSetContinuation()
276 fas = (SNES_FAS *)snes->data; in SNESFASSetContinuation()
278 if (!fas->smoothu) PetscCall(SNESFASCycleCreateSmoother_Private(snes, &fas->smoothu)); in SNESFASSetContinuation()
306 PetscErrorCode SNESFASSetCycles(SNES snes, PetscInt cycles) in SNESFASSetCycles() argument
312 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASSetCycles()
313 PetscCall(SNESFASCycleIsFine(snes, &isFine)); in SNESFASSetCycles()
314 fas = (SNES_FAS *)snes->data; in SNESFASSetCycles()
316 …if (!isFine) PetscCall(SNESSetTolerances(snes, snes->abstol, snes->rtol, snes->stol, cycles, snes-… in SNESFASSetCycles()
335 PetscErrorCode SNESFASSetMonitor(SNES snes, PetscViewerAndFormat *vf, PetscBool flg) in SNESFASSetMonitor() argument
343 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASSetMonitor()
344 PetscCall(SNESFASCycleIsFine(snes, &isFine)); in SNESFASSetMonitor()
345 fas = (SNES_FAS *)snes->data; in SNESFASSetMonitor()
349 PetscCall(SNESFASGetCycleSNES(snes, i, &levelsnes)); in SNESFASSetMonitor()
378 PetscErrorCode SNESFASSetLog(SNES snes, PetscBool flg) in SNESFASSetLog() argument
387 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASSetLog()
388 PetscCall(SNESFASCycleIsFine(snes, &isFine)); in SNESFASSetLog()
389 fas = (SNES_FAS *)snes->data; in SNESFASSetLog()
393 PetscCall(SNESFASGetCycleSNES(snes, i, &levelsnes)); in SNESFASSetLog()
397 … PetscCall(PetscLogEventRegister(eventname, ((PetscObject)snes)->classid, &fas->eventsmoothsetup)); in SNESFASSetLog()
399 … PetscCall(PetscLogEventRegister(eventname, ((PetscObject)snes)->classid, &fas->eventsmoothsolve)); in SNESFASSetLog()
401 … PetscCall(PetscLogEventRegister(eventname, ((PetscObject)snes)->classid, &fas->eventresidual)); in SNESFASSetLog()
403 …PetscCall(PetscLogEventRegister(eventname, ((PetscObject)snes)->classid, &fas->eventinterprestrict… in SNESFASSetLog()
420 PetscErrorCode SNESFASCycleCreateSmoother_Private(SNES snes, SNES *smooth) in SNESFASCycleCreateSmoother_Private() argument
428 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASCycleCreateSmoother_Private()
430 fas = (SNES_FAS *)snes->data; in SNESFASCycleCreateSmoother_Private()
433 PetscCall(SNESCreate(PetscObjectComm((PetscObject)snes), &nsmooth)); in SNESFASCycleCreateSmoother_Private()
447 PetscCall(PetscObjectIncrementTabLevel((PetscObject)nsmooth, (PetscObject)snes, 1)); in SNESFASCycleCreateSmoother_Private()
448 PetscCall(PetscObjectCopyFortranFunctionPointers((PetscObject)snes, (PetscObject)nsmooth)); in SNESFASCycleCreateSmoother_Private()
469 PetscErrorCode SNESFASCycleSetCycles(SNES snes, PetscInt cycles) in SNESFASCycleSetCycles() argument
474 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASCycleSetCycles()
475 fas = (SNES_FAS *)snes->data; in SNESFASCycleSetCycles()
477 PetscCall(SNESSetTolerances(snes, snes->abstol, snes->rtol, snes->stol, cycles, snes->max_funcs)); in SNESFASCycleSetCycles()
496 PetscErrorCode SNESFASCycleGetSmoother(SNES snes, SNES *smooth) in SNESFASCycleGetSmoother() argument
501 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASCycleGetSmoother()
503 fas = (SNES_FAS *)snes->data; in SNESFASCycleGetSmoother()
526 PetscErrorCode SNESFASCycleGetSmootherUp(SNES snes, SNES *smoothu) in SNESFASCycleGetSmootherUp() argument
531 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASCycleGetSmootherUp()
533 fas = (SNES_FAS *)snes->data; in SNESFASCycleGetSmootherUp()
554 PetscErrorCode SNESFASCycleGetSmootherDown(SNES snes, SNES *smoothd) in SNESFASCycleGetSmootherDown() argument
559 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASCycleGetSmootherDown()
561 fas = (SNES_FAS *)snes->data; in SNESFASCycleGetSmootherDown()
584 PetscErrorCode SNESFASCycleGetCorrection(SNES snes, SNES *correction) in SNESFASCycleGetCorrection() argument
589 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASCycleGetCorrection()
591 fas = (SNES_FAS *)snes->data; in SNESFASCycleGetCorrection()
611 PetscErrorCode SNESFASCycleGetInterpolation(SNES snes, Mat *mat) in SNESFASCycleGetInterpolation() argument
616 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASCycleGetInterpolation()
618 fas = (SNES_FAS *)snes->data; in SNESFASCycleGetInterpolation()
638 PetscErrorCode SNESFASCycleGetRestriction(SNES snes, Mat *mat) in SNESFASCycleGetRestriction() argument
643 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASCycleGetRestriction()
645 fas = (SNES_FAS *)snes->data; in SNESFASCycleGetRestriction()
665 PetscErrorCode SNESFASCycleGetInjection(SNES snes, Mat *mat) in SNESFASCycleGetInjection() argument
670 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASCycleGetInjection()
672 fas = (SNES_FAS *)snes->data; in SNESFASCycleGetInjection()
692 PetscErrorCode SNESFASCycleGetRScale(SNES snes, Vec *vec) in SNESFASCycleGetRScale() argument
697 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASCycleGetRScale()
699 fas = (SNES_FAS *)snes->data; in SNESFASCycleGetRScale()
719 PetscErrorCode SNESFASCycleIsFine(SNES snes, PetscBool *flg) in SNESFASCycleIsFine() argument
724 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASCycleIsFine()
726 fas = (SNES_FAS *)snes->data; in SNESFASCycleIsFine()
754 PetscErrorCode SNESFASSetInterpolation(SNES snes, PetscInt level, Mat mat) in SNESFASSetInterpolation() argument
760 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASSetInterpolation()
762 PetscCall(SNESFASGetCycleSNES(snes, level, &levelsnes)); in SNESFASSetInterpolation()
785 PetscErrorCode SNESFASGetInterpolation(SNES snes, PetscInt level, Mat *mat) in SNESFASGetInterpolation() argument
791 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASGetInterpolation()
793 PetscCall(SNESFASGetCycleSNES(snes, level, &levelsnes)); in SNESFASGetInterpolation()
822 PetscErrorCode SNESFASSetRestriction(SNES snes, PetscInt level, Mat mat) in SNESFASSetRestriction() argument
828 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASSetRestriction()
830 PetscCall(SNESFASGetCycleSNES(snes, level, &levelsnes)); in SNESFASSetRestriction()
853 PetscErrorCode SNESFASGetRestriction(SNES snes, PetscInt level, Mat *mat) in SNESFASGetRestriction() argument
859 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASGetRestriction()
861 PetscCall(SNESFASGetCycleSNES(snes, level, &levelsnes)); in SNESFASGetRestriction()
884 PetscErrorCode SNESFASSetInjection(SNES snes, PetscInt level, Mat mat) in SNESFASSetInjection() argument
890 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASSetInjection()
892 PetscCall(SNESFASGetCycleSNES(snes, level, &levelsnes)); in SNESFASSetInjection()
916 PetscErrorCode SNESFASGetInjection(SNES snes, PetscInt level, Mat *mat) in SNESFASGetInjection() argument
922 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASGetInjection()
924 PetscCall(SNESFASGetCycleSNES(snes, level, &levelsnes)); in SNESFASGetInjection()
946 PetscErrorCode SNESFASSetRScale(SNES snes, PetscInt level, Vec rscale) in SNESFASSetRScale() argument
952 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASSetRScale()
954 PetscCall(SNESFASGetCycleSNES(snes, level, &levelsnes)); in SNESFASSetRScale()
976 PetscErrorCode SNESFASGetSmoother(SNES snes, PetscInt level, SNES *smooth) in SNESFASGetSmoother() argument
982 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASGetSmoother()
984 PetscCall(SNESFASGetCycleSNES(snes, level, &levelsnes)); in SNESFASGetSmoother()
1005 PetscErrorCode SNESFASGetSmootherDown(SNES snes, PetscInt level, SNES *smooth) in SNESFASGetSmootherDown() argument
1011 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASGetSmootherDown()
1013 PetscCall(SNESFASGetCycleSNES(snes, level, &levelsnes)); in SNESFASGetSmootherDown()
1036 PetscErrorCode SNESFASGetSmootherUp(SNES snes, PetscInt level, SNES *smooth) in SNESFASGetSmootherUp() argument
1042 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASGetSmootherUp()
1044 PetscCall(SNESFASGetCycleSNES(snes, level, &levelsnes)); in SNESFASGetSmootherUp()
1066 PetscErrorCode SNESFASGetCoarseSolve(SNES snes, SNES *coarse) in SNESFASGetCoarseSolve() argument
1072 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASGetCoarseSolve()
1074 PetscCall(SNESFASGetCycleSNES(snes, 0, &levelsnes)); in SNESFASGetCoarseSolve()
1098 PetscErrorCode SNESFASFullSetDownSweep(SNES snes, PetscBool swp) in SNESFASFullSetDownSweep() argument
1103 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASFullSetDownSweep()
1104 fas = (SNES_FAS *)snes->data; in SNESFASFullSetDownSweep()
1130 PetscErrorCode SNESFASFullSetTotal(SNES snes, PetscBool total) in SNESFASFullSetTotal() argument
1135 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASFullSetTotal()
1136 fas = (SNES_FAS *)snes->data; in SNESFASFullSetTotal()
1157 PetscErrorCode SNESFASFullGetTotal(SNES snes, PetscBool *total) in SNESFASFullGetTotal() argument
1162 PetscValidHeaderSpecificType(snes, SNES_CLASSID, 1, SNESFAS); in SNESFASFullGetTotal()
1163 fas = (SNES_FAS *)snes->data; in SNESFASFullGetTotal()