Lines Matching refs:ngmres

6   SNES_NGMRES *ngmres = (SNES_NGMRES *)snes->data;  in SNESNGMRESGetAdditiveLineSearch_Private()  local
9 if (!ngmres->additive_linesearch) { in SNESNGMRESGetAdditiveLineSearch_Private()
12 … PetscCall(SNESLineSearchCreate(PetscObjectComm((PetscObject)snes), &ngmres->additive_linesearch)); in SNESNGMRESGetAdditiveLineSearch_Private()
13 PetscCall(SNESLineSearchSetSNES(ngmres->additive_linesearch, snes)); in SNESNGMRESGetAdditiveLineSearch_Private()
14 PetscCall(SNESLineSearchSetType(ngmres->additive_linesearch, SNESLINESEARCHSECANT)); in SNESNGMRESGetAdditiveLineSearch_Private()
15 …PetscCall(SNESLineSearchAppendOptionsPrefix(ngmres->additive_linesearch, "snes_ngmres_additive_")); in SNESNGMRESGetAdditiveLineSearch_Private()
16 PetscCall(SNESLineSearchAppendOptionsPrefix(ngmres->additive_linesearch, optionsprefix)); in SNESNGMRESGetAdditiveLineSearch_Private()
17 …PetscCall(PetscObjectIncrementTabLevel((PetscObject)ngmres->additive_linesearch, (PetscObject)snes… in SNESNGMRESGetAdditiveLineSearch_Private()
19 *linesearch = ngmres->additive_linesearch; in SNESNGMRESGetAdditiveLineSearch_Private()
25 SNES_NGMRES *ngmres = (SNES_NGMRES *)snes->data; in SNESNGMRESUpdateSubspace_Private() local
26 Vec *Fdot = ngmres->Fdot; in SNESNGMRESUpdateSubspace_Private()
27 Vec *Xdot = ngmres->Xdot; in SNESNGMRESUpdateSubspace_Private()
34 ngmres->fnorms[ivec] = fnorm; in SNESNGMRESUpdateSubspace_Private()
40 SNES_NGMRES *ngmres = (SNES_NGMRES *)snes->data; in SNESNGMRESFormCombinedSolution_Private() local
42 Vec *Fdot = ngmres->Fdot; in SNESNGMRESFormCombinedSolution_Private()
43 Vec *Xdot = ngmres->Xdot; in SNESNGMRESFormCombinedSolution_Private()
44 PetscScalar *beta = ngmres->beta; in SNESNGMRESFormCombinedSolution_Private()
45 PetscScalar *xi = ngmres->xi; in SNESNGMRESFormCombinedSolution_Private()
65 Q(0, 0) = ngmres->fnorms[ivec] * ngmres->fnorms[ivec]; in SNESNGMRESFormCombinedSolution_Private()
79 PetscCall(PetscBLASIntCast(l, &ngmres->m)); in SNESNGMRESFormCombinedSolution_Private()
80 PetscCall(PetscBLASIntCast(l, &ngmres->n)); in SNESNGMRESFormCombinedSolution_Private()
81 ngmres->info = 0; in SNESNGMRESFormCombinedSolution_Private()
82 ngmres->rcond = -1.; in SNESNGMRESFormCombinedSolution_Private()
85ngmres->m, &ngmres->n, &ngmres->nrhs, ngmres->h, &ngmres->lda, ngmres->beta, &ngmres->ldb, ngmres-… in SNESNGMRESFormCombinedSolution_Private()
87ngmres->m, &ngmres->n, &ngmres->nrhs, ngmres->h, &ngmres->lda, ngmres->beta, &ngmres->ldb, ngmres-… in SNESNGMRESFormCombinedSolution_Private()
90 …PetscCheck(ngmres->info >= 0, PetscObjectComm((PetscObject)snes), PETSC_ERR_LIB, "Bad argument to … in SNESNGMRESFormCombinedSolution_Private()
91 …PetscCheck(ngmres->info <= 0, PetscObjectComm((PetscObject)snes), PETSC_ERR_LIB, "SVD failed to co… in SNESNGMRESFormCombinedSolution_Private()
102 if (!ngmres->approxfunc) { in SNESNGMRESFormCombinedSolution_Private()
117 SNES_NGMRES *ngmres = (SNES_NGMRES *)snes->data; in SNESNGMRESNorms_Private() local
119 Vec *Xdot = ngmres->Xdot; in SNESNGMRESNorms_Private()
142 PetscCall(VecNormBegin(D, NORM_2, &ngmres->xnorms[i])); in SNESNGMRESNorms_Private()
154 PetscCall(VecNormEnd(D, NORM_2, &ngmres->xnorms[i])); in SNESNGMRESNorms_Private()
155 dcurnorm = ngmres->xnorms[i]; in SNESNGMRESNorms_Private()
165 SNES_NGMRES *ngmres = (SNES_NGMRES *)snes->data; in SNESNGMRESSelect_Private() local
170 if (ngmres->select_type == SNES_NGMRES_SELECT_LINESEARCH) { in SNESNGMRESSelect_Private()
172 …if (ngmres->monitor) PetscCall(PetscViewerASCIIPrintf(ngmres->monitor, "obj(X_A) = %e, ||F_A||_2 =… in SNESNGMRESSelect_Private()
178 …PetscCall(VecDotRealPart(FM, Y, &ngmres->descent_ls_test)); /* this is actually < F(XM), XM - XA >… in SNESNGMRESSelect_Private()
180 if (ngmres->descent_ls_test < 0) { /* XA - XM is not a descent direction, select XM */ in SNESNGMRESSelect_Private()
188 PetscCall(SNESNGMRESGetAdditiveLineSearch_Private(snes, &ngmres->additive_linesearch)); in SNESNGMRESSelect_Private()
189 PetscCall(SNESLineSearchApply(ngmres->additive_linesearch, X, F, fnorm, Y)); in SNESNGMRESSelect_Private()
190 PetscCall(SNESLineSearchGetReason(ngmres->additive_linesearch, &lsreason)); in SNESNGMRESSelect_Private()
206 PetscCall(SNESLineSearchGetNorms(ngmres->additive_linesearch, xnorm, fnorm, ynorm)); in SNESNGMRESSelect_Private()
208 if (ngmres->monitor) { in SNESNGMRESSelect_Private()
214 …PetscCall(PetscViewerASCIIPrintf(ngmres->monitor, "Additive solution: objective = %e\n", (double)o… in SNESNGMRESSelect_Private()
216 } else if (ngmres->select_type == SNES_NGMRES_SELECT_DIFFERENCE) { in SNESNGMRESSelect_Private()
221 …A = (PetscBool)(/* A */ (objA < ngmres->gammaA * objmin) && /* B */ (ngmres->epsilonB * dnorm < dm… in SNESNGMRESSelect_Private()
224 …if (ngmres->monitor) PetscCall(PetscViewerASCIIPrintf(ngmres->monitor, "picked X_A, obj(X_A) = %e,… in SNESNGMRESSelect_Private()
232 …if (ngmres->monitor) PetscCall(PetscViewerASCIIPrintf(ngmres->monitor, "picked X_M, obj(X_A) = %e,… in SNESNGMRESSelect_Private()
252 SNES_NGMRES *ngmres = (SNES_NGMRES *)snes->data; in SNESNGMRESSelectRestart_Private() local
256 if (ngmres->select_type == SNES_NGMRES_SELECT_LINESEARCH) { in SNESNGMRESSelectRestart_Private()
257 if (ngmres->descent_ls_test < 0) { /* XA - XM is not a descent direction */ in SNESNGMRESSelectRestart_Private()
258 …if (ngmres->monitor) PetscCall(PetscViewerASCIIPrintf(ngmres->monitor, "ascent restart: %e > 0\n",… in SNESNGMRESSelectRestart_Private()
261 } else if (ngmres->select_type == SNES_NGMRES_SELECT_DIFFERENCE) { in SNESNGMRESSelectRestart_Private()
263 if (ngmres->epsilonB * dnorm > dminnorm && objA > ngmres->deltaB * objmin && l > 0) { in SNESNGMRESSelectRestart_Private()
264 …if (ngmres->monitor) PetscCall(PetscViewerASCIIPrintf(ngmres->monitor, "difference restart: %e > %… in SNESNGMRESSelectRestart_Private()
268 if (objA > ngmres->gammaC * objmin) { in SNESNGMRESSelectRestart_Private()
269 …if (ngmres->monitor) PetscCall(PetscViewerASCIIPrintf(ngmres->monitor, "residual restart: %e > %e\… in SNESNGMRESSelectRestart_Private()
274 if (ngmres->restart_fm_rise && objM > obj) { in SNESNGMRESSelectRestart_Private()
275 …if (ngmres->monitor) PetscCall(PetscViewerASCIIPrintf(ngmres->monitor, "F_M rise restart: %e > %e\… in SNESNGMRESSelectRestart_Private()