14 #if !defined(KRATOS_BICGSTAB_SOLVER_H_INCLUDED )
15 #define KRATOS_BICGSTAB_SOLVER_H_INCLUDED
51 template<
class TSparseSpaceType,
class TDenseSpaceType,
52 class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>,
53 class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType> >
80 BICGSTABSolver(
double NewTolerance,
unsigned int NewMaxIterationsNumber) :
BaseType(NewTolerance, NewMaxIterationsNumber) {}
82 BICGSTABSolver(
double NewMaxTolerance,
unsigned int NewMaxIterationsNumber,
typename TPreconditionerType::Pointer pNewPreconditioner) :
83 BaseType(NewMaxTolerance, NewMaxIterationsNumber, pNewPreconditioner) {}
86 BaseType(settings, pNewPreconditioner) {}
91 if(settings.
Has(
"preconditioner_type"))
136 bool is_solved = IterativeSolve(rA,rX,rB);
157 bool is_solved =
true;
162 TDenseSpaceType::GetColumn(
i,rX,
x);
163 TDenseSpaceType::GetColumn(
i,rB,
b);
168 is_solved &= IterativeSolve(rA,
x,
b);
193 std::string
Info()
const override
195 std::stringstream buffer;
203 OStream <<
"Biconjugate gradient stabilized linear solver with ";
319 if (fabs(
alpha) <= 1.0e-40)
330 if(fabs(omega) <= 1.0e-40)
342 if((fabs(roh0) <= 1.0e-40) || (fabs(omega) <= 1.0e-40))
345 beta = (roh1 *
alpha) / (roh0 * omega);
392 template<
class TSparseSpaceType,
class TDenseSpaceType,
393 class TPreconditionerType,
394 class TReordererType>
397 TPreconditionerType, TReordererType>& rThis)
403 template<
class TSparseSpaceType,
class TDenseSpaceType,
404 class TPreconditionerType,
405 class TReordererType>
408 TPreconditionerType, TReordererType>& rThis)
410 rThis.PrintInfo(OStream);
411 OStream << std::endl;
412 rThis.PrintData(OStream);
Short class definition.
Definition: bicgstab_solver.h:55
void PrintInfo(std::ostream &OStream) const override
Print information about this object.
Definition: bicgstab_solver.h:201
TSparseSpaceType::MatrixType SparseMatrixType
Definition: bicgstab_solver.h:65
BICGSTABSolver(double NewTolerance)
Definition: bicgstab_solver.h:78
BICGSTABSolver(const BICGSTABSolver &Other)
Copy constructor.
Definition: bicgstab_solver.h:96
void PrintData(std::ostream &OStream) const override
Print object's data.
Definition: bicgstab_solver.h:208
BICGSTABSolver & operator=(const BICGSTABSolver &Other)
Assignment operator.
Definition: bicgstab_solver.h:107
BICGSTABSolver(Parameters settings, typename TPreconditionerType::Pointer pNewPreconditioner)
Definition: bicgstab_solver.h:85
KRATOS_CLASS_POINTER_DEFINITION(BICGSTABSolver)
Counted pointer of BICGSTABSolver.
TSparseSpaceType::VectorType VectorType
Definition: bicgstab_solver.h:67
IterativeSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType > BaseType
Definition: bicgstab_solver.h:63
~BICGSTABSolver() override
Destructor.
Definition: bicgstab_solver.h:99
BICGSTABSolver(double NewMaxTolerance, unsigned int NewMaxIterationsNumber, typename TPreconditionerType::Pointer pNewPreconditioner)
Definition: bicgstab_solver.h:82
BICGSTABSolver(double NewTolerance, unsigned int NewMaxIterationsNumber)
Definition: bicgstab_solver.h:80
bool Solve(SparseMatrixType &rA, VectorType &rX, VectorType &rB) override
Definition: bicgstab_solver.h:125
BICGSTABSolver()
Default constructor.
Definition: bicgstab_solver.h:76
bool Solve(SparseMatrixType &rA, DenseMatrixType &rX, DenseMatrixType &rB) override
Definition: bicgstab_solver.h:151
std::string Info() const override
Return information about this object.
Definition: bicgstab_solver.h:193
BICGSTABSolver(Parameters settings)
Definition: bicgstab_solver.h:88
TDenseSpaceType::MatrixType DenseMatrixType
Definition: bicgstab_solver.h:69
Base class for all the iterative solvers in Kratos.
Definition: iterative_solver.h:68
IndexType mIterationsNumber
Definition: iterative_solver.h:403
virtual bool IterationNeeded()
Definition: iterative_solver.h:331
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: iterative_solver.h:360
double mResidualNorm
Definition: iterative_solver.h:399
void PreconditionedMult(SparseMatrixType &rA, VectorType &rX, VectorType &rY)
Definition: iterative_solver.h:416
double mBNorm
Definition: iterative_solver.h:405
IterativeSolver & operator=(const IterativeSolver &Other)
Assignment operator.
Definition: iterative_solver.h:176
virtual void SetPreconditioner(typename TPreconditionerType::Pointer pNewPreconditioner)
Definition: iterative_solver.h:270
virtual TPreconditionerType::Pointer GetPreconditioner(void)
Definition: iterative_solver.h:260
virtual bool IsConverged()
Definition: iterative_solver.h:336
virtual bool IsNotConsistent(SparseMatrixType &rA, VectorType &rX, VectorType &rB)
This method checks if the dimensions of the system of equations are not consistent.
Definition: linear_solver.h:346
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
bool Has(const std::string &rEntry) const
This method checks if the Parameter contains a certain entry.
Definition: kratos_parameters.cpp:520
Here we add the functions needed for the registration of preconditioners.
Definition: preconditioner_factory.h:62
Modeler::Pointer Create(const std::string &ModelerName, Model &rModel, const Parameters ModelParameters)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:30
TSpaceType::IndexType Size1(TSpaceType &dummy, typename TSpaceType::MatrixType const &rM)
Definition: add_strategies_to_python.cpp:117
TSpaceType::IndexType Size2(TSpaceType &dummy, typename TSpaceType::MatrixType const &rM)
Definition: add_strategies_to_python.cpp:123
void ScaleAndAdd(TSpaceType &dummy, const double A, const typename TSpaceType::VectorType &rX, const double B, typename TSpaceType::VectorType &rY)
Definition: add_strategies_to_python.cpp:91
double TwoNorm(SparseSpaceType &dummy, SparseSpaceType::VectorType &x)
Definition: add_strategies_to_python.cpp:164
TSpaceType::IndexType Size(TSpaceType &dummy, typename TSpaceType::VectorType const &rV)
Definition: add_strategies_to_python.cpp:111
double Dot(SparseSpaceType &dummy, SparseSpaceType::VectorType &rX, SparseSpaceType::VectorType &rY)
Definition: add_strategies_to_python.cpp:85
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
alpha
Definition: generate_convection_diffusion_explicit_element.py:113
q
Definition: generate_convection_diffusion_explicit_element.py:109
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
p
Definition: sensitivityMatrix.py:52
x
Definition: sensitivityMatrix.py:49
integer i
Definition: TensorModule.f:17