Advanced Multi-Physics (AMP)
On-Line Documentation
BiCGSTABSolver.h
Go to the documentation of this file.
1#ifndef included_AMP_BiCGSTABSolver
2#define included_AMP_BiCGSTABSolver
3
4#include "AMP/solvers/SolverStrategy.h"
5#include "AMP/solvers/SolverStrategyParameters.h"
6#include "AMP/utils/AMP_MPI.h"
7
8
9namespace AMP::Solver {
10
11
20template<typename T = double>
22{
23public:
28
46 explicit BiCGSTABSolver( std::shared_ptr<SolverStrategyParameters> params );
47
53 static std::unique_ptr<SolverStrategy>
54 createSolver( std::shared_ptr<SolverStrategyParameters> params )
55 {
56 return std::make_unique<BiCGSTABSolver<T>>( params );
57 }
58
62 virtual ~BiCGSTABSolver();
63
64 std::string type() const override { return "BiCGSTABSolver"; }
65
71 void apply( std::shared_ptr<const AMP::LinearAlgebra::Vector> f,
72 std::shared_ptr<AMP::LinearAlgebra::Vector> u ) override;
73
78 void initialize( std::shared_ptr<const SolverStrategyParameters> params ) override;
79
84 void registerOperator( std::shared_ptr<AMP::Operator::Operator> op ) override;
85
86protected:
87 void getFromInput( std::shared_ptr<AMP::Database> db );
88 void allocateScratchVectors( std::shared_ptr<const AMP::LinearAlgebra::Vector> u );
89
90private:
91 int d_restarts = 0;
92
94
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;
104};
105} // namespace AMP::Solver
106
107#endif
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)
std::shared_ptr< AMP::Solver::SolverStrategy > shared_ptr



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:41.
Comments on this page