MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
mfem::SuperLUSolver Class Reference

#include <superlu.hpp>

Inheritance diagram for mfem::SuperLUSolver:
[legend]
Collaboration diagram for mfem::SuperLUSolver:
[legend]

Public Member Functions

 SuperLUSolver (MPI_Comm comm, int npdep=1)
 Constructor with MPI_Comm parameter.
 
 SuperLUSolver (SuperLURowLocMatrix &A, int npdep=1)
 Constructor with SuperLU matrix object.
 
 ~SuperLUSolver ()
 Default destructor.
 
void SetOperator (const Operator &op)
 Set the operator/matrix.
 
void Mult (const Vector &x, Vector &y) const
 Factor and solve the linear system \( y = Op^{-1} x \).
 
void ArrayMult (const Array< const Vector * > &X, Array< Vector * > &Y) const
 Factor and solve the linear systems \( y_i = Op^{-1} x_i \) for all i in the X and Y arrays.
 
void MultTranspose (const Vector &x, Vector &y) const
 Factor and solve the transposed linear system \( y = Op^{-T} x \).
 
void ArrayMultTranspose (const Array< const Vector * > &X, Array< Vector * > &Y) const
 Factor and solve the transposed linear systems \( y_i = Op^{-T} x_i \) for all i in the X and Y arrays.
 
void SetPrintStatistics (bool print_stat)
 Specify whether to print the solver statistics (default true)
 
void SetEquilibriate (bool equil)
 Specify whether to equibrate the system scaling to make the rows and columns have unit norms. (default true)
 
void SetColumnPermutation (superlu::ColPerm col_perm)
 Specify how to permute the columns of the matrix.
 
void SetRowPermutation (superlu::RowPerm row_perm)
 Specify how to permute the rows of the matrix.
 
void SetIterativeRefine (superlu::IterRefine iter_ref)
 Specify how to handle iterative refinement.
 
void SetReplaceTinyPivot (bool rtp)
 Specify whether to replace tiny diagonals encountered during pivot with \( \sqrt{\epsilon} \lVert A \rVert \) (default false)
 
void SetNumLookAheads (int num_lookaheads)
 Specify the number of levels in the look-ahead factorization (default 10)
 
void SetLookAheadElimTree (bool etree)
 Specifies whether to use the elimination tree computed from the serial symbolic factorization to perform static scheduling (default false)
 
void SetSymmetricPattern (bool sym)
 Specify whether the matrix has a symmetric pattern to avoid extra work (default false)
 
void SetParSymbFact (bool par)
 Specify whether to perform parallel symbolic factorization.
 
void SetFact (superlu::Fact fact)
 Specify what information has been provided ahead of time about the factorization of A.
 
- Public Member Functions inherited from mfem::Solver
 Solver (int s=0, bool iter_mode=false)
 Initialize a square Solver with size s.
 
 Solver (int h, int w, bool iter_mode=false)
 Initialize a Solver with height h and width w.
 
- Public Member Functions inherited from mfem::Operator
void InitTVectors (const Operator *Po, const Operator *Ri, const Operator *Pi, Vector &x, Vector &b, Vector &X, Vector &B) const
 Initializes memory for true vectors of linear system.
 
 Operator (int s=0)
 Construct a square Operator with given size s (default 0).
 
 Operator (int h, int w)
 Construct an Operator with the given height (output size) and width (input size).
 
int Height () const
 Get the height (size of output) of the Operator. Synonym with NumRows().
 
int NumRows () const
 Get the number of rows (size of output) of the Operator. Synonym with Height().
 
int Width () const
 Get the width (size of input) of the Operator. Synonym with NumCols().
 
int NumCols () const
 Get the number of columns (size of input) of the Operator. Synonym with Width().
 
virtual MemoryClass GetMemoryClass () const
 Return the MemoryClass preferred by the Operator.
 
virtual void AddMult (const Vector &x, Vector &y, const real_t a=1.0) const
 Operator application: y+=A(x) (default) or y+=a*A(x).
 
virtual void AddMultTranspose (const Vector &x, Vector &y, const real_t a=1.0) const
 Operator transpose application: y+=A^t(x) (default) or y+=a*A^t(x).
 
virtual void ArrayAddMult (const Array< const Vector * > &X, Array< Vector * > &Y, const real_t a=1.0) const
 Operator application on a matrix: Y+=A(X) (default) or Y+=a*A(X).
 
