15 #if !defined(KRATOS_TFQMR_SOLVER_H_INCLUDED )
16 #define KRATOS_TFQMR_SOLVER_H_INCLUDED
30 template<
class TSparseSpaceType,
31 class TDenseSpaceType,
32 class TPreconditionerType = Preconditioner<TSparseSpaceType, TDenseSpaceType>,
33 class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType> >
65 if(settings.
Has(
"preconditioner_type"))
72 unsigned int NewMaxIterationsNumber) :
BaseType(NewTolerance, NewMaxIterationsNumber) {}
76 unsigned int NewMaxIterationsNumber,
77 typename TPreconditionerType::Pointer pNewPreconditioner) :
78 BaseType(NewMaxTolerance, NewMaxIterationsNumber, pNewPreconditioner) {}
109 bool is_solved = IterativeSolve(rA,rX,rB);
136 bool is_solved =
true;
141 TDenseSpaceType::GetColumn(
i,rX,
x);
142 TDenseSpaceType::GetColumn(
i,rB,
b);
148 is_solved &= IterativeSolve(rA,
x,
b);
164 std::string
Info()
const override
166 std::stringstream buffer;
174 OStream <<
"Tranpose-free QMR linear solver with ";
212 for(
typename VectorType::iterator ity2 = y2.begin(); ity2 != y2.end(); ity2++) *ity2 = 0.00;
216 for(
typename VectorType::iterator itd =
d.begin(); itd !=
d.end(); itd++) *itd = 0.00;
225 for(
typename VectorType::iterator itu2 =
u2.begin(); itu2 !=
u2.end(); itu2++) *itu2 = 0.00;
254 if (
sigma == 0.00)
break;
274 c = 1.00/sqrt(1.00+theta*theta);
309 c = 1.00/sqrt(1+theta*theta);
328 if (
rho == 0.00)
break;
359 std::cout<<std::endl;
376 template<
class TSparseSpaceType,
377 class TDenseSpaceType,
378 class TPreconditionerType,
379 class TReordererType>
383 TReordererType>& rThis)
390 template<
class TSparseSpaceType,
391 class TDenseSpaceType,
392 class TPreconditionerType,
393 class TReordererType>
397 TReordererType>& rThis)
399 rThis.PrintInfo(OStream);
400 OStream << std::endl;
401 rThis.PrintData(OStream);
Base class for all the iterative solvers in Kratos.
Definition: iterative_solver.h:68
IndexType mIterationsNumber
Definition: iterative_solver.h:403
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
virtual IndexType GetMaxIterationsNumber()
Definition: iterative_solver.h:290
virtual void SetPreconditioner(typename TPreconditionerType::Pointer pNewPreconditioner)
Definition: iterative_solver.h:270
double GetTolerance() override
This method allows to get the tolerance in the linear solver.
Definition: iterative_solver.h:310
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
Definition: tfqmr_solver.h:38
IterativeSolver< TSparseSpaceType, TDenseSpaceType, TPreconditionerType, TReordererType > BaseType
Definition: tfqmr_solver.h:45
void PrintData(std::ostream &OStream) const override
Print object's data.
Definition: tfqmr_solver.h:180
bool Solve(SparseMatrixType &rA, DenseMatrixType &rX, DenseMatrixType &rB) override
Definition: tfqmr_solver.h:128
TFQMRSolver(Parameters settings, typename TPreconditionerType::Pointer pNewPreconditioner)
Definition: tfqmr_solver.h:68
KRATOS_CLASS_POINTER_DEFINITION(TFQMRSolver)
Counted pointer of TFQMRSolver.
TFQMRSolver(double NewTolerance, unsigned int NewMaxIterationsNumber)
Definition: tfqmr_solver.h:71
TFQMRSolver(Parameters settings)
Definition: tfqmr_solver.h:63
TSparseSpaceType::VectorType VectorType
Definition: tfqmr_solver.h:49
std::string Info() const override
Return information about this object.
Definition: tfqmr_solver.h:164
TFQMRSolver(double NewMaxTolerance, unsigned int NewMaxIterationsNumber, typename TPreconditionerType::Pointer pNewPreconditioner)
Definition: tfqmr_solver.h:75
TFQMRSolver()
Default constructor.
Definition: tfqmr_solver.h:58
~TFQMRSolver() override
Destructor.
Definition: tfqmr_solver.h:85
TFQMRSolver(const TFQMRSolver &Other)
Copy constructor.
Definition: tfqmr_solver.h:81
void PrintInfo(std::ostream &OStream) const override
Print information about this object.
Definition: tfqmr_solver.h:172
TDenseSpaceType::MatrixType DenseMatrixType
Definition: tfqmr_solver.h:51
TSparseSpaceType::MatrixType SparseMatrixType
Definition: tfqmr_solver.h:47
TFQMRSolver(double NewTolerance)
Definition: tfqmr_solver.h:61
bool Solve(SparseMatrixType &rA, VectorType &rX, VectorType &rB) override
Definition: tfqmr_solver.h:95
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
v
Definition: generate_convection_diffusion_explicit_element.py:114
w
Definition: generate_convection_diffusion_explicit_element.py:108
alpha
Definition: generate_convection_diffusion_explicit_element.py:113
tau
Definition: generate_convection_diffusion_explicit_element.py:115
rho
Definition: generate_droplet_dynamics.py:86
u2
Definition: generate_frictional_mortar_condition.py:76
u1
Definition: generate_frictional_mortar_condition.py:75
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
c
Definition: generate_weakly_compressible_navier_stokes_element.py:108
int d
Definition: ode_solve.py:397
float sigma
Definition: rotating_cone.py:79
int m
Definition: run_marine_rain_substepping.py:8
x
Definition: sensitivityMatrix.py:49
integer i
Definition: TensorModule.f:17