Reference documentation for deal.II version 8.4.2
Classes | Public Types | Public Member Functions | Protected Attributes | Private Member Functions | List of all members
ArpackSolver Class Reference

#include <deal.II/lac/arpack_solver.h>

Inheritance diagram for ArpackSolver:
[legend]

Classes

struct  AdditionalData
 

Public Types

enum  WhichEigenvalues
 
typedef types::global_dof_index size_type
 

Public Member Functions

SolverControlcontrol () const
 
 ArpackSolver (SolverControl &control, const AdditionalData &data=AdditionalData())
 
template<typename VectorType , typename MatrixType1 , typename MatrixType2 , typename INVERSE >
void solve (const MatrixType1 &A, const MatrixType2 &B, const INVERSE &inverse, std::vector< std::complex< double > > &eigenvalues, std::vector< VectorType > &eigenvectors, const unsigned int n_eigenvalues=0)
 
- Public Member Functions inherited from Subscriptor
 Subscriptor ()
 
 Subscriptor (const Subscriptor &)
 
virtual ~Subscriptor ()
 
Subscriptoroperator= (const Subscriptor &)
 
void subscribe (const char *identifier=0) const
 
void unsubscribe (const char *identifier=0) const
 
unsigned int n_subscriptions () const
 
void list_subscribers () const
 
 DeclException3 (ExcInUse, int, char *, std::string &,<< "Object of class "<< arg2<< " is still used by "<< arg1<< " other objects."<< "\"<< "(Additional information: "<< arg3<< ")\"<< "See the entry in the Frequently Asked Questions of "<< "deal.II (linked to from http://www.dealii.org/) for "<< "a lot more information on what this error means and "<< "how to fix programs in which it happens.")
 
 DeclException2 (ExcNoSubscriber, char *, char *,<< "No subscriber with identifier <"<< arg2<< "> subscribes to this object of class "<< arg1<< ". Consequently, it cannot be unsubscribed.")
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Protected Attributes

SolverControlsolver_control
 
const AdditionalData additional_data
 

Private Member Functions

 DeclException2 (ExcInvalidNumberofEigenvalues, int, int,<< "Number of wanted eigenvalues "<< arg1<< " is larger that the size of the matrix "<< arg2)
 

Detailed Description

Interface for using ARPACK. ARPACK is a collection of Fortran77 subroutines designed to solve large scale eigenvalue problems. Here we interface to the routines dneupd and dnaupd of ARPACK. The package is designed to compute a few eigenvalues and corresponding eigenvectors of a general n by n matrix A. It is most appropriate for large sparse matrices A.

In this class we make use of the method applied to the generalized eigenspectrum problem $(A-\lambda B)x=0$, for $x\neq0$; where $A$ is a system matrix, $B$ is a mass matrix, and $\lambda, x$ are a set of eigenvalues and eigenvectors respectively.

The ArpackSolver can be used in application codes with serial objects in the following way:

system.solve (A, B, OP, lambda, x, size_of_spectrum);

for the generalized eigenvalue problem $Ax=B\lambda x$, where the variable size_of_spectrum tells ARPACK the number of eigenvector/eigenvalue pairs to solve for. Here, lambda is a vector that will contain the eigenvalues computed, x a vector that will contain the eigenvectors computed, and OP is an inverse operation for the matrix A. Shift and invert transformation around zero is applied.

Through the AdditionalData the user can specify some of the parameters to be set.

For further information on how the ARPACK routines dneupd and dnaupd work and also how to set the parameters appropriately please take a look into the ARPACK manual.

Note
Whenever you eliminate degrees of freedom using ConstraintMatrix, you generate spurious eigenvalues and eigenvectors. If you make sure that the diagonals of eliminated matrix rows are all equal to one, you get a single additional eigenvalue. But beware that some functions in deal.II set these diagonals to rather arbitrary (from the point of view of eigenvalue problems) values. See also step-36 for an example.
Author
Baerbel Janssen, Agnieszka Miedlar, 2010, Guido Kanschat 2015

Definition at line 90 of file arpack_solver.h.

Member Typedef Documentation

§ size_type

Declare the type for container size.

Definition at line 96 of file arpack_solver.h.

Member Enumeration Documentation

§ WhichEigenvalues

An enum that lists the possible choices for which eigenvalues to compute in the solve() function.

Definition at line 103 of file arpack_solver.h.

Constructor & Destructor Documentation

§ ArpackSolver()

ArpackSolver::ArpackSolver ( SolverControl control,
const AdditionalData data = AdditionalData() 
)
inline

Constructor.

Definition at line 251 of file arpack_solver.h.

Member Function Documentation

§ control()

SolverControl & ArpackSolver::control ( ) const
inline

Access to the object that controls convergence.

Definition at line 544 of file arpack_solver.h.

§ solve()

template<typename VectorType , typename MatrixType1 , typename MatrixType2 , typename INVERSE >
void ArpackSolver::solve ( const MatrixType1 &  A,
const MatrixType2 &  B,
const INVERSE &  inverse,
std::vector< std::complex< double > > &  eigenvalues,
std::vector< VectorType > &  eigenvectors,
const unsigned int  n_eigenvalues = 0 
)
inline

Solve the generalized eigensprectrum problem $A x=\lambda B x$ by calling the dneupd and dnaupd functions of ARPACK.

The function returns a vector of eigenvalues of length n and a vector of eigenvectors, where the latter should be twice the size of the eigenvalue vector. The first n vectors in eigenvectors will be the real parts of the eigenvectors, the second n the imaginary parts.

Parameters
AThe operator for which we want to compute eigenvalues. Actually, this parameter is entirely unused.
BThe inner product of the underlying space, typically the mass matrix. For constrained problems, it can be a partial mass matrix, like for instance the velocity mass matrix of a Stokes problem. Only its function vmult() is used.
inverseThis is the possibly shifted inverse that is actually used instead of A. Only its function vmult() is used.
eigenvaluesis a vector of complex numbers in which the eigenvalues are returned.
eigenvectorsis a real vector of eigenvectors, containing alternatingly the real parts and the imaginary parts of the eigenvectors. Therefore, its length should be twice the number of eigenvalues. The vectors have to be initialized to match the matrices.
n_eigenvaluesThe purpose of this parameter is not clear, but it is safe to set it to the size of eigenvalues or greater. Leave it at its default zero, which will be reset to the size of eigenvalues internally.

'G' generalized eigenvalue problem 'I' standard eigenvalue problem

Specify the eigenvalues of interest, possible parameters "LA" algebraically largest "SA" algebraically smallest "LM" largest magnitude "SM" smallest magnitude "LR" largest real part "SR" smallest real part "LI" largest imaginary part "SI" smallest imaginary part "BE" both ends of spectrum simultaneous

Sets the mode of dsaupd. 1 is exact shifting, 2 is user-supplied shifts, 3 is shift-invert mode, 4 is buckling mode, 5 is Cayley mode.

1 - compute eigenvectors, 0 - only eigenvalues

Definition at line 263 of file arpack_solver.h.

§ DeclException2()

ArpackSolver::DeclException2 ( ExcInvalidNumberofEigenvalues  ,
int  ,
int  ,
<< "Number of wanted eigenvalues "<< arg1<< " is larger that the size of the matrix "<<  arg2 
)
private

Exceptions.

Member Data Documentation

§ solver_control

SolverControl& ArpackSolver::solver_control
protected

Reference to the object that controls convergence of the iterative solver.

Definition at line 190 of file arpack_solver.h.

§ additional_data

const AdditionalData ArpackSolver::additional_data
protected

Store a copy of the flags for this particular solver.

Definition at line 195 of file arpack_solver.h.


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