Public Types | Public Member Functions | Protected Attributes | List of all members
Seldon::PolynomialEigenProblem< T > Class Template Reference

matrix-free implementation of polynomial eigenvalue solver More...

#include <PolynomialEigenvalueSolver.hxx>

Inheritance diagram for Seldon::PolynomialEigenProblem< T >:
Seldon::PolynomialEigenProblem_Base< T > Seldon::GeneralEigenProblem< T > Seldon::GeneralEigenProblem_Base Seldon::PolynomialDenseEigenProblem< T, Prop, Storage > Seldon::PolynomialSparseEigenProblem< T, MatStiff, MatMass >

Public Types

typedef ClassComplexType< T >::Tcplx Tcplx
 
typedef ClassComplexType< T >::Treal Treal
 
enum  { SMALL_EIGENVALUES, LARGE_EIGENVALUES, CENTERED_EIGENVALUES }
 parts of the spectrum (near from 0, at infinity or around a given value) More...
 
enum  { SORTED_REAL, SORTED_IMAG, SORTED_MODULUS, SORTED_USER }
 different sorting strategies
 

Public Member Functions

void InitMatrix (const Vector< VirtualMatrix< T > * > &op, int n=-1)
 inits the operators of the polynomial
 
void ComputeOperator (int num, const Vector< T > &coef)
 computes the operator with coefficients stored in coef
 
void MltOperator (int num, const SeldonTranspose &, const Vector< T > &X, Vector< T > &Y)
 Computes Y = A X where A is the operator num.
 
bool IsSymmetricProblem () const
 returns true if the problem is symmetric
 
bool IsHermitianProblem () const
 returns true if the problem is hermitian
 
bool UseSpectralTransformation () const
 returns true if a spectral transformation has to be used
 
void SetSpectralTransformation (bool t=true)
 enables a spectral transformation
 
SlepcParamPepGetSlepcParameters ()
 returns object storing slepc parameters
 
FeastParamGetFeastParameters ()
 returns object storing Feast parameters
 
int GetPolynomialDegree () const
 returns the polynomial degree
 
void SetDiagonalMass (bool diag=true)
 sets a diagonal mass
 
bool DiagonalMass ()
 returns true if the mass is diagonal
 
virtual void FactorizeMass ()
 to overload
 
virtual void SolveMass (const SeldonTranspose &, const Vector< T > &x, Vector< T > &y)
 to overload for non-diagonal mass
 
virtual void FactorizeOperator (const Vector< T > &coef)
 
virtual void SolveOperator (const SeldonTranspose &, const Vector< T > &X, Vector< T > &Y)
 
GetShiftValue () const
 returns the shift value used More...
 
GetImagShiftValue () const
 returns the imaginary part of shift value used More...
 
void SetShiftValue (const T &)
 Sets the real part of shift value.
 
void SetImagShiftValue (const T &)
 Sets the imaginary part of shift value.
 
void GetComplexShift (const Treal &, const Treal &, Tcplx &) const
 forms the complex shift from real and imaginary part
 
void GetComplexShift (const Tcplx &, const Tcplx &, Tcplx &) const
 forms the complex shift from real and imaginary part
 
void SetTypeSpectrum (int type, const T &val, int type_sort=SORTED_MODULUS)
 sets which eigenvalues are searched More...
 
void SetTypeSpectrum (int type, const complex< T > &val, int type_sort=SORTED_MODULUS)
 sets which eigenvalues are searched More...
 
void SetUserComparisonClass (EigenvalueComparisonClass< T > *ev)
 sets the class where two eigenvalues can be compared
 
void FillComplexEigenvectors (int m, const Tcplx &Emid, Treal eps, const Vector< Tcplx > &lambda_cplx, const Matrix< Tcplx, General, ColMajor > &Ecplx, Vector< T > &Lr, Vector< T > &Li, Matrix< T, General, ColMajor > &E)
 
void FillComplexEigenvectors (int m, const complex< double > &Emid, double eps, const Vector< complex< double > > &lambda_cplx, const Matrix< complex< double >, General, ColMajor > &Ecplx, Vector< double > &Lr, Vector< double > &Li, Matrix< double, General, ColMajor > &E)
 Fills arrays Lr, Li (eigenvalues) and E (eigenvectors) from complex eigenvectors. More...
 
void FillComplexEigenvectors (int m, const complex< double > &Emid, double eps, const Vector< complex< double > > &lambda_cplx, const Matrix< complex< double >, General, ColMajor > &Ecplx, Vector< complex< double > > &Lr, Vector< complex< double > > &Li, Matrix< complex< double >, General, ColMajor > &E)
 Fills arrays Lr, Li (eigenvalues) and E (eigenvectors) from complex eigenvectors.
 
virtual void DistributeEigenvectors (Matrix< T, General, ColMajor > &eigen_vec)
 changes final eigenvectors if needed
 
int GetRankCommunicator () const
 returns rank for the solver communicator
 
int GetGlobalRankCommunicator () const
 returns rank for the global communicator
 
int GetNbAskedEigenvalues () const
 returns the number of eigenvalues asked by the user
 
void SetNbAskedEigenvalues (int n)
 sets the number of eigenvalues to compute
 
int GetTypeSpectrum () const
 returns the spectrum desired (large, small eigenvalues, etc)
 
int GetTypeSorting () const
 returns how eigenvalues are sorted (real, imaginary part or modulus)
 
void SetStoppingCriterion (double eps)
 modifies the stopping critertion
 
double GetStoppingCriterion () const
 returns the stopping criterion
 