virtual void ArrayAddMultTranspose (const Array< const Vector * > &X, Array< Vector * > &Y, const real_t a=1.0) const
 Operator transpose application on a matrix: Y+=A^t(X) (default) or Y+=a*A^t(X).
 
virtual OperatorGetGradient (const Vector &x) const
 Evaluate the gradient operator at the point x. The default behavior in class Operator is to generate an error.
 
virtual void AssembleDiagonal (Vector &diag) const
 Computes the diagonal entries into diag. Typically, this operation only makes sense for linear Operators. In some cases, only an approximation of the diagonal is computed.
 
virtual const OperatorGetProlongation () const
 Prolongation operator from linear algebra (linear system) vectors, to input vectors for the operator. NULL means identity.
 
virtual const OperatorGetRestriction () const
 Restriction operator from input vectors for the operator to linear algebra (linear system) vectors. NULL means identity.
 
virtual const OperatorGetOutputProlongation () const
 Prolongation operator from linear algebra (linear system) vectors, to output vectors for the operator. NULL means identity.
 
virtual const OperatorGetOutputRestrictionTranspose () const
 Transpose of GetOutputRestriction, directly available in this form to facilitate matrix-free RAP-type operators.
 
virtual const OperatorGetOutputRestriction () const
 Restriction operator from output vectors for the operator to linear algebra (linear system) vectors. NULL means identity.
 
void FormLinearSystem (const Array< int > &ess_tdof_list, Vector &x, Vector &b, Operator *&A, Vector &X, Vector &B, int copy_interior=0)
 Form a constrained linear system using a matrix-free approach.
 
void FormRectangularLinearSystem (const Array< int > &trial_tdof_list, const Array< int > &test_tdof_list, Vector &x, Vector &b, Operator *&A, Vector &X, Vector &B)
 Form a column-constrained linear system using a matrix-free approach.
 
virtual void RecoverFEMSolution (const Vector &X, const Vector &b, Vector &x)
 Reconstruct a solution vector x (e.g. a GridFunction) from the solution X of a constrained linear system obtained from Operator::FormLinearSystem() or Operator::FormRectangularLinearSystem().
 
void FormSystemOperator (const Array< int > &ess_tdof_list, Operator *&A)
 Return in A a parallel (on truedofs) version of this square operator.
 
void FormRectangularSystemOperator (const Array< int > &trial_tdof_list, const Array< int > &test_tdof_list, Operator *&A)
 Return in A a parallel (on truedofs) version of this rectangular operator (including constraints).
 
void FormDiscreteOperator (Operator *&A)
 Return in A a parallel (on truedofs) version of this rectangular operator.
 
void PrintMatlab (std::ostream &out, int n, int m=0) const
 Prints operator with input size n and output size m in Matlab format.
 
virtual void PrintMatlab (std::ostream &out) const
 Prints operator in Matlab format.
 
virtual ~Operator ()
 Virtual destructor.
 
Type GetType () const
 Return the type ID of the Operator class.
 

Public Attributes

const int nprow_
 
const int npcol_
 
const int npdep_
 
- Public Attributes inherited from mfem::Solver
bool iterative_mode
 If true, use the second argument of Mult() as an initial guess.
 

Protected Attributes

const SuperLURowLocMatrixAPtr_
 
Vector sol_
 
int nrhs_
 
void * optionsPtr_
 
void * ScalePermstructPtr_
 
void * LUstructPtr_
 
void * SOLVEstructPtr_
 
void * gridPtr_
 
- Protected Attributes inherited from mfem::Operator
int height
 Dimension of the output / number of rows in the matrix.
 
int width
 Dimension of the input / number of columns in the matrix.
 

Additional Inherited Members

- Public Types inherited from mfem::Operator
enum  DiagonalPolicy { DIAG_ZERO , DIAG_ONE , DIAG_KEEP }
 Defines operator diagonal policy upon elimination of rows and/or columns. More...
 
enum  Type {
  ANY_TYPE , MFEM_SPARSEMAT , Hypre_ParCSR , PETSC_MATAIJ ,
  PETSC_MATIS , PETSC_MATSHELL , PETSC_MATNEST , PETSC_MATHYPRE ,
  PETSC_MATGENERIC , Complex_Operator , MFEM_ComplexSparseMat , Complex_Hypre_ParCSR ,
  Complex_DenseMat , MFEM_Block_Matrix , MFEM_Block_Operator
}
 Enumeration defining IDs for some classes derived from Operator. More...
 
- Protected Member Functions inherited from mfem::Operator
void FormConstrainedSystemOperator (const Array< int > &ess_tdof_list, ConstrainedOperator *&Aout)
 see FormSystemOperator()
 
