36 LinSolverKSP(
const std::string &solverName,
const std::string &file);
42 virtual PetscErrorCode
destroy();
45 virtual PetscErrorCode
setMatrix(
const Mat &A);
48 virtual PetscErrorCode
solve(Vec &
x, Vec &b);
51 virtual PetscErrorCode
getIters(PetscInt &iters);
61 virtual PetscErrorCode
init();
The abstract (base) class for different iterative solvers.
Iterative solver using PETSc KSP.
KSP ksp
the underlying KSP solver
virtual PetscErrorCode solve(Vec &x, Vec &b)
Solve the linear system.
virtual PetscErrorCode init()
Private initialization function.
virtual PetscErrorCode setMatrix(const Mat &A)
Set the coefficient matrix of the linear system.
virtual PetscErrorCode destroy()
Manually destroy the data in the current instance.
virtual ~LinSolverKSP()
Default destructor.
virtual PetscErrorCode getResidual(PetscReal &res)
Get the final residual of the solver.
LinSolverKSP(const std::string &solverName, const std::string &file)
Constructor.
virtual PetscErrorCode getIters(PetscInt &iters)
Get the number of iterations of the solver.
Def. of LinSolverBase, LinSolver, and factory function.
A toolbox for building flow solvers.