Public Member Functions | Protected Attributes | List of all members
oomph::EigenSolver Class Referenceabstract

Base class for all EigenProblem solves. This simply defines standard interfaces so that different solvers can be used easily. More...

#include <eigen_solver.h>

+ Inheritance diagram for oomph::EigenSolver:

Public Member Functions

 EigenSolver ()
 Empty constructor. More...
 
 EigenSolver (const EigenSolver &)
 Empty copy constructor. More...
 
virtual ~EigenSolver ()
 Empty destructor. More...
 
virtual void solve_eigenproblem_legacy (Problem *const &problem_pt, const int &n_eval, Vector< std::complex< double >> &eigenvalue, Vector< DoubleVector > &eigenvector, const bool &do_adjoint_problem=false)=0
 Eigensolver. This takes a pointer to a problem and returns a vector of complex numbers representing the eigenvalues and a corresponding vector of eigenvectors. n_eval specifies the min. number of eigenvalues/vectors required. This is primarily used in Arnoldi type implementations; direct solvers such as QZ compute all the eigenvalues/vectors. Note: this is a legacy version of this function that stores re & imag parts of eigenvectors in some solver-specific collection of real vectors. More...
 
virtual void solve_eigenproblem (Problem *const &problem_pt, const int &n_eval, Vector< std::complex< double >> &eigenvalue, Vector< DoubleVector > &eigenvector_real, Vector< DoubleVector > &eigenvector_imag, const bool &do_adjoint_problem=false)
 Solve the real eigenproblem that is assembled by elements in a mesh in a Problem object. Note that the assembled matrices include the shift and are real. The eigenvalues and eigenvectors are, in general, complex, and the eigenvalues can be NaNs or Infs. This function is therefore merely provided as a convenience, to be used if the user is confident that NaNs don't arise (e.g. in Arnoldi based solvers where typically only a small number of (finite) eigenvalues are computed), or if the users is happy to deal with NaNs in the subsequent post-processing. Function is virtual so it can be overloaded for Arnoldi type solvers that compute the (finite) eigenvalues directly At least n_eval eigenvalues are computed. More...
 
virtual void solve_eigenproblem (Problem *const &problem_pt, const int &n_eval, Vector< std::complex< double >> &alpha, Vector< double > &beta, Vector< DoubleVector > &eigenvector_real, Vector< DoubleVector > &eigenvector_imag, const bool &do_adjoint_problem=false)=0
 Solve the real eigenproblem that is assembled by elements in a mesh in a Problem object. Note that the assembled matrices include the shift and are real. The eigenvalues and eigenvectors are, in general, complex. Eigenvalues may be infinite and are therefore returned as $ \lambda_i = \alpha_i / \beta_i $ where $ \alpha_i $ is complex while $ \beta_i $ is real. The actual eigenvalues may then be computed by doing the division, checking for zero betas to avoid NaNs. There's a convenience wrapper to this function that simply computes these eigenvalues regardless. That version may die in NaN checking is enabled (via the fenv.h header and the associated feenable function). At least n_eval eigenvalues are computed. More...
 
void set_shift (const double &shift_value)
 Set the value of the (real) shift. More...
 
const double & get_shift () const
 Return the value of the (real) shift (const version) More...
 
- Public Member Functions inherited from oomph::DistributableLinearAlgebraObject
 DistributableLinearAlgebraObject ()
 Default constructor - create a distribution. More...
 
 DistributableLinearAlgebraObject (const DistributableLinearAlgebraObject &matrix)=delete
 Broken copy constructor. More...
 
void operator= (const DistributableLinearAlgebraObject &)=delete
 Broken assignment operator. More...
 
virtual ~DistributableLinearAlgebraObject ()
 Destructor. More...
 
LinearAlgebraDistributiondistribution_pt () const
 access to the LinearAlgebraDistribution More...
 
unsigned nrow () const
 access function to the number of global rows. More...
 
unsigned nrow_local () const
 access function for the num of local rows on this processor. More...
 
unsigned nrow_local (const unsigned &p) const
 access function for the num of local rows on this processor. More...
 
unsigned first_row () const
 access function for the first row on this processor More...
 
unsigned first_row (const unsigned &p) const
 access function for the first row on this processor More...
 
bool distributed () const
 distribution is serial or distributed More...
 
bool distribution_built () const
 if the communicator_pt is null then the distribution is not setup then false is returned, otherwise return true More...
 
void build_distribution (const LinearAlgebraDistribution *const dist_pt)
 setup the distribution of this distributable linear algebra object More...
 
void build_distribution (const LinearAlgebraDistribution &dist)
 setup the distribution of this distributable linear algebra object More...
 

Protected Attributes

double Sigma_real
 Double value that represents the real part of the shift in shifted eigensolvers. More...
 

Additional Inherited Members

