PetIBM 0.5.4
Toolbox and applications of the immersed-boundary method for distributed-memory architectures
linsolveramgx.h
Go to the documentation of this file.
1
8#pragma once
9
10#include <AmgXSolver.hpp>
11
12#include <petibm/linsolver.h>
13
14namespace petibm
15{
16namespace linsolver
17{
29{
30public:
32 LinSolverAmgX(const std::string &solverName, const std::string &file);
33
35 virtual ~LinSolverAmgX();
36
38 virtual PetscErrorCode destroy();
39
41 virtual PetscErrorCode setMatrix(const Mat &A);
42
44 virtual PetscErrorCode solve(Vec &x, Vec &b);
45
47 virtual PetscErrorCode getIters(PetscInt &iters);
48
50 virtual PetscErrorCode getResidual(PetscReal &res);
51
52protected:
54 AmgXSolver amgx;
55
57 virtual PetscErrorCode init();
58
59}; // LinSolverAmgX
60
61} // namespace linsolver
62
63} // end of namespace petibm
Iterative solver using wrapper of AmgX.
Definition: linsolveramgx.h:29
virtual PetscErrorCode setMatrix(const Mat &A)
Set the coefficient matrix of the linear system.
virtual ~LinSolverAmgX()
Default destructor.
LinSolverAmgX(const std::string &solverName, const std::string &file)
Constructor.
virtual PetscErrorCode solve(Vec &x, Vec &b)
Solve the linear system.
virtual PetscErrorCode destroy()
Manually destroy the data in the current instance.
virtual PetscErrorCode init()
Private initialization function.
virtual PetscErrorCode getIters(PetscInt &iters)
Get the number of iterations of the solver.
AmgXSolver amgx
the underlying AmgX wrapper solver.
Definition: linsolveramgx.h:54
virtual PetscErrorCode getResidual(PetscReal &res)
Get the final residual of the solver.
The abstract (base) class for different iterative solvers.
Definition: linsolver.h:60
Def. of LinSolverBase, LinSolver, and factory function.
A toolbox for building flow solvers.
Definition: bodypack.h:52