SU2
linear_solvers_structure.hpp
Go to the documentation of this file.
1 
35 #pragma once
36 
37 #include "./mpi_structure.hpp"
38 
39 #include <climits>
40 #include <limits>
41 #include <cmath>
42 #include <vector>
43 #include <iostream>
44 #include <cstdlib>
45 #include <iomanip>
46 #include <string>
47 
48 #include "option_structure.hpp"
49 #include "vector_structure.hpp"
50 #include "matrix_structure.hpp"
51 #include "config_structure.hpp"
52 #include "geometry_structure.hpp"
53 
54 using namespace std;
55 
67 class CSysSolve {
68 
69 private:
70 
80  su2double Sign(const su2double & x, const su2double & y) const;
81 
89  void ApplyGivens(const su2double & s, const su2double & c, su2double & h1, su2double & h2);
90 
101  void GenerateGivens(su2double & dx, su2double & dy, su2double & s, su2double & c);
102 
114  void SolveReduced(const int & n, const vector<vector<su2double> > & Hsbg,
115  const vector<su2double> & rhs, vector<su2double> & x);
116 
135  void ModGramSchmidt(int i, vector<vector<su2double> > & Hsbg, vector<CSysVector> & w);
136 
145  void WriteHeader(const string & solver, const su2double & restol, const su2double & resinit);
146 
155  void WriteHistory(const int & iter, const su2double & res, const su2double & resinit);
156 
157 public:
158 
168  unsigned long CG_LinSolver(const CSysVector & b, CSysVector & x, CMatrixVectorProduct & mat_vec,
169  CPreconditioner & precond, su2double tol,
170  unsigned long m, bool monitoring);
171 
183  unsigned long FGMRES_LinSolver(const CSysVector & b, CSysVector & x, CMatrixVectorProduct & mat_vec,
184  CPreconditioner & precond, su2double tol,
185  unsigned long m, su2double *residual, bool monitoring);
186 
198  unsigned long BCGSTAB_LinSolver(const CSysVector & b, CSysVector & x, CMatrixVectorProduct & mat_vec,
199  CPreconditioner & precond, su2double tol,
200  unsigned long m, su2double *residual, bool monitoring);
201 
210  unsigned long Solve(CSysMatrix & Jacobian, CSysVector & LinSysRes, CSysVector & LinSysSol, CGeometry *geometry, CConfig *config);
211 
212 
221  void SetExternalSolve(CSysMatrix & Jacobian, CSysVector & LinSysRes, CSysVector & LinSysSol, CGeometry *geometry, CConfig *config);
222 
223 };
224 
Headers of the main subroutines for creating the geometrical structure. The subroutines and functions...
Headers of the main subroutines for creating the sparse matrices-by-blocks. The subroutines and funct...
All the information about the definition of the physical problem. The subroutines and functions are i...
Parent class for defining the geometry of the problem (complete geometry, multigrid agglomerated geom...
Definition: geometry_structure.hpp:72
Defines classes for referencing options for easy input in CConfig.
Headers of the mpi interface for generalized datatypes. The subroutines and functions are in the mpi_...
abstract base class for defining matrix-vector products
Definition: vector_structure.hpp:363
abstract base class for defining preconditioning operation
Definition: vector_structure.hpp:380
inline subroutines of the linear_solvers_structure.hpp file.
Main class for defining sparse matrices-by-blocks with compressed row format.
Definition: matrix_structure.hpp:59
Class for solving linear systems using classical and Krylov-subspace iterative methods.
Definition: linear_solvers_structure.hpp:67
Headers for the classes related to linear solvers (CG, FGMRES, etc) The subroutines and functions are...
Class for holding and manipulating vectors needed by linear solvers.
Definition: vector_structure.hpp:60
Main class for defining the problem; basically this class reads the configuration file...
Definition: config_structure.hpp:68