ThunderEgg  1.0.0
ThunderEgg::PETSc::KSPSolver< D > Class Template Reference

Wraps a PETSc KSP solver for use use as a Solver. More...

#include <KSPSolver.h>

Inheritance diagram for ThunderEgg::PETSc::KSPSolver< D >:
Collaboration diagram for ThunderEgg::PETSc::KSPSolver< D >:

Public Member Functions

 KSPSolver ()
 Construct a new MatWrapper object. More...
 
KSPSolver< D > * clone () const override
 Clone this solver. More...
 
void setType (KSPType new_type)
 
int solve (const Operator< D > &A, Vector< D > &x, const Vector< D > &b, const Operator< D > *Mr=nullptr, bool output=false, std::ostream &os=std::cout) const override
 Perform an iterative solve. More...
 
- Public Member Functions inherited from ThunderEgg::Iterative::Solver< D >
virtual ~Solver ()
 Destroy the Solver object.
 

Detailed Description

template<int D>
class ThunderEgg::PETSc::KSPSolver< D >

Wraps a PETSc KSP solver for use use as a Solver.

Constructor & Destructor Documentation

◆ KSPSolver()

template<int D>
ThunderEgg::PETSc::KSPSolver< D >::KSPSolver ( )
inlineexplicit

Construct a new MatWrapper object.

This object will not deallocate the PETSc Mat, you are responsible for deallocating it.

Parameters
A_inthe PETSc Mat to wrap

Member Function Documentation

◆ clone()

template<int D>
KSPSolver<D>* ThunderEgg::PETSc::KSPSolver< D >::clone ( ) const
inlineoverridevirtual

Clone this solver.

Returns
Solver* a newly allocated copy of this solver

Implements ThunderEgg::Iterative::Solver< D >.

◆ solve()

template<int D>
int ThunderEgg::PETSc::KSPSolver< D >::solve ( const Operator< D > &  A,
Vector< D > &  x,
const Vector< D > &  b,
const Operator< D > *  Mr = nullptr,
bool  output = false,
std::ostream &  os = std::cout 
) const
inlineoverridevirtual

Perform an iterative solve.

Parameters
Athe matrix
xthe initial LHS guess.
bthe RHS vector.
Mrthe right preconditioner. Set to nullptr if there is no right preconditioner.
outputprint output to the provided stream
osthe stream to output to
Returns
the number of iterations

Implements ThunderEgg::Iterative::Solver< D >.


The documentation for this class was generated from the following file: