Amesos Package Browser (Single Doxygen Collection) Development
Loading...
Searching...
No Matches
Amesos_Pardiso.h
Go to the documentation of this file.
1// @HEADER
2// ***********************************************************************
3//
4// Amesos: Direct Sparse Solver Package
5// Copyright (2004) Sandia Corporation
6//
7// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8// license for use of this work by or on behalf of the U.S. Government.
9//
10// This library is free software; you can redistribute it and/or modify
11// it under the terms of the GNU Lesser General Public License as
12// published by the Free Software Foundation; either version 2.1 of the
13// License, or (at your option) any later version.
14//
15// This library is distributed in the hope that it will be useful, but
16// WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18// Lesser General Public License for more details.
19//
20// You should have received a copy of the GNU Lesser General Public
21// License along with this library; if not, write to the Free Software
22// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
23// USA
24// Questions? Contact Michael A. Heroux (maherou@sandia.gov)
25//
26// ***********************************************************************
27// @HEADER
28
29#ifndef AMESOS_PARDISO_H
30#define AMESOS_PARDISO_H
31
32#include "Amesos_ConfigDefs.h"
33#include "Amesos_BaseSolver.h"
34#include "Amesos_NoCopiable.h"
35#include "Amesos_Utils.h"
36#include "Amesos_Time.h"
37#include "Amesos_Status.h"
38#include "Amesos_Control.h"
39#include "Epetra_LinearProblem.h"
40#include "Epetra_Time.h"
41#include "Epetra_Map.h"
42#include "Epetra_Import.h"
43#include "Epetra_Comm.h"
44#include "Epetra_RowMatrix.h"
45#include "Epetra_CrsMatrix.h"
46#include "Teuchos_ParameterList.hpp"
47#include "Teuchos_RCP.hpp"
48
50
58 private Amesos_Time,
59 private Amesos_NoCopiable,
60 private Amesos_Utils,
61 private Amesos_Control,
62 private Amesos_Status {
63
64public:
65
67
68 Amesos_Pardiso(const Epetra_LinearProblem& LinearProblem );
69
73
75
78
81
83 int Solve();
85
87
89 const Epetra_LinearProblem* GetProblem() const { return(Problem_); }
90
92
95 bool MatrixShapeOK() const;
96
98
103
105 bool UseTranspose() const { return(UseTranspose_); }
106
108 const Epetra_Comm& Comm() const { return(GetProblem()->GetOperator()->Comm()); }
109
111 int SetParameters( Teuchos::ParameterList &ParameterList );
112
115
118
120 int NumSolve() const { return( Amesos_Status::NumSolve_ ); }
121
123 void PrintTiming() const;
124
126 void PrintStatus() const;
127
129 void GetTiming( Teuchos::ParameterList &TimingParameterList ) const { Amesos_Time::GetTiming(TimingParameterList); }
130
132
133private:
134
135 int CheckError(const int error) const;
136
137 inline const Epetra_Map& Map() const
138 {
139 return(Matrix_->RowMatrixRowMap());
140 }
141
142 inline const Epetra_RowMatrix& Matrix() const
143 {
144 return(*Matrix_);
145 }
146
147 inline Epetra_Map& SerialMap()
148 {
149 return(*(SerialMap_.get()));
150 }
151
152 inline Epetra_RowMatrix& SerialMatrix()
153 {
154 return(*(SerialMatrix_.get()));
155 }
156
157 inline Epetra_CrsMatrix& SerialCrsMatrix()
158 {
159 return(*(SerialCrsMatrix_.get()));
160 }
161
162 inline Epetra_Import& Importer()
163 {
164 return(*(Importer_.get()));
165 }
166
167 int ConvertToSerial();
168 int ConvertToPardiso();
171
172 Teuchos::RCP<Epetra_Map> SerialMap_;
173 Teuchos::RCP<Epetra_CrsMatrix> SerialCrsMatrix_;
174 Teuchos::RCP<Epetra_RowMatrix> SerialMatrix_;
175 Teuchos::RCP<Epetra_Import> Importer_;
176
177 const Epetra_Map* Map_;
178 const Epetra_RowMatrix* Matrix_;
179
183 const Epetra_LinearProblem* Problem_;
184
188
189 // Data for PARDISO
190 std::vector<double> aa_;
191 std::vector<int> ia_;
192 std::vector<int> ja_;
193
196 void* pt_[64];
197
198 int iparm_[64];
199 double dparm_[64];
200 int maxfct_; // Maximal number of factors with idential nonzero pattern (always 1)
201 int mnum_;
203 int nrhs_; // Number of RHS
204
205 Teuchos::ParameterList param_;
206
207}; // class Amesos_Pardiso
208#endif
Amesos_BaseSolver: A pure virtual class for direct solution of real-valued double-precision operators...
Amesos_Control: Container for some control variables.
Amesos_NoCopiable: Simple class to prevent the usage of copy constructor and operator =.
Amesos_Pardiso: Interface to the PARDISO package.
Teuchos::RCP< Epetra_RowMatrix > SerialMatrix_
std::vector< int > ia_
~Amesos_Pardiso()
Destructor.
bool MatrixShapeOK() const
Returns true if PARDISO can handle this matrix shape.
Epetra_Import & Importer()
Amesos_Pardiso(const Epetra_LinearProblem &LinearProblem)
Constructor.
const Epetra_Comm & Comm() const
Returns a pointer to the Epetra_Comm communicator associated with this matrix.
const Epetra_LinearProblem * GetProblem() const
Get a pointer to the Problem.
int SetParameters(Teuchos::ParameterList &ParameterList)
Set parameters from the input parameters list, returns 0 if successful.
const Epetra_Map * Map_
Teuchos::RCP< Epetra_CrsMatrix > SerialCrsMatrix_
Teuchos::RCP< Epetra_Map > SerialMap_
const Epetra_RowMatrix * Matrix_
Epetra_RowMatrix & SerialMatrix()
int nrhs_
Output level.
int NumSymbolicFact() const
Returns the number of symbolic factorizations performed by this object.
const Epetra_Map & Map() const
int NumericFactorization()
Performs NumericFactorization on the matrix A.
int MtxConvTime_
Quick access pointers to the internal timing data.
std::vector< int > ja_
Epetra_Map & SerialMap()
int NumSolve() const
Returns the number of solves performed by this object.
bool UseTranspose_
If true, the transpose of A is used.
const Epetra_RowMatrix & Matrix() const
int NumNumericFact() const
Returns the number of numeric factorizations performed by this object.
int msglvl_
Actual matrix for solution phase (always 1)
const Epetra_LinearProblem * Problem_
Pointer to the linear system problem.
bool UseTranspose() const
Returns the current UseTranspose setting.
int CheckError(const int error) const
double dparm_[64]
int Solve()
Solves A X = B (or AT X = B)
Teuchos::RCP< Epetra_Import > Importer_
int SymbolicFactorization()
Performs SymbolicFactorization on the matrix A.
std::vector< double > aa_
void PrintStatus() const
Prints information about the factorization and solution phases.
void PrintTiming() const
Prints timing information.
void GetTiming(Teuchos::ParameterList &TimingParameterList) const
Extracts timing information from the current solver and places it in the parameter list.
int PerformNumericFactorization()
Teuchos::ParameterList param_
int SetUseTranspose(bool UseTranspose)
SetUseTranpose()
Epetra_CrsMatrix & SerialCrsMatrix()
int PerformSymbolicFactorization()
Amesos_Status: Container for some status variables.
int NumSymbolicFact_
Number of symbolic factorization phases.
int NumSolve_
Number of solves.
int NumNumericFact_
Number of numeric factorization phases.
Amesos_Time: Container for timing information.
Definition Amesos_Time.h:51
void GetTiming(Teuchos::ParameterList &list) const
Load up the current timing information into the parameter list.
Amesos_Utils: Collections of basic utilities.