FEMTIC
PARDISOSolver.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_PARDISO_SOLVER
25 #define DBLDEF_PARDISO_SOLVER
26 
27 #include <string>
28 
29 // Class of PARDISO solver
31 
32 public:
39  };
40 
41  const static int INCORE_MODE = 0;
42  const static int SELECT_MODE_AUTOMATICALLY = 1;
43  const static int OUT_OF_CORE_MODE = 2;
44 
45  const static int REAL_AND_STRUCTURALLY_SYMMETRIC = 1;
47  const static int REAL_AND_SYMMETRIC_INDEFINITE = -2;
50  const static int COMPLEX_AND_HERMITIAN_INDEFINITE = -4;
51  const static int COMPLEX_AND_SYMMETRIC_MATRIX = 6;
52  const static int REAL_AND_UNSYMMETRIC_MATRIX = 11;
53  const static int COMPLEX_AND_UNSYMMETRIC_MATRIX = 13;
54 
55  // Default constructer
56  explicit PARDISOSolver();
57 
58  // Constructer
59  explicit PARDISOSolver(const long long int matrixType);
60 
61  // Destructer
62  virtual ~PARDISOSolver();
63 
64  // Initialize PARDISOr solver
65  void initialize( const std::string& oocHeaderName, const long long int imode, const long long int type );
66 
67  // Analysis phase of PARDISO solver
68  void analysis( long long int nEq, long long int* rowIndex, long long int* columns );
69 
70  // Release memory of PARDISO solver
71  void releaseMemory();
72 
73  // Get memory required by PARDISO solver
74  void writeMemoryRequired() const;
75 
76  // Get stage of PARDISO solver
77  int getSolutionStage() const;
78 
79  // Set stage of PARDISO solver
80  void setSolutionStage( const int stage );
81 
82 protected:
83  // Internal solver memory pointer of PARDISO Solver
84  void* m_pt[64];
85 
86  // Maximum number of factors with identical nonzero sparsity structure
87  long long int m_maxfct;
88 
89  // The actual matrix to be factorized at the solution phase
90  long long int m_mnum;
91 
92  // Type of matrix
93  long long int m_mtype;
94 
95  // Number of equations
96  long long int m_numEquations;
97 
98  // Parameters which control PARDISO
99  long long int m_iparm[64];
100 
101  // Message level of PARDISO
102  long long int m_msglvl;
103 
104  // Total peak memory [KByte] that needs during the analysis and symbolic factorization phase
106 
107  // The permanent memory [KByte] that needs from the analysis and symbolic factorization phase to the factorization and solve phases.
109 
110  // The total memory consumed by in-core PARDISO for internal float point arrays
112 
113  // The total memory consumed by out-core PARDISO for internal float point arrays
115 
116  // Solution stage of PARDISO solver
118 
119  // Output error messages
120  void outputErrorMessages( const int ier ) const;
121 
122 private:
123  // Copy constructer
125 
126  // Copy assignment operator
128 
129 };
130 
131 #endif
Definition: PARDISOSolver.h:30
static const int COMPLEX_AND_STRUCTURALLY_SYMMETRIC
Definition: PARDISOSolver.h:48
static const int REAL_AND_SYMMETRIC_INDEFINITE
Definition: PARDISOSolver.h:47
long long int m_msglvl
Definition: PARDISOSolver.h:102
void analysis(long long int nEq, long long int *rowIndex, long long int *columns)
Definition: PARDISOSolver.cpp:143
static const int INCORE_MODE
Definition: PARDISOSolver.h:41
static const int REAL_AND_SYMMETRIC_POSITIVE_DEFINITE
Definition: PARDISOSolver.h:46
static const int REAL_AND_UNSYMMETRIC_MATRIX
Definition: PARDISOSolver.h:52
long long int m_mnum
Definition: PARDISOSolver.h:90
static const int COMPLEX_AND_SYMMETRIC_MATRIX
Definition: PARDISOSolver.h:51
void * m_pt[64]
Definition: PARDISOSolver.h:84
static const int REAL_AND_STRUCTURALLY_SYMMETRIC
Definition: PARDISOSolver.h:45
solutionStage
Definition: PARDISOSolver.h:33
@ SOLVED
Definition: PARDISOSolver.h:38
@ ANALYZED
Definition: PARDISOSolver.h:36
@ INITIALIZED
Definition: PARDISOSolver.h:35
@ MEMORY_RELEASED
Definition: PARDISOSolver.h:34
@ FACTORIZED
Definition: PARDISOSolver.h:37
double m_permanetMemorySymbolicFactorization
Definition: PARDISOSolver.h:108
long long int m_iparm[64]
Definition: PARDISOSolver.h:99
void releaseMemory()
Definition: PARDISOSolver.cpp:179
PARDISOSolver()
Definition: PARDISOSolver.cpp:36
static const int COMPLEX_AND_HERMITIAN_INDEFINITE
Definition: PARDISOSolver.h:50
int getSolutionStage() const
Definition: PARDISOSolver.cpp:225
long long int m_mtype
Definition: PARDISOSolver.h:93
long long int m_maxfct
Definition: PARDISOSolver.h:87
static const int COMPLEX_AND_HERMITIAN_POSITIVE_DEFINITE
Definition: PARDISOSolver.h:49
static const int OUT_OF_CORE_MODE
Definition: PARDISOSolver.h:43
PARDISOSolver & operator=(const PARDISOSolver &rhs)
int m_solutionStage
Definition: PARDISOSolver.h:117
void initialize(const std::string &oocHeaderName, const long long int imode, const long long int type)
Definition: PARDISOSolver.cpp:83
void outputErrorMessages(const int ier) const
Definition: PARDISOSolver.cpp:242
virtual ~PARDISOSolver()
Definition: PARDISOSolver.cpp:74
double m_peakMemorySymbolicFactorization
Definition: PARDISOSolver.h:105
double m_memoryForNumericalFactorizationOutcore
Definition: PARDISOSolver.h:114
long long int m_numEquations
Definition: PARDISOSolver.h:96
void writeMemoryRequired() const
Definition: PARDISOSolver.cpp:208
double m_memoryForNumericalFactorizationIncore
Definition: PARDISOSolver.h:111
void setSolutionStage(const int stage)
Definition: PARDISOSolver.cpp:230
static const int COMPLEX_AND_UNSYMMETRIC_MATRIX
Definition: PARDISOSolver.h:53
static const int SELECT_MODE_AUTOMATICALLY
Definition: PARDISOSolver.h:42
PARDISOSolver(const PARDISOSolver &rhs)