- Protected Member Functions inherited from oomph::DistributableLinearAlgebraObject
void clear_distribution ()
 clear the distribution of this distributable linear algebra object More...
 

Detailed Description

Base class for all EigenProblem solves. This simply defines standard interfaces so that different solvers can be used easily.

Definition at line 60 of file eigen_solver.h.

Constructor & Destructor Documentation

◆ EigenSolver() [1/2]

oomph::EigenSolver::EigenSolver ( )
inline

Empty constructor.

Definition at line 69 of file eigen_solver.h.

◆ EigenSolver() [2/2]

oomph::EigenSolver::EigenSolver ( const EigenSolver )
inline

Empty copy constructor.

Definition at line 72 of file eigen_solver.h.

◆ ~EigenSolver()

virtual oomph::EigenSolver::~EigenSolver ( )
inlinevirtual

Empty destructor.

Definition at line 75 of file eigen_solver.h.

Member Function Documentation

◆ get_shift()

const double& oomph::EigenSolver::get_shift ( ) const
inline

Return the value of the (real) shift (const version)

Definition at line 161 of file eigen_solver.h.

References Sigma_real.

◆ set_shift()

void oomph::EigenSolver::set_shift ( const double &  shift_value)
inline

Set the value of the (real) shift.

Definition at line 155 of file eigen_solver.h.

References Sigma_real.

◆ solve_eigenproblem() [1/2]

virtual void oomph::EigenSolver::solve_eigenproblem ( Problem *const &  problem_pt,
const int &  n_eval,
Vector< std::complex< double >> &  alpha,
Vector< double > &  beta,
Vector< DoubleVector > &  eigenvector_real,
Vector< DoubleVector > &  eigenvector_imag,
const bool &  do_adjoint_problem = false 
)
pure virtual

Solve the real eigenproblem that is assembled by elements in a mesh in a Problem object. Note that the assembled matrices include the shift and are real. The eigenvalues and eigenvectors are, in general, complex. Eigenvalues may be infinite and are therefore returned as $ \lambda_i = \alpha_i / \beta_i $ where $ \alpha_i $ is complex while $ \beta_i $ is real. The actual eigenvalues may then be computed by doing the division, checking for zero betas to avoid NaNs. There's a convenience wrapper to this function that simply computes these eigenvalues regardless. That version may die in NaN checking is enabled (via the fenv.h header and the associated feenable function). At least n_eval eigenvalues are computed.

Implemented in oomph::LAPACK_QZ, oomph::ARPACK, and oomph::ANASAZI.

◆ solve_eigenproblem() [2/2]

virtual void oomph::EigenSolver::solve_eigenproblem ( Problem *const &  problem_pt,
const int &  n_eval,
Vector< std::complex< double >> &  eigenvalue,
Vector< DoubleVector > &  eigenvector_real,
Vector< DoubleVector > &  eigenvector_imag,
const bool &  do_adjoint_problem = false 
)
inlinevirtual

Solve the real eigenproblem that is assembled by elements in a mesh in a Problem object. Note that the assembled matrices include the shift and are real. The eigenvalues and eigenvectors are, in general, complex, and the eigenvalues can be NaNs or Infs. This function is therefore merely provided as a convenience, to be used if the user is confident that NaNs don't arise (e.g. in Arnoldi based solvers where typically only a small number of (finite) eigenvalues are computed), or if the users is happy to deal with NaNs in the subsequent post-processing. Function is virtual so it can be overloaded for Arnoldi type solvers that compute the (finite) eigenvalues directly At least n_eval eigenvalues are computed.

Reimplemented in oomph::ANASAZI.

Definition at line 106 of file eigen_solver.h.

References i.

Referenced by oomph::Problem::solve_adjoint_eigenproblem(), and oomph::Problem::solve_eigenproblem().

◆ solve_eigenproblem_legacy()

virtual void oomph::EigenSolver::solve_eigenproblem_legacy ( Problem *const &  problem_pt,
const int &  n_eval,
Vector< std::complex< double >> &  eigenvalue,
Vector< DoubleVector > &  eigenvector,
const bool &  do_adjoint_problem = false 
)
pure virtual

Eigensolver. This takes a pointer to a problem and returns a vector of complex numbers representing the eigenvalues and a corresponding vector of eigenvectors. n_eval specifies the min. number of eigenvalues/vectors required. This is primarily used in Arnoldi type implementations; direct solvers such as QZ compute all the eigenvalues/vectors. Note: this is a legacy version of this function that stores re & imag parts of eigenvectors in some solver-specific collection of real vectors.

Implemented in oomph::LAPACK_QZ, oomph::ARPACK, and oomph::ANASAZI.

Referenced by oomph::Problem::solve_adjoint_eigenproblem_legacy(), and oomph::Problem::solve_eigenproblem_legacy().

Member Data Documentation

◆ Sigma_real

double oomph::EigenSolver::Sigma_real
protected

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