void FormRectangularConstrainedSystemOperator (const Array< int > &trial_tdof_list, const Array< int > &test_tdof_list, RectangularConstrainedOperator *&Aout)
 see FormRectangularSystemOperator()
 
OperatorSetupRAP (const Operator *Pi, const Operator *Po)
 Returns RAP Operator of this, using input/output Prolongation matrices Pi corresponds to "P", Po corresponds to "Rt".
 

Detailed Description

The MFEM wrapper around the SuperLU Direct Solver class.

The mfem::SuperLUSolver class uses the SuperLU_DIST library to perform LU factorization of a parallel sparse matrix. The solver is capable of handling double precision types. It is currently maintained by Xiaoye Sherry Li at NERSC, see http://crd-legacy.lbl.gov/~xiaoye/SuperLU/.

Definition at line 161 of file superlu.hpp.

Constructor & Destructor Documentation

◆ SuperLUSolver() [1/2]

mfem::SuperLUSolver::SuperLUSolver ( MPI_Comm comm,
int npdep = 1 )

Constructor with MPI_Comm parameter.

npdep is the replication factor for the matrix data and must be a power of 2 and divide evenly into the number of processors.

Definition at line 262 of file superlu.cpp.

◆ SuperLUSolver() [2/2]

mfem::SuperLUSolver::SuperLUSolver ( SuperLURowLocMatrix & A,
int npdep = 1 )

Constructor with SuperLU matrix object.

npdep is the replication factor for the matrix data and must be a power of 2 and divide evenly into the number of processors.

Definition at line 272 of file superlu.cpp.

◆ ~SuperLUSolver()

mfem::SuperLUSolver::~SuperLUSolver ( )

Default destructor.

Definition at line 278 of file superlu.cpp.

Member Function Documentation

◆ ArrayMult()

void mfem::SuperLUSolver::ArrayMult ( const Array< const Vector * > & X,
Array< Vector * > & Y ) const
virtual

Factor and solve the linear systems \( y_i = Op^{-1} x_i \) for all i in the X and Y arrays.

Note
Factorization modifies the operator matrix.

Reimplemented from mfem::Operator.

Definition at line 596 of file superlu.cpp.

◆ ArrayMultTranspose()

void mfem::SuperLUSolver::ArrayMultTranspose ( const Array< const Vector * > & X,
Array< Vector * > & Y ) const
virtual

Factor and solve the transposed linear systems \( y_i = Op^{-T} x_i \) for all i in the X and Y arrays.

Note
Factorization modifies the operator matrix.

Reimplemented from mfem::Operator.

Definition at line 712 of file superlu.cpp.

◆ Mult()

void mfem::SuperLUSolver::Mult ( const Vector & x,
Vector & y ) const
virtual

Factor and solve the linear system \( y = Op^{-1} x \).

Note
Factorization modifies the operator matrix.

Implements mfem::Operator.

Definition at line 587 of file superlu.cpp.

◆ MultTranspose()

void mfem::SuperLUSolver::MultTranspose ( const Vector & x,
Vector & y ) const
virtual

Factor and solve the transposed linear system \( y = Op^{-T} x \).

Note
Factorization modifies the operator matrix.

Reimplemented from mfem::Operator.

Definition at line 701 of file superlu.cpp.

◆ SetColumnPermutation()

void mfem::SuperLUSolver::SetColumnPermutation ( superlu::ColPerm col_perm)

Specify how to permute the columns of the matrix.

Supported options are: superlu::NATURAL, superlu::MMD_ATA, superlu::MMD_AT_PLUS_A, superlu::COLAMD, superlu::METIS_AT_PLUS_A (default), superlu::PARMETIS, superlu::ZOLTAN, superlu::MY_PERMC

Definition at line 399 of file superlu.cpp.

◆ SetEquilibriate()

void mfem::SuperLUSolver::SetEquilibriate ( bool equil)

Specify whether to equibrate the system scaling to make the rows and columns have unit norms. (default true)

Definition at line 392 of file superlu.cpp.

◆ SetFact()

void mfem::SuperLUSolver::SetFact ( superlu::Fact fact)

Specify what information has been provided ahead of time about the factorization of A.

Supported options are: superlu::DOFACT, superlu::SamePattern, superlu::SamePattern_SameRowPerm, superlu::FACTORED

Definition at line 468 of file superlu.cpp.

◆ SetIterativeRefine()

void mfem::SuperLUSolver::SetIterativeRefine ( superlu::IterRefine iter_ref)

