16 #if !defined(KRATOS_LINEAR_SOLVER_H_INCLUDED )
17 #define KRATOS_LINEAR_SOLVER_H_INCLUDED
63 template<
class TSparseSpaceType,
class TDenseSpaceType,
class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType> >
98 LinearSolver(TReordererType NewReorderer) : mpReorderer(NewReorderer) {}
114 mpReorderer = Other.mpReorderer;
133 mpReorderer->Initialize(rA, rX, rB);
156 KRATOS_ERROR <<
"Calling linear solver base class" << std::endl;
188 KRATOS_ERROR <<
"Calling linear solver base class" << std::endl;
202 KRATOS_ERROR <<
"Calling linear solver base class" << std::endl;
217 KRATOS_ERROR <<
"Calling linear solver base class" << std::endl;
255 virtual void SetReorderer(
typename TReordererType::Pointer pNewReorderer)
257 mpReorderer = pNewReorderer;
266 KRATOS_WARNING(
"LinearSolver") <<
"Accessed base function \"SetTolerance\". This does nothing !" << std::endl;
275 KRATOS_WARNING(
"LinearSolver") <<
"Accessed base function \"GetTolerance\". No tolerance defined, returning 0 !" << std::endl ;
281 KRATOS_WARNING(
"LinearSolver") <<
"Accessed base function \"GetIterationsNumber\", returning 0 !" << std::endl ;
308 return ((size == size_a) &&
333 return ((size == size_a) &&
334 (size == size_1_x) &&
335 (size == size_1_b) &&
336 (size_2_x == size_2_b));
376 virtual std::string
Info()
const
378 return "Linear solver";
384 rOStream <<
"Linear solver";
446 typename TReordererType::Pointer mpReorderer;
489 template<
class TSparseSpaceType,
class TDenseSpaceType,
class TReordererType>
497 template<
class TSparseSpaceType,
class TDenseSpaceType,
class TReordererType>
502 rOStream << std::endl;
Base class for all the linear solvers in Kratos.
Definition: linear_solver.h:65
virtual void FinalizeSolutionStep(SparseMatrixType &rA, VectorType &rX, VectorType &rB)
Definition: linear_solver.h:165
TSparseSpaceType::MatrixType SparseMatrixType
Definition: linear_solver.h:73
std::size_t SizeType
Definition: linear_solver.h:85
TSparseSpaceType::IndexType IndexType
The index type definition to be consistent.
Definition: linear_solver.h:88
virtual void InitializeSolutionStep(SparseMatrixType &rA, VectorType &rX, VectorType &rB)
Definition: linear_solver.h:144
TSparseSpaceType::VectorPointerType VectorPointerType
Definition: linear_solver.h:79
TDenseSpaceType::VectorType DenseVectorType
Definition: linear_solver.h:83
virtual double GetTolerance()
This method allows to get the tolerance in the linear solver.
Definition: linear_solver.h:273
TDenseSpaceType::MatrixType DenseMatrixType
Definition: linear_solver.h:81
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: linear_solver.h:388
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: linear_solver.h:382
virtual bool Solve(SparseMatrixType &rA, DenseMatrixType &rX, DenseMatrixType &rB)
Definition: linear_solver.h:200
virtual void Solve(SparseMatrixType &K, SparseMatrixType &M, DenseVectorType &Eigenvalues, DenseMatrixType &Eigenvectors)
Definition: linear_solver.h:212
virtual void SetReorderer(typename TReordererType::Pointer pNewReorderer)
Definition: linear_solver.h:255
virtual TReordererType::Pointer GetReorderer()
Definition: linear_solver.h:250
TSparseSpaceType::MatrixPointerType SparseMatrixPointerType
Definition: linear_solver.h:75
LinearSolver(const LinearSolver &Other)
Copy constructor.
Definition: linear_solver.h:101
LinearSolver(TReordererType NewReorderer)
Constructor with specific reorderer.
Definition: linear_solver.h:98
LinearSolver()
Default constructor.
Definition: linear_solver.h:95
LinearSolver & operator=(const LinearSolver &Other)
Assignment operator.
Definition: linear_solver.h:112
virtual bool AdditionalPhysicalDataIsNeeded()
Definition: linear_solver.h:226
virtual std::string Info() const
Turn back information as a string.
Definition: linear_solver.h:376
TSparseSpaceType::VectorType VectorType
Definition: linear_solver.h:77
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
virtual void PerformSolutionStep(SparseMatrixType &rA, VectorType &rX, VectorType &rB)
Definition: linear_solver.h:154
virtual bool Solve(SparseMatrixType &rA, VectorType &rX, VectorType &rB)
Definition: linear_solver.h:186
KRATOS_CLASS_POINTER_DEFINITION(LinearSolver)
Pointer definition of LinearSolver.
virtual void ProvideAdditionalData(SparseMatrixType &rA, VectorType &rX, VectorType &rB, typename ModelPart::DofsArrayType &rDoFSet, ModelPart &rModelPart)
Definition: linear_solver.h:237
virtual bool IsConsistent(SparseMatrixType &rA, DenseMatrixType &rX, DenseMatrixType &rB)
This method checks if the dimensions of the system of equations are consistent (dense matrix for RHS ...
Definition: linear_solver.h:320
virtual void Clear()
Definition: linear_solver.h:173
virtual void Initialize(SparseMatrixType &rA, VectorType &rX, VectorType &rB)
Definition: linear_solver.h:131
virtual bool IsNotConsistent(SparseMatrixType &rA, DenseMatrixType &rX, DenseMatrixType &rB)
This method checks if the dimensions of the system of equations are not consistent.
Definition: linear_solver.h:362
virtual ~LinearSolver()
Destructor.
Definition: linear_solver.h:104
virtual bool IsConsistent(SparseMatrixType &rA, VectorType &rX, VectorType &rB)
This method checks if the dimensions of the system of equations are consistent.
Definition: linear_solver.h:297
virtual IndexType GetIterationsNumber()
Definition: linear_solver.h:279
virtual void SetTolerance(double NewTolerance)
This method allows to set the tolerance in the linear solver.
Definition: linear_solver.h:264
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
A sorted associative container similar to an STL set, but uses a vector to store pointers to its data...
Definition: pointer_vector_set.h:72
#define KRATOS_ERROR
Definition: exception.h:161
#define KRATOS_WARNING(label)
Definition: logger.h:265
std::size_t IndexType
Definition: binary_expression.cpp:25
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
TSpaceType::IndexType Size(TSpaceType &dummy, typename TSpaceType::VectorType const &rV)
Definition: add_strategies_to_python.cpp:111
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
K
Definition: sensitivityMatrix.py:73