OpenCAEPoro  0.2.0 Sep/22/2022
A simulator for multicomponent porous media flow
LinearSolver.hpp
Go to the documentation of this file.
1 
12 #ifndef __LINEARSOLVER_HEADER__
13 #define __LINEARSOLVER_HEADER__
14 
15 // Standard header files
16 #include <string>
17 #include <vector>
18 
19 // OpenCAEPoro header files
20 #include "OCPConst.hpp"
21 
22 using namespace std;
23 
26 {
27 public:
29  virtual void SetupParam(const string& dir, const string& file) = 0;
30 
32  virtual void InitParam() = 0;
33 
35  virtual void Allocate(const vector<USI>& rowCapacity,
36  const OCP_USI& maxDim,
37  const USI& blockDim) = 0;
38 
40  virtual void AssembleMat(const vector<vector<USI>>& colId,
41  const vector<vector<OCP_DBL>>& val,
42  const OCP_USI& dim,
43  const USI& blockDim,
44  vector<OCP_DBL>& rhs,
45  vector<OCP_DBL>& u) = 0;
46 
48  virtual OCP_INT Solve() = 0;
49 
51  virtual USI GetNumIters() const = 0;
52 };
53 
54 #endif // __LINEARSOLVER_HEADER__
55 
56 /*----------------------------------------------------------------------------*/
57 /* Brief Change History of This File */
58 /*----------------------------------------------------------------------------*/
59 /* Author Date Actions */
60 /*----------------------------------------------------------------------------*/
61 /* Shizhe Li Nov/22/2021 Create file */
62 /* Chensong Zhang Jan/18/2022 Update Doxygen */
63 /*----------------------------------------------------------------------------*/
Definition of build-in datatypes and consts.
unsigned int USI
Generic unsigned integer.
Definition: OCPConst.hpp:22
unsigned int OCP_USI
Long unsigned integer.
Definition: OCPConst.hpp:24
int OCP_INT
Long integer.
Definition: OCPConst.hpp:25
Virtual base class for linear solvers.
virtual void AssembleMat(const vector< vector< USI >> &colId, const vector< vector< OCP_DBL >> &val, const OCP_USI &dim, const USI &blockDim, vector< OCP_DBL > &rhs, vector< OCP_DBL > &u)=0
Assemble matrix for linear solver from the internal matrix data.
virtual void Allocate(const vector< USI > &rowCapacity, const OCP_USI &maxDim, const USI &blockDim)=0
Allocate maximum memory for linear solvers.
virtual void SetupParam(const string &dir, const string &file)=0
Read the params for linear solvers from an input file.
virtual OCP_INT Solve()=0
Solve the linear system and return the number of iterations.
virtual USI GetNumIters() const =0
Get number of iterations.
virtual void InitParam()=0
Initialize the params for linear solvers.