Specify how to handle iterative refinement.

Supported options are: superlu::NOREFINE, superlu::SLU_SINGLE, superlu::SLU_DOUBLE (default), superlu::SLU_EXTRA

Definition at line 427 of file superlu.cpp.

◆ SetLookAheadElimTree()

void mfem::SuperLUSolver::SetLookAheadElimTree ( bool etree)

Specifies whether to use the elimination tree computed from the serial symbolic factorization to perform static scheduling (default false)

Definition at line 447 of file superlu.cpp.

◆ SetNumLookAheads()

void mfem::SuperLUSolver::SetNumLookAheads ( int num_lookaheads)

Specify the number of levels in the look-ahead factorization (default 10)

Definition at line 441 of file superlu.cpp.

◆ SetOperator()

void mfem::SuperLUSolver::SetOperator ( const Operator & op)
virtual

Set the operator/matrix.

Note
A must be a SuperLURowLocMatrix.

Implements mfem::Solver.

Definition at line 475 of file superlu.cpp.

◆ SetParSymbFact()

void mfem::SuperLUSolver::SetParSymbFact ( bool par)

Specify whether to perform parallel symbolic factorization.

Note
If true SuperLU will use superlu::PARMETIS for the Column Permutation regardless of the setting

Definition at line 461 of file superlu.cpp.

◆ SetPrintStatistics()

void mfem::SuperLUSolver::SetPrintStatistics ( bool print_stat)

Specify whether to print the solver statistics (default true)

Definition at line 385 of file superlu.cpp.

◆ SetReplaceTinyPivot()

void mfem::SuperLUSolver::SetReplaceTinyPivot ( bool rtp)

Specify whether to replace tiny diagonals encountered during pivot with \( \sqrt{\epsilon} \lVert A \rVert \) (default false)

Definition at line 434 of file superlu.cpp.

◆ SetRowPermutation()

void mfem::SuperLUSolver::SetRowPermutation ( superlu::RowPerm row_perm)

Specify how to permute the rows of the matrix.

Supported options are: superlu::NOROWPERM, superlu::LargeDiag (default), superlu::MY_PERMR for SuperLU version 5. For later versions the supported options are: superlu::NOROWPERM, superlu::LargeDiag_MC64 (default), superlu::LargeDiag_HWPM, superlu::MY_PERMR

Definition at line 415 of file superlu.cpp.

◆ SetSymmetricPattern()

void mfem::SuperLUSolver::SetSymmetricPattern ( bool sym)

Specify whether the matrix has a symmetric pattern to avoid extra work (default false)

Definition at line 454 of file superlu.cpp.

Member Data Documentation

◆ APtr_

const SuperLURowLocMatrix* mfem::SuperLUSolver::APtr_
protected

Definition at line 277 of file superlu.hpp.

◆ gridPtr_

void* mfem::SuperLUSolver::gridPtr_
protected

Definition at line 291 of file superlu.hpp.

◆ LUstructPtr_

void* mfem::SuperLUSolver::LUstructPtr_
protected

Definition at line 289 of file superlu.hpp.

◆ npcol_

const int mfem::SuperLUSolver::npcol_

Definition at line 267 of file superlu.hpp.

◆ npdep_

const int mfem::SuperLUSolver::npdep_

Definition at line 267 of file superlu.hpp.

◆ nprow_

const int mfem::SuperLUSolver::nprow_

Definition at line 267 of file superlu.hpp.

◆ nrhs_

int mfem::SuperLUSolver::nrhs_
mutableprotected

Definition at line 279 of file superlu.hpp.

◆ optionsPtr_

void* mfem::SuperLUSolver::optionsPtr_
protected

The actual types of the following pointers are hidden to avoid exposing the SuperLU header files to the entire library. Their types are given in the trailing comments. The reason that this is necessary is that SuperLU defines these structs differently for use with its real and complex solvers. If we want to add support for SuperLU's complex solvers one day we will need to hide these types to avoid name conflicts.

Definition at line 287 of file superlu.hpp.

◆ ScalePermstructPtr_

void* mfem::SuperLUSolver::ScalePermstructPtr_
protected

Definition at line 288 of file superlu.hpp.

◆ sol_

Vector mfem::SuperLUSolver::sol_
mutableprotected

Definition at line 278 of file superlu.hpp.

◆ SOLVEstructPtr_

void* mfem::SuperLUSolver::SOLVEstructPtr_
protected

Definition at line 290 of file superlu.hpp.


The documentation for this class was generated from the following files: