de.jtem.jpetsc
Class KSP

java.lang.Object
  extended by de.jtem.jpetsc.PrimitivNative
      extended by de.jtem.jpetsc.Native
          extended by de.jtem.jpetsc.KSP

public class KSP
extends Native


Nested Class Summary
static class KSP.ComputeEigenvaluesExplicitlyResult
          Result class for computeEigenvaluesExplicitly(int)
static class KSP.ComputeEigenvaluesResult
          Result class for computeEigenvalues(int)
static class KSP.ComputeExtremeSingularValuesResult
          Result class for computeExtremeSingularValues()
static class KSP.GetOperatorsResult
          Result class for getOperators()
static class KSP.GetOperatorsSetResult
          Result class for getOperatorsSet()
static class KSP.GetTolerancesResult
          Result class for getTolerances()
 
Field Summary
 
Fields inherited from class de.jtem.jpetsc.PrimitivNative
destroyNative
 
Constructor Summary
KSP()
           
 
Method Summary
 void appendOptionsPrefix(java.lang.String prefix)
          Appends to the prefix used for searching for all
KSP options in the database.
 void bCGSLSetEll(int ell)
          Sets the number of search directions in BiCGStab(L).
 void bCGSLSetPol(boolean uMROR)
          Sets the type of polynomial part will
be used in the BiCGSTab(L) solver.
 void bCGSLSetXRes(double delta)
          Sets the parameter governing when
exact residuals will be used instead of computed residuals.
 Vec buildResidual(Vec t, Vec v)
          Builds the residual in a vector provided.
 void chebychevSetEigenvalues(double emax, double emin)
          Sets estimates for the extreme eigenvalues
of the preconditioned problem.
 KSP.ComputeEigenvaluesResult computeEigenvalues(int n)
          Computes the extreme eigenvalues for the
preconditioned operator.
 KSP.ComputeEigenvaluesExplicitlyResult computeEigenvaluesExplicitly(int n)
          Computes all of the eigenvalues of the
preconditioned operator using LAPACK.
 Mat computeExplicitOperator()
          Computes the explicit preconditioned operator.
 KSP.ComputeExtremeSingularValuesResult computeExtremeSingularValues()
          Computes the extreme singular values
for the preconditioned operator.
static KSP create()
           
static KSP create(int comm)
          Creates the default KSP context.
 void defaultConvergedSetUIRNorm()
          makes the default convergence test use || B*(b - A*(initial guess))||
instead of || B*b ||.
 void defaultConvergedSetUMIRNorm()
          makes the default convergence test use min(|| B*(b - A*(initial guess))||,|| B*b ||)
In the case of right preconditioner or if KSPSetNormType(ksp,KSP_NORM_UNPRECONDIITONED)
is used there is no B in the above formula.
 void destroy()
          Destroys KSP context.
 boolean getComputeEigenvalues()
          Gets the flag indicating that the extreme eigenvalues
values will be calculated via a Lanczos or Arnoldi process as the linear
system is solved.
 boolean getComputeSingularValues()
          Gets the flag indicating whether the extreme singular
values will be calculated via a Lanczos or Arnoldi process as the linear
system is solved.
 KSPConvergedReason getConvergedReason()
          Gets the reason the KSP iteration was stopped.
 boolean getDiagonalScale()
          Checks if KSP solver scales the matrix and
right hand side
Not Collective
 boolean getDiagonalScaleFix()
          Determines if KSP diagonally scales the system
back after solving.
 boolean getInitialGuessKnoll()
          Determines whether the KSP solver is using the Knoll trick (using PCApply(pc,b,...) to compute
the initial guess
Not Collective
 boolean getInitialGuessNonzero()
          Determines whether the KSP solver is using
a zero initial guess.
 int getIterationNumber()
          Gets the current iteration number; if the
KSPSolve() is complete, returns the number of iterations
used.
 KSPNormType getNormType()
          Sets the norm that is used for convergence testing.
 KSP.GetOperatorsResult getOperators()
          Gets the matrix associated with the linear system
and a (possibly) different one associated with the preconditioner.
 KSP.GetOperatorsSetResult getOperatorsSet()
          Determines if the matrix associated with the linear system and
possibly a different one associated with the preconditioner have been set in the KSP.
 double getResidualNorm()
          Gets the last (approximate preconditioned)
residual norm that has been computed.
 KSP.GetTolerancesResult getTolerances()
          Gets the relative, absolute, divergence, and maximum
iteration tolerances used by the default KSP convergence tests.
 java.lang.String getType()
          Gets the KSP type as a string from the KSP object.
 void gLTRGetLambda(double[] lambda)
          Get multiplier on trust-region constraint.
 void gLTRGetMinEig(double[] e_min)
          Get minimum eigenvalue.
 void gLTRGetNormD(double[] norm_d)
          Get norm of the direction.
 void gLTRGetObjFcn(double[] o_fcn)
          Get objective function value.
 void gLTRSetRadius(double radius)
          Sets the radius of the trust region.
 void gMRESClassicalGramSchmidtOrthogonalization(int its)
          This is the basic orthogonalization routine
using classical Gram-Schmidt with possible iterative refinement to improve the stability
 void gMRESModifiedGramSchmidtOrthogonalization(int its)
          This is the basic orthogonalization routine
using modified Gram-Schmidt.
 void gMRESSetHapTol(double tol)
          Sets tolerance for determining happy breakdown in GMRES, FGMRES and LGMRES.
 void gMRESSetPreAllocateVectors()
          Causes GMRES and FGMRES to preallocate all its
needed work vectors at initial setup rather than the default, which
is to allocate them in chunks when needed.
 void gMRESSetRestart(int restart)
          Sets number of iterations at which GMRES, FGMRES and LGMRES restarts.
 void monitorCancel()
          Clears all monitors for a KSP object.
protected  void nativeCreate()
           
 double qCGGetQuadratic()
          Gets the value of the quadratic function, evaluated at the new iterate:
q(s) = g^T * s + 0.5 * s^T * H * s
which satisfies the Euclidian Norm trust region constraint
|| D * s || <= delta,
 double qCGGetTrialStepNorm()
          Gets the norm of a trial step vector.
 void qCGSetTrustRegionRadius(double delta)
          Sets the radius of the trust region.
static void registerDestroy()
          Frees the list of KSP methods that were
registered by KSPRegisterDynamic().
 void richardsonSetScale(double scale)
          Set the damping factor; if this routine is not called, the factor
defaults to 1.0.
 void setComputeEigenvalues(boolean flg)
          Sets a flag so that the extreme eigenvalues
values will be calculated via a Lanczos or Arnoldi process as the linear
system is solved.
 void setComputeSingularValues(boolean flg)
          Sets a flag so that the extreme singular
values will be calculated via a Lanczos or Arnoldi process as the linear
system is solved.
 void setDiagonalScale(boolean scale)
          Tells KSP to symmetrically diagonally scale the system
before solving.
 void setDiagonalScaleFix(boolean fix)
          Tells KSP to diagonally scale the system
back after solving.
 void setFromOptions()
          Sets KSP options from the options database.
 void setInitialGuessKnoll(boolean flg)
          Tells the iterative solver to use PCApply(pc,b,..) to compute the initial guess (The Knoll trick)
 void setInitialGuessNonzero(boolean flg)
          Tells the iterative solver that the
initial guess is nonzero; otherwise KSP assumes the initial guess
is to be zero (and thus zeros it out before solving).
 void setOperators(Mat Amat, Mat Pmat, MatStructure flag)
          Sets the matrix associated with the linear system
and a (possibly) different one associated with the preconditioner.
 void setOptionsPrefix(java.lang.String prefix)
          Sets the prefix used for searching for all
KSP options in the database.
 void setResidualHistory(double[] a, int na, boolean reset)
          Sets the array used to hold the residual history.
 void setTolerances(double rtol, double abstol, double dtol, int maxits)
          Sets the relative, absolute, divergence, and maximum
iteration tolerances used by the default KSP convergence testers.
 void setType(java.lang.String type)
          Builds KSP for a particular solver.
 void setUpOnBlocks()
          Sets up the preconditioner for each block in
the block Jacobi, block Gauss-Seidel, and overlapping Schwarz
methods.
 void solve(Vec b, Vec x)
          Solves linear system.
 void sTCGGetNormD(double[] norm_d)
          Got norm of the direction.
 void sTCGGetObjFcn(double[] o_fcn)
          Get objective function value.
 void sTCGSetRadius(double radius)
          Sets the radius of the trust region.
 void unwindPreconditioner(Vec vsoln, Vec vt1)
          Unwinds the preconditioning in the solution.
 void view()
          Prints the KSP data structure.
 
Methods inherited from class de.jtem.jpetsc.PrimitivNative
finalize, getNativeObjectToString, load, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KSP

public KSP()
Method Detail

nativeCreate

protected void nativeCreate()
Specified by:
nativeCreate in class Native

create

public static KSP create()

qCGSetTrustRegionRadius

public void qCGSetTrustRegionRadius(double delta)
Sets the radius of the trust region.

Parameters:
delta - the trust region radius (Infinity is the default)

qCGGetTrialStepNorm

public double qCGGetTrialStepNorm()
Gets the norm of a trial step vector. The WCG step may be
constrained, so this is not necessarily the length of the ultimate step taken in QCG.

Returns:
the norm

qCGGetQuadratic

public double qCGGetQuadratic()
Gets the value of the quadratic function, evaluated at the new iterate:
q(s) = g^T * s + 0.5 * s^T * H * s
which satisfies the Euclidian Norm trust region constraint
|| D * s || <= delta,

Returns:
the quadratic function evaluated at the new iterate

gMRESClassicalGramSchmidtOrthogonalization

public void gMRESClassicalGramSchmidtOrthogonalization(int its)
This is the basic orthogonalization routine
using classical Gram-Schmidt with possible iterative refinement to improve the stability

Parameters:
its - one less then the current GMRES restart iteration, i.e. the size of the Krylov space

gMRESSetRestart

public void gMRESSetRestart(int restart)
Sets number of iterations at which GMRES, FGMRES and LGMRES restarts.

Parameters:
restart - integer restart value
See Also:
setTolerances(double, double, double, int), #gMRESSetOrthogonalization, gMRESSetPreAllocateVectors()

gMRESSetHapTol

public void gMRESSetHapTol(double tol)
Sets tolerance for determining happy breakdown in GMRES, FGMRES and LGMRES.

Parameters:
tol - the tolerance
See Also:
setTolerances(double, double, double, int)

gMRESModifiedGramSchmidtOrthogonalization

public void gMRESModifiedGramSchmidtOrthogonalization(int its)
This is the basic orthogonalization routine
using modified Gram-Schmidt.

Parameters:
its - one less then the current GMRES restart iteration, i.e. the size of the Krylov space
See Also:
#gMRESSetOrthogonalization, gMRESClassicalGramSchmidtOrthogonalization(int)

gMRESSetPreAllocateVectors

public void gMRESSetPreAllocateVectors()
Causes GMRES and FGMRES to preallocate all its
needed work vectors at initial setup rather than the default, which
is to allocate them in chunks when needed.

See Also:
gMRESSetRestart(int), #gMRESSetOrthogonalization

sTCGSetRadius

public void sTCGSetRadius(double radius)
Sets the radius of the trust region.

Parameters:
radius - the trust region radius (Infinity is the default)

sTCGGetNormD

public void sTCGGetNormD(double[] norm_d)
Got norm of the direction.

Parameters:
norm_d - the norm of the direction

sTCGGetObjFcn

public void sTCGGetObjFcn(double[] o_fcn)
Get objective function value.

Parameters:
o_fcn - the objective function value

gLTRSetRadius

public void gLTRSetRadius(double radius)
Sets the radius of the trust region.

Parameters:
radius - the trust region radius (Infinity is the default)

gLTRGetNormD

public void gLTRGetNormD(double[] norm_d)
Get norm of the direction.

Parameters:
norm_d - the norm of the direction

gLTRGetObjFcn

public void gLTRGetObjFcn(double[] o_fcn)
Get objective function value.

Parameters:
o_fcn - the objective function value

gLTRGetMinEig

public void gLTRGetMinEig(double[] e_min)
Get minimum eigenvalue.

Parameters:
e_min - the minimum eigenvalue

gLTRGetLambda

public void gLTRGetLambda(double[] lambda)
Get multiplier on trust-region constraint.

Parameters:
lambda - the multiplier

chebychevSetEigenvalues

public void chebychevSetEigenvalues(double emax,
                                    double emin)
Sets estimates for the extreme eigenvalues
of the preconditioned problem.

Parameters:
emax - the eigenvalue estimates
emin - the eigenvalue estimates

bCGSLSetXRes

public void bCGSLSetXRes(double delta)
Sets the parameter governing when
exact residuals will be used instead of computed residuals.

Parameters:
delta - computed residuals are used alone when delta is not positive
See Also:
bCGSLSetEll(int), bCGSLSetPol(boolean)

bCGSLSetPol

public void bCGSLSetPol(boolean uMROR)
Sets the type of polynomial part will
be used in the BiCGSTab(L) solver.

Parameters:
uMROR - set to PETSC_TRUE when the polynomial is a convex combination of an MR and an OR step.
See Also:
#@

bCGSLSetEll

public void bCGSLSetEll(int ell)
Sets the number of search directions in BiCGStab(L).

Parameters:
ell - number of search directions
See Also:
#@

richardsonSetScale

public void richardsonSetScale(double scale)
Set the damping factor; if this routine is not called, the factor
defaults to 1.0.

Parameters:
scale - the relaxation factor

computeExplicitOperator

public Mat computeExplicitOperator()
Computes the explicit preconditioned operator.

Returns:
the explict preconditioned operator
See Also:
computeEigenvaluesExplicitly(int)

computeEigenvaluesExplicitly

public KSP.ComputeEigenvaluesExplicitlyResult computeEigenvaluesExplicitly(int n)
Computes all of the eigenvalues of the
preconditioned operator using LAPACK.

Parameters:
n - size of arrays r and c
Returns:
KSP.ComputeEigenvaluesExplicitlyResult
See Also:
computeEigenvalues(int), #monitorSingularValue, computeExtremeSingularValues(), setOperators(de.jtem.jpetsc.Mat, de.jtem.jpetsc.Mat, de.jtem.jpetsc.MatStructure), solve(de.jtem.jpetsc.Vec, de.jtem.jpetsc.Vec)

view

public void view()
Prints the KSP data structure.

See Also:
#PCView, #PetscViewerASCIIOpen

getNormType

public KSPNormType getNormType()
Sets the norm that is used for convergence testing.
Not Collective

Returns:
norm that is used for convergence testing
See Also:
#normType, #setNormType, #skipConverged

setOperators

public void setOperators(Mat Amat,
                         Mat Pmat,
                         MatStructure flag)
Sets the matrix associated with the linear system
and a (possibly) different one associated with the preconditioner.

Parameters:
Amat - the matrix associated with the linear system
Pmat - the matrix to be used in constructing the preconditioner, usually the
same as Amat.
flag - flag indicating information about the preconditioner matrix structure
during successive linear solves. This flag is ignored the first time a
linear system is solved, and thus is irrelevant when solving just one linear
system.
See Also:
solve(de.jtem.jpetsc.Vec, de.jtem.jpetsc.Vec), #getPC, #PCGetOperators, #PCSetOperators, getOperators()

getOperators

public KSP.GetOperatorsResult getOperators()
Gets the matrix associated with the linear system
and a (possibly) different one associated with the preconditioner.

Returns:
KSP.GetOperatorsResult
See Also:
solve(de.jtem.jpetsc.Vec, de.jtem.jpetsc.Vec), #getPC, #PCGetOperators, #PCSetOperators, setOperators(de.jtem.jpetsc.Mat, de.jtem.jpetsc.Mat, de.jtem.jpetsc.MatStructure), getOperatorsSet()

getOperatorsSet

public KSP.GetOperatorsSetResult getOperatorsSet()
Determines if the matrix associated with the linear system and
possibly a different one associated with the preconditioner have been set in the KSP.
Not collective, though the results on all processes should be the same

Returns:
KSP.GetOperatorsSetResult
See Also:
#PCSetOperators, getOperators(), setOperators(de.jtem.jpetsc.Mat, de.jtem.jpetsc.Mat, de.jtem.jpetsc.MatStructure), #PCGetOperators, #PCGetOperatorsSet

create

public static KSP create(int comm)
Creates the default KSP context.

Parameters:
comm - MPI communicator
Returns:
location to put the KSP context
See Also:
#setUp, solve(de.jtem.jpetsc.Vec, de.jtem.jpetsc.Vec), destroy(), KSP()

setType

public void setType(java.lang.String type)
Builds KSP for a particular solver.

Parameters:
type - a known method
See Also:
#PCSetType, #type

registerDestroy

public static void registerDestroy()
Frees the list of KSP methods that were
registered by KSPRegisterDynamic().
Not Collective

See Also:
#registerDynamic, #registerAll

getType

public java.lang.String getType()
Gets the KSP type as a string from the KSP object.
Not Collective

Returns:
name of KSP method
See Also:
setType(java.lang.String)

computeExtremeSingularValues

public KSP.ComputeExtremeSingularValuesResult computeExtremeSingularValues()
Computes the extreme singular values
for the preconditioned operator. Called after or during KSPSolve().
Not Collective

Returns:
KSP.ComputeExtremeSingularValuesResult
See Also:
setComputeSingularValues(boolean), #monitorSingularValue, computeEigenvalues(int)

computeEigenvalues

public KSP.ComputeEigenvaluesResult computeEigenvalues(int n)
Computes the extreme eigenvalues for the
preconditioned operator. Called after or during KSPSolve().
Not Collective

Parameters:
n - size of arrays r and c. The number of eigenvalues computed (neig) will, in
general, be less than this.
Returns:
KSP.ComputeEigenvaluesResult
See Also:
setComputeSingularValues(boolean), #monitorSingularValue, computeExtremeSingularValues()

setUpOnBlocks

public void setUpOnBlocks()
Sets up the preconditioner for each block in
the block Jacobi, block Gauss-Seidel, and overlapping Schwarz
methods.

See Also:
#PCSetUpOnBlocks, #setUp, #PCSetUp

solve

public void solve(Vec b,
                  Vec x)
Solves linear system.

Parameters:
b - the right hand side vector
x - the solution (this may be the same vector as b, then b will be overwritten with answer)
See Also:
create(), #setUp, destroy(), setTolerances(double, double, double, int), #defaultConverged, #solveTranspose, getIterationNumber()

destroy

public void destroy()
Destroys KSP context.

See Also:
create(), #setUp, solve(de.jtem.jpetsc.Vec, de.jtem.jpetsc.Vec)

getTolerances

public KSP.GetTolerancesResult getTolerances()
Gets the relative, absolute, divergence, and maximum
iteration tolerances used by the default KSP convergence tests.
Not Collective

Returns:
KSP.GetTolerancesResult
See Also:
setTolerances(double, double, double, int)

setTolerances

public void setTolerances(double rtol,
                          double abstol,
                          double dtol,
                          int maxits)
Sets the relative, absolute, divergence, and maximum
iteration tolerances used by the default KSP convergence testers.

Parameters:
rtol - the relative convergence tolerance
(relative decrease in the residual norm)
abstol - the absolute convergence tolerance
(absolute size of the residual norm)
dtol - the divergence tolerance
(amount residual can increase before KSPDefaultConverged()
concludes that the method is diverging)
maxits - maximum number of iterations to use
See Also:
getTolerances(), #defaultConverged, #setConvergenceTest

setInitialGuessNonzero

public void setInitialGuessNonzero(boolean flg)
Tells the iterative solver that the
initial guess is nonzero; otherwise KSP assumes the initial guess
is to be zero (and thus zeros it out before solving).

Parameters:
flg - PETSC_TRUE indicates the guess is non-zero, PETSC_FALSE indicates the guess is zero
See Also:
getInitialGuessNonzero(), setInitialGuessKnoll(boolean), getInitialGuessKnoll()

getInitialGuessNonzero

public boolean getInitialGuessNonzero()
Determines whether the KSP solver is using
a zero initial guess.
Not Collective

Returns:
PETSC_TRUE if guess is nonzero, else PETSC_FALSE
See Also:
setInitialGuessNonzero(boolean), setInitialGuessKnoll(boolean), getInitialGuessKnoll()

setInitialGuessKnoll

public void setInitialGuessKnoll(boolean flg)
Tells the iterative solver to use PCApply(pc,b,..) to compute the initial guess (The Knoll trick)

Parameters:
flg - PETSC_TRUE or PETSC_FALSE
See Also:
getInitialGuessKnoll(), setInitialGuessNonzero(boolean), getInitialGuessNonzero()

getInitialGuessKnoll

public boolean getInitialGuessKnoll()
Determines whether the KSP solver is using the Knoll trick (using PCApply(pc,b,...) to compute
the initial guess
Not Collective

Returns:
PETSC_TRUE if using Knoll trick, else PETSC_FALSE
See Also:
setInitialGuessKnoll(boolean), setInitialGuessNonzero(boolean), getInitialGuessNonzero()

getComputeSingularValues

public boolean getComputeSingularValues()
Gets the flag indicating whether the extreme singular
values will be calculated via a Lanczos or Arnoldi process as the linear
system is solved.

Returns:
PETSC_TRUE or PETSC_FALSE
See Also:
computeExtremeSingularValues(), #monitorSingularValue

setComputeSingularValues

public void setComputeSingularValues(boolean flg)
Sets a flag so that the extreme singular
values will be calculated via a Lanczos or Arnoldi process as the linear
system is solved.

Parameters:
flg - PETSC_TRUE or PETSC_FALSE
See Also:
computeExtremeSingularValues(), #monitorSingularValue

getComputeEigenvalues

public boolean getComputeEigenvalues()
Gets the flag indicating that the extreme eigenvalues
values will be calculated via a Lanczos or Arnoldi process as the linear
system is solved.

Returns:
PETSC_TRUE or PETSC_FALSE
See Also:
computeEigenvalues(int), computeEigenvaluesExplicitly(int)

setComputeEigenvalues

public void setComputeEigenvalues(boolean flg)
Sets a flag so that the extreme eigenvalues
values will be calculated via a Lanczos or Arnoldi process as the linear
system is solved.

Parameters:
flg - PETSC_TRUE or PETSC_FALSE
See Also:
computeEigenvalues(int), computeEigenvaluesExplicitly(int)

monitorCancel

public void monitorCancel()
Clears all monitors for a KSP object.

See Also:
#monitorDefault, #monitorLGCreate, #monitorSet

setResidualHistory

public void setResidualHistory(double[] a,
                               int na,
                               boolean reset)
Sets the array used to hold the residual history.
If set, this array will contain the residual norms computed at each
iteration of the solver.
Not Collective

Parameters:
a - array to hold history
na - size of a
reset - PETSC_TRUE indicates the history counter is reset to zero
for each new linear solve
See Also:
#getResidualHistory

buildResidual

public Vec buildResidual(Vec t,
                         Vec v)
Builds the residual in a vector provided.

Parameters:
t -
v -
Returns:
the residual
See Also:
#buildSolution

setDiagonalScale

public void setDiagonalScale(boolean scale)
Tells KSP to symmetrically diagonally scale the system
before solving. This actually CHANGES the matrix (and right hand side).

Parameters:
scale - PETSC_TRUE or PETSC_FALSE
See Also:
getDiagonalScale(), setDiagonalScaleFix(boolean)

getDiagonalScale

public boolean getDiagonalScale()
Checks if KSP solver scales the matrix and
right hand side
Not Collective

Returns:
PETSC_TRUE or PETSC_FALSE
See Also:
setDiagonalScale(boolean), setDiagonalScaleFix(boolean)

setDiagonalScaleFix

public void setDiagonalScaleFix(boolean fix)
Tells KSP to diagonally scale the system
back after solving.

Parameters:
fix - PETSC_TRUE to scale back after the system solve, PETSC_FALSE to not
rescale (default)
See Also:
getDiagonalScale(), setDiagonalScale(boolean), getDiagonalScaleFix()

getDiagonalScaleFix

public boolean getDiagonalScaleFix()
Determines if KSP diagonally scales the system
back after solving.

Returns:
PETSC_TRUE to scale back after the system solve, PETSC_FALSE to not rescale (default)
See Also:
getDiagonalScale(), setDiagonalScale(boolean), setDiagonalScaleFix(boolean)

getResidualNorm

public double getResidualNorm()
Gets the last (approximate preconditioned)
residual norm that has been computed.
Not Collective

Returns:
residual norm
See Also:
buildResidual(de.jtem.jpetsc.Vec, de.jtem.jpetsc.Vec)

getIterationNumber

public int getIterationNumber()
Gets the current iteration number; if the
KSPSolve() is complete, returns the number of iterations
used.
Not Collective

Returns:
number of iterations
See Also:
buildResidual(de.jtem.jpetsc.Vec, de.jtem.jpetsc.Vec), getResidualNorm()

defaultConvergedSetUIRNorm

public void defaultConvergedSetUIRNorm()
makes the default convergence test use || B*(b - A*(initial guess))||
instead of || B*b ||. In the case of right preconditioner or if KSPSetNormType(ksp,KSP_NORM_UNPRECONDIITONED)
is used there is no B in the above formula. UIRNorm is short for Use Initial Residual Norm.

See Also:
#setConvergenceTest, setTolerances(double, double, double, int), #skipConverged, #convergedReason, getConvergedReason(), defaultConvergedSetUMIRNorm()

defaultConvergedSetUMIRNorm

public void defaultConvergedSetUMIRNorm()
makes the default convergence test use min(|| B*(b - A*(initial guess))||,|| B*b ||)
In the case of right preconditioner or if KSPSetNormType(ksp,KSP_NORM_UNPRECONDIITONED)
is used there is no B in the above formula. UMIRNorm is short for Use Minimum Initial Residual Norm.

See Also:
#setConvergenceTest, setTolerances(double, double, double, int), #skipConverged, #convergedReason, getConvergedReason(), defaultConvergedSetUIRNorm()

getConvergedReason

public KSPConvergedReason getConvergedReason()
Gets the reason the KSP iteration was stopped.
Not Collective

Returns:
negative value indicates diverged, positive value converged, see KSPConvergedReason
See Also:
#setConvergenceTest, #defaultConverged, setTolerances(double, double, double, int), #convergedReason

unwindPreconditioner

public void unwindPreconditioner(Vec vsoln,
                                 Vec vt1)
Unwinds the preconditioning in the solution. That is,
takes solution to the preconditioned problem and gets the solution to the
original problem from it.

Parameters:
vsoln - solution vector
vt1 - temporary work vector
See Also:
#setPreconditionerSide

setOptionsPrefix

public void setOptionsPrefix(java.lang.String prefix)
Sets the prefix used for searching for all
KSP options in the database.

Parameters:
prefix - the prefix string to prepend to all KSP option requests
See Also:
appendOptionsPrefix(java.lang.String), #getOptionsPrefix

appendOptionsPrefix

public void appendOptionsPrefix(java.lang.String prefix)
Appends to the prefix used for searching for all
KSP options in the database.

Parameters:
prefix - the prefix string to prepend to all KSP option requests
See Also:
setOptionsPrefix(java.lang.String), #getOptionsPrefix

setFromOptions

public void setFromOptions()
Sets KSP options from the options database.
This routine must be called before KSPSetUp() if the user is to be
allowed to set the Krylov type.