void SetNbMaximumIterations (int n)
 sets the maximal number of iterations allowed for the iterative algorithm
 
int GetNbMaximumIterations () const
 returns the maximal number of iterations allowed for the iterative algorithm
 
int GetNbMatrixVectorProducts () const
 returns the number of matrix-vector products performed since last call to Init
 
int GetNbArnoldiVectors () const
 returns the number of Arnoldi vectors to use
 
void SetNbArnoldiVectors (int n)
 sets the number of Arnoldi vectors to use
 
int GetM () const
 returns number of rows
 
int GetGlobalM () const
 returns global number of rows
 
int GetN () const
 returns number of columns
 
int GetPrintLevel () const
 returns level of verbosity
 
void SetPrintLevel (int lvl)
 sets the level of verbosity
 
void IncrementProdMatVect ()
 increment of the number of matrix vector products
 
int GetNbLinearSolves () const
 returns the number of linear solves
 
void IncrementLinearSolves ()
 increments the number of linear solves
 
void Init (int n)
 initialisation of the size of the eigenvalue problem
 

Protected Attributes

Vector< VirtualMatrix< T > * > list_op
 
Vector< Vector< T > > list_coef
 
bool use_spectral_transfo
 if true teta is searched (lambda = shift + 1/teta)
 
int pol_degree
 polynomial degree
 
SlepcParamPep slepc_param
 Slepc parameters.
 
FeastParam feast_param
 
bool diagonal_mass
 mass diagonal ?
 
Vector< T > invDiag
 
shift
 shift sigma (if type_spectrum = centered_eigenvalues)
 
shift_imag
 
EigenvalueComparisonClass< T > * compar_eigenval
 class for comparing eigenvalues
 
int nb_eigenvalues_wanted
 number of eigenvalues to be computed
 
int nb_arnoldi_vectors
 number of Arnoldi vectors
 
bool automatic_selection_arnoldi_vectors
 if true nb_arnoldi_vectors is automatically computed
 
int type_spectrum_wanted
 which spectrum ? Near from Zero ? Near from Infinity ? or near from a value ?
 
int type_sort_eigenvalues
 large eigenvalues because of their real part, imaginary part or magnitude ?
 
double stopping_criterion
 threshold for Arpack's iterative process
 
int nb_maximum_iterations
 Maximal number of iterations.
 
int nb_linear_solves
 number of linear solves
 
int display_every
 
int print_level
 
int nb_prod
 number of matrix-vector products
 
int n_
 size of the problem
 
int nglob
 

Detailed Description

template<class T>
class Seldon::PolynomialEigenProblem< T >

matrix-free implementation of polynomial eigenvalue solver

Definition at line 74 of file PolynomialEigenvalueSolver.hxx.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited

parts of the spectrum (near from 0, at infinity or around a given value)

SMALL_EIGENVALUES : seeking eigenvalues near 0 LARGE_EIGENVALUES : seeking largest eigenvalues CENTERED_EIGENVALUES : seeking eigenvalues near the shift sigma

Definition at line 245 of file VirtualEigenvalueSolver.hxx.

Member Function Documentation

◆ FillComplexEigenvectors()

void Seldon::GeneralEigenProblem< double >::FillComplexEigenvectors ( int  m,
const complex< double > &  Emid,
double  eps,
const Vector< complex< double > > &  lambda_cplx,
const Matrix< complex< double >, General, ColMajor > &  Ecplx,
Vector< double > &  Lr,
Vector< double > &  Li,
Matrix< double, General, ColMajor > &  E 
)
inherited

Fills arrays Lr, Li (eigenvalues) and E (eigenvectors) from complex eigenvectors.

Lapack convention is used, a complex eigenvector is stored with two columns (real and imaginary part)

Definition at line 633 of file VirtualEigenvalueSolver.cxx.

◆ GetImagShiftValue()

template<class T >
T Seldon::GeneralEigenProblem< T >::GetImagShiftValue
inherited

returns the imaginary part of shift value used

If type_spectrum_wanted is set to CENTERED_EIGENVALUES, we search closest eigenvalues to the shift value. Matrix (A - (shift + i shift_imag)*I)^{-1} will be used instead of A shift_imag is accessed only for real unsymmetric problems

Definition at line 497 of file VirtualEigenvalueSolver.cxx.

◆ GetShiftValue()

template<class T >
T Seldon::GeneralEigenProblem< T >::GetShiftValue
inherited

returns the shift value used

If type_spectrum_wanted is set to CENTERED_EIGENVALUES, we search closest eigenvalues to the shift value. Matrix (A - (shift + i shift_imag)*I)^{-1} will be used instead of A

Definition at line 483 of file VirtualEigenvalueSolver.cxx.

◆ SetTypeSpectrum() [1/2]

template<class T >
void Seldon::GeneralEigenProblem< T >::SetTypeSpectrum ( int  type,
const complex< T > &  val,
int  type_sort = SORTED_MODULUS 
)
inherited

sets which eigenvalues are searched

You can ask small eigenvalues, large, or eigenvalues close to the shift.

Definition at line 559 of file VirtualEigenvalueSolver.cxx.

◆ SetTypeSpectrum() [2/2]

template<class T >
void Seldon::GeneralEigenProblem< T >::SetTypeSpectrum ( int  type,
const T &  val,
int  type_sort = SORTED_MODULUS 
)
inherited

sets which eigenvalues are searched

You can ask small eigenvalues, large, or eigenvalues close to the shift.

Definition at line 544 of file VirtualEigenvalueSolver.cxx.


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