FEMTIC
DoubleSparseSquareMatrix.h
Go to the documentation of this file.
1 //-------------------------------------------------------------------------------------------------------
2 // The MIT License (MIT)
3 //
4 // Copyright (c) 2021 Yoshiya Usui
5 //
6 // Permission is hereby granted, free of charge, to any person obtaining a copy
7 // of this software and associated documentation files (the "Software"), to deal
8 // in the Software without restriction, including without limitation the rights
9 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 // copies of the Software, and to permit persons to whom the Software is
11 // furnished to do so, subject to the following conditions:
12 //
13 // The above copyright notice and this permission notice shall be included in all
14 // copies or substantial portions of the Software.
15 //
16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 // SOFTWARE.
23 //-------------------------------------------------------------------------------------------------------
24 #ifndef DBLDEF_DOUBLE_SPARSE_SQUARE_MATRIX
25 #define DBLDEF_DOUBLE_SPARSE_SQUARE_MATRIX
26 
27 #include <string>
28 #include "PARDISOSolverDouble.h"
29 #include "DoubleSparseMatrix.h"
30 
32 
33 public:
34 
35  //Default Constructer
36  explicit DoubleSparseSquareMatrix();
37 
38  //Constructer
39  explicit DoubleSparseSquareMatrix( const int nEq, const int nRhs = 1 );
40 
41  //Destructer
42  virtual ~DoubleSparseSquareMatrix();
43 
44  // Set number of rows and columns
45  virtual void setNumRowsAndColumns( const int nrows, const int ncols );
46 
47  // Set Degree of equation
48  void setDegreeOfEquation( const int nEq );
49 
50  //Initialize matrix and right-hand side vectors
51  void initializeMatrixAndRhsVectors( const int nEq, const int nRhs );
52 
53  //Initialize matrix solver
54  virtual void initializeMatrixSolver( const std::string& oocHeaderName, const int imode ) = 0;
55 
56  //Anaysis phase of matrix solver
58 
59  //Numerical factorization phase of matrix solver
61 
62  //Solve phase of matrix solver with a specified number of right-hand side
63  void solvePhaseMatrixSolver( double* solution, const long long iRhsStart ,const int nRhs );
64 
65  //Solve phase of matrix solver
66  void solvePhaseMatrixSolver( double* solution );
67 
68  //Solve phase of matrix solver
69  void solvePhaseMatrixSolver( const int nrhs, double* rhs, double* solution );
70 
71  //Release memory of matrix solver
73 
74  //Get memory required by matrix solver
76 
77  //Release memory
78  virtual void releaseMemory();
79 
80  //Get Degree of equation
81  int getDegreeOfEquation() const;
82 
83 protected:
84  //PARDISO solver
86 
87 private:
88  //Copy constructer
90 
91  // Assignment operator
93 
94 };
95 
96 #endif
Definition: DoubleSparseMatrix.h:29
Definition: DoubleSparseSquareMatrix.h:31
void releaseMemoryMatrixSolver()
Definition: DoubleSparseSquareMatrix.cpp:139
void setDegreeOfEquation(const int nEq)
Definition: DoubleSparseSquareMatrix.cpp:75
void writeMemoryRequiredByMatrixSolver()
Definition: DoubleSparseSquareMatrix.cpp:146
virtual ~DoubleSparseSquareMatrix()
Definition: DoubleSparseSquareMatrix.cpp:54
virtual void initializeMatrixSolver(const std::string &oocHeaderName, const int imode)=0
void analysisPhaseMatrixSolver()
Definition: DoubleSparseSquareMatrix.cpp:108
void factorizationPhaseMatrixSolver()
Definition: DoubleSparseSquareMatrix.cpp:114
PARDISOSolverDouble m_pardisoSolver
Definition: DoubleSparseSquareMatrix.h:85
DoubleSparseSquareMatrix()
Definition: DoubleSparseSquareMatrix.cpp:32
void solvePhaseMatrixSolver(double *solution, const long long iRhsStart, const int nRhs)
Definition: DoubleSparseSquareMatrix.cpp:120
void initializeMatrixAndRhsVectors(const int nEq, const int nRhs)
Definition: DoubleSparseSquareMatrix.cpp:87
virtual void setNumRowsAndColumns(const int nrows, const int ncols)
Definition: DoubleSparseSquareMatrix.cpp:61
DoubleSparseSquareMatrix & operator=(const DoubleSparseSquareMatrix &rhs)
Definition: DoubleSparseSquareMatrix.cpp:172
int getDegreeOfEquation() const
Definition: DoubleSparseSquareMatrix.cpp:161
virtual void releaseMemory()
Definition: DoubleSparseSquareMatrix.cpp:151
Definition: PARDISOSolverDouble.h:30