KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
direct_solver.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Pooyan Dadvand
11 //
12 
13 
14 #if !defined(KRATOS_DIRECT_SOLVER_H_INCLUDED )
15 #define KRATOS_DIRECT_SOLVER_H_INCLUDED
16 
17 
18 
19 // System includes
20 
21 
22 // External includes
23 
24 // Project includes
25 #include "includes/define.h"
27 #include "linear_solver.h"
28 
29 
30 namespace Kratos
31 {
32 
33 
34 
35 // Base class for all direct solvers in Kratos.
36 /* This class define the general interface for direct solvers in Kratos.
37  direct solver is a template class with this parameter:
38  - TSparseSpaceType which specify type
39  of the unknowns, coefficients, sparse matrix, vector of
40  unknowns, right hand side vector and their respective operators.
41  - TDenseMatrixType which specify type of the
42  matrices used as temporary matrices or multi solve unknowns and
43  right hand sides and their operators.
44  - TReordererType which specify type of the Orderer that performs the reordering of matrix to optimize the solution.
45 */
46 template<class TSparseSpaceType, class TDenseSpaceType,class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType> >
47 class DirectSolver : public LinearSolver<TSparseSpaceType, TDenseSpaceType, TReordererType>
48 {
49 public:
50 
53 
55 
57 
59 
61 
62 
65  DirectSolver(Parameters settings) {}
67  ~DirectSolver() override {}
68 
70  DirectSolver(const DirectSolver& Other) {}
71 
73  void PrintInfo(std::ostream& rOStream) const override
74  {
75  rOStream << "Direct solver";
76  }
77 
79  void PrintData(std::ostream& rOStream) const override
80  {
81  }
82 
83 private:
84 
86  DirectSolver& operator=(const DirectSolver& Other);
87 
88 
89 
90 }; // Class DirectSolver
91 
92 
93 
95 template<class TSparseSpaceType, class TDenseSpaceType,class TReordererType>
96 inline std::istream& operator >> (std::istream& rIStream,
98 {
99  return rIStream;
100 }
101 
103 template<class TSparseSpaceType, class TDenseSpaceType,class TReordererType>
104 inline std::ostream& operator << (std::ostream& rOStream,
106 {
107  rThis.PrintInfo(rOStream);
108  rOStream << std::endl;
109  rThis.PrintData(rOStream);
110 
111  return rOStream;
112 }
113 
114 } // namespace Kratos.
115 
116 #endif // KRATOS_DIRECT_SOLVER_H_INCLUDED defined
117 
118 
Definition: direct_solver.h:48
LinearSolver< TSparseSpaceType, TDenseSpaceType, TReordererType > BaseType
Definition: direct_solver.h:54
DirectSolver(const DirectSolver &Other)
Copy constructor.
Definition: direct_solver.h:70
TDenseSpaceType::MatrixType DenseMatrixType
Definition: direct_solver.h:60
DirectSolver()
Default constructor.
Definition: direct_solver.h:64
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: direct_solver.h:73
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: direct_solver.h:79
TSparseSpaceType::VectorType VectorType
Definition: direct_solver.h:58
KRATOS_CLASS_POINTER_DEFINITION(DirectSolver)
Counted pointer of DirectSolver.
TSparseSpaceType::MatrixType SparseMatrixType
Definition: direct_solver.h:56
~DirectSolver() override
Destructor.
Definition: direct_solver.h:67
DirectSolver(Parameters settings)
Definition: direct_solver.h:65
Base class for all the linear solvers in Kratos.
Definition: linear_solver.h:65
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
Vector VectorType
Definition: geometrical_transformation_utilities.h:56
Matrix MatrixType
Definition: geometrical_transformation_utilities.h:55
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