1#ifndef included_AMP_BiCGSTABSolver
2#define included_AMP_BiCGSTABSolver
4#include "AMP/solvers/SolverStrategy.h"
5#include "AMP/solvers/SolverStrategyParameters.h"
6#include "AMP/utils/AMP_MPI.h"
20template<
typename T =
double>
53 static std::unique_ptr<SolverStrategy>
56 return std::make_unique<BiCGSTABSolver<T>>( params );
64 std::string
type()
const override {
return "BiCGSTABSolver"; }
71 void apply( std::shared_ptr<const AMP::LinearAlgebra::Vector> f,
72 std::shared_ptr<AMP::LinearAlgebra::Vector>
u )
override;
78 void initialize( std::shared_ptr<const SolverStrategyParameters> params )
override;
96 std::shared_ptr<AMP::LinearAlgebra::Vector>
d_r;
97 std::shared_ptr<AMP::LinearAlgebra::Vector>
d_r_tilde;
98 std::shared_ptr<AMP::LinearAlgebra::Vector>
d_p;
99 std::shared_ptr<AMP::LinearAlgebra::Vector>
d_p_hat;
100 std::shared_ptr<AMP::LinearAlgebra::Vector>
d_s;
101 std::shared_ptr<AMP::LinearAlgebra::Vector>
d_s_hat;
102 std::shared_ptr<AMP::LinearAlgebra::Vector>
d_t;
103 std::shared_ptr<AMP::LinearAlgebra::Vector>
d_v;
BiCGSTABSolver(std::shared_ptr< SolverStrategyParameters > params)
std::shared_ptr< AMP::LinearAlgebra::Vector > d_s
std::shared_ptr< AMP::LinearAlgebra::Vector > d_r
scratch vectors required for BiCGSTAB
void getFromInput(std::shared_ptr< AMP::Database > db)
std::shared_ptr< AMP::LinearAlgebra::Vector > d_v
void initialize(std::shared_ptr< const SolverStrategyParameters > params) override
void apply(std::shared_ptr< const AMP::LinearAlgebra::Vector > f, std::shared_ptr< AMP::LinearAlgebra::Vector > u) override
std::shared_ptr< AMP::LinearAlgebra::Vector > d_p
std::shared_ptr< AMP::LinearAlgebra::Vector > d_p_hat
std::shared_ptr< AMP::LinearAlgebra::Vector > d_s_hat
void registerOperator(std::shared_ptr< AMP::Operator::Operator > op) override
std::shared_ptr< AMP::LinearAlgebra::Vector > d_r_tilde
std::shared_ptr< AMP::LinearAlgebra::Vector > d_t
bool d_bUsesPreconditioner
number of times the solver is restarted
void allocateScratchVectors(std::shared_ptr< const AMP::LinearAlgebra::Vector > u)
std::string type() const override
Return the name of the solver.
static std::unique_ptr< SolverStrategy > createSolver(std::shared_ptr< SolverStrategyParameters > params)
virtual ~BiCGSTABSolver()
std::shared_ptr< AMP::Solver::SolverStrategy > shared_ptr