Spectral Integral Suite in C++
sis::GeneralizedEigenSolver< std::complex< T > > Class Template Reference

#include <sis.hpp>

Inheritance diagram for sis::GeneralizedEigenSolver< std::complex< T > >:
Collaboration diagram for sis::GeneralizedEigenSolver< std::complex< T > >:

Public Member Functions

 GeneralizedEigenSolver ()
 Null constructor. More...
 
void compute (const LinopMat< std::complex< T > > &Lmat_, int num_vals, const BcMat< std::complex< T > > &bc_)
 Call this with an input Linear operator to solve for eigenvalues and vectors. The number of Eigen values/vectors is num_vals, num_vals has to be less than N*r. More...
 
void compute (const LinopMat< std::complex< T > > &Lmat_, const BcMat< std::complex< T > > &bc_)
 Call this with an input Linear operator to solve for eigenvalues and vectors. More...
 
void compute (const LinopMat< std::complex< T > > &Lmat_, const LinopMat< std::complex< T > > &Mmat_, int num_vals, const BcMat< std::complex< T > > &Lbc_)
 The main solver for LinopMat. Read about class BcMat to see how this works, also see examples example/Ex_16.cpp and test/Visco_3D_pipe.cpp of how this is applied. This function is useful when boundary conditions are mixed between variables. Also, if you have boundary conditions that have an associated eigenvalue, see compute_with_constraints. More...
 
void computeAppend (const LinopMat< std::complex< T > > &Lmat_, const LinopMat< std::complex< T > > &Mmat_, int num_vals, const BcMat< std::complex< T > > &Lbc_)
 Another main solver for LinopMat, a minimal solver for eigenvalues only. LAPACK needs to be linked to use this, and SIS_USE_LAPACK has to be defined. More...
 
void compute_with_constraints (const LinopMat< std::complex< T > > &Lmat_, const LinopMat< std::complex< T > > &Mmat_, int num_vals, const BcMat< std::complex< T > > &Lbc_, const BcMat< std::complex< T > > &Mbc_)
 
void sortByLargestReal ()
 This function will sort the eigenvalues and vectors by the largest real part. More...
 
void keepConverged ()
 This will remove all unconverged and infinite eigenvalues from the list. More...
 
void keep (int n)
 This will keep only n and remove the rest. Use this carefully. Only first n will be kept, irrespective of convergence. More...
 
void removeInf ()
 This will remove all infinite eigenvalues. Useful when solving generalized eigenvalue problems. More...
 
void compute (const Eigen::Matrix< std::complex< T >, Eigen::Dynamic, Eigen::Dynamic > &L_, const Eigen::Matrix< std::complex< T >, Eigen::Dynamic, Eigen::Dynamic > &M_, Discretize< std::complex< T > > Dis)
 This is used to use a discretization to compute eigenvalues. More...
 

Public Attributes

ChebfunMat< std::complex< T > > eigenvectors
 
Eigen::Matrix< std::complex< T >, Eigen::Dynamic, 1 > eigenvalues
 
Eigen::Matrix< int, Eigen::Dynamic, 1 > MPorNot
 
int converged
 Number of eigenvalues that have converged to machine precision. More...
 

Detailed Description

template<class T>
class sis::GeneralizedEigenSolver< std::complex< T > >

Definition at line 5228 of file sis.hpp.

Constructor & Destructor Documentation

◆ GeneralizedEigenSolver()

template<class T >
sis::GeneralizedEigenSolver< std::complex< T > >::GeneralizedEigenSolver ( )
inline

Null constructor.

Definition at line 5238 of file sis.hpp.

Member Function Documentation

◆ compute() [1/4]

template<class T >
void sis::GeneralizedEigenSolver< std::complex< T > >::compute ( const LinopMat< std::complex< T > > &  Lmat_,
int  num_vals,
const BcMat< std::complex< T > > &  bc_ 
)
inline

Call this with an input Linear operator to solve for eigenvalues and vectors. The number of Eigen values/vectors is num_vals, num_vals has to be less than N*r.

Definition at line 5248 of file sis.hpp.

References sis::GeneralizedEigenSolver< T >::compute(), and sis::LinopMat< T >::setIdentity().

◆ compute() [2/4]

template<class T >
void sis::GeneralizedEigenSolver< std::complex< T > >::compute ( const LinopMat< std::complex< T > > &  Lmat_,
const BcMat< std::complex< T > > &  bc_ 
)
inline

Call this with an input Linear operator to solve for eigenvalues and vectors.

Definition at line 5257 of file sis.hpp.

References sis::GeneralizedEigenSolver< T >::compute(), sis::N, and sis::LinopMat< T >::setIdentity().

◆ compute() [3/4]

template<class T >
void sis::GeneralizedEigenSolver< std::complex< T > >::compute ( const LinopMat< std::complex< T > > &  Lmat_,
const LinopMat< std::complex< T > > &  Mmat_,
int  num_vals,
const BcMat< std::complex< T > > &  Lbc_ 
)
inline

The main solver for LinopMat. Read about class BcMat to see how this works, also see examples example/Ex_16.cpp and test/Visco_3D_pipe.cpp of how this is applied. This function is useful when boundary conditions are mixed between variables. Also, if you have boundary conditions that have an associated eigenvalue, see compute_with_constraints.

Definition at line 5270 of file sis.hpp.

References sis::LinopMat< T >::c, sis::ChebfunMat< T >::c2p(), sis::MatGen< T >::compute(), sis::GeneralizedEigenSolver< T >::eigenvalues, sis::MatGen< T >::mats2, sis::N, sis::LinopMat< T >::r, std::real(), sis::ChebfunMat< T >::resize(), and SIS_CHEB_SPACE.

◆ compute() [4/4]

template<class T >
void sis::GeneralizedEigenSolver< std::complex< T > >::compute ( const Eigen::Matrix< std::complex< T >, Eigen::Dynamic, Eigen::Dynamic > &  L_,
const Eigen::Matrix< std::complex< T >, Eigen::Dynamic, Eigen::Dynamic > &  M_,
Discretize< std::complex< T > >  Dis 
)
inline

◆ compute_with_constraints()

template<class T >
void sis::GeneralizedEigenSolver< std::complex< T > >::compute_with_constraints ( const LinopMat< std::complex< T > > &  Lmat_,
const LinopMat< std::complex< T > > &  Mmat_,
int  num_vals,
const BcMat< std::complex< T > > &  Lbc_,
const BcMat< std::complex< T > > &  Mbc_ 
)
inline

Use this to solve eigenvalue problems where eigenvalues appears in the boundary condition, example, in eigenvalue problems with fluid-fluid interfaces. Again solvability must hold. That total of all the highest orders of every independent variable has to be equal to the total number of boundary conditions specified + the number of constraints. Further, please ensure that the boundary conditions and constraints are linearly independent, else this will throw an error.

Definition at line 6576 of file sis.hpp.

◆ computeAppend()

template<class T >
void sis::GeneralizedEigenSolver< std::complex< T > >::computeAppend ( const LinopMat< std::complex< T > > &  Lmat_,
const LinopMat< std::complex< T > > &  Mmat_,
int  num_vals,
const BcMat< std::complex< T > > &  Lbc_ 
)
inline

Another main solver for LinopMat, a minimal solver for eigenvalues only. LAPACK needs to be linked to use this, and SIS_USE_LAPACK has to be defined.

This appends constraints instead of embedding them, useful for large matrix problems. Also this routine does not compute eigenvectors (may be updated in the future).

Read about class BcMat to see how this works, also see examples example/Ex_16.cpp and test/Visco_3D_pipe.cpp of how this is applied.

Definition at line 5970 of file sis.hpp.

References sis::LinopMat< T >::c, sis::MatGen< T >::compute(), sis::GeneralizedEigenSolver< T >::eigenvalues, sis::MatGen< T >::mats2, sis::N, sis::LinopMat< T >::r, and std::real().

◆ keep()

template<class T >
void sis::GeneralizedEigenSolver< std::complex< T > >::keep ( int  n)
inline

This will keep only n and remove the rest. Use this carefully. Only first n will be kept, irrespective of convergence.

Definition at line 7468 of file sis.hpp.

References sis::ChebfunMat< T >::c, sis::GeneralizedEigenSolver< T >::eigenvalues, sis::ChebfunMat< T >::r, and sis::ChebfunMat< T >::resize().

◆ keepConverged()

template<class T >
void sis::GeneralizedEigenSolver< std::complex< T > >::keepConverged ( )
inline

This will remove all unconverged and infinite eigenvalues from the list.

Definition at line 7431 of file sis.hpp.

References sis::ChebfunMat< T >::c, sis::GeneralizedEigenSolver< T >::eigenvalues, sis::ChebfunMat< T >::r, and sis::ChebfunMat< T >::resize().

◆ removeInf()

template<class T >
void sis::GeneralizedEigenSolver< std::complex< T > >::removeInf ( )
inline

This will remove all infinite eigenvalues. Useful when solving generalized eigenvalue problems.

Definition at line 7501 of file sis.hpp.

References sis::ChebfunMat< T >::c, sis::GeneralizedEigenSolver< T >::eigenvalues, std::imag(), sis::ChebfunMat< T >::r, std::real(), and sis::ChebfunMat< T >::resize().

◆ sortByLargestReal()

template<class T >
void sis::GeneralizedEigenSolver< std::complex< T > >::sortByLargestReal ( )
inline

This function will sort the eigenvalues and vectors by the largest real part.

Definition at line 7387 of file sis.hpp.

References sis::ChebfunMat< T >::c, sis::GeneralizedEigenSolver< T >::eigenvalues, and sis::ChebfunMat< T >::r.

Member Data Documentation

◆ converged

template<class T >
int sis::GeneralizedEigenSolver< std::complex< T > >::converged

Number of eigenvalues that have converged to machine precision.

Definition at line 5236 of file sis.hpp.

◆ eigenvalues

template<class T >
Eigen::Matrix<std::complex<T>, Eigen::Dynamic, 1> sis::GeneralizedEigenSolver< std::complex< T > >::eigenvalues

Definition at line 5233 of file sis.hpp.

◆ eigenvectors

template<class T >
ChebfunMat<std::complex<T> > sis::GeneralizedEigenSolver< std::complex< T > >::eigenvectors

Definition at line 5232 of file sis.hpp.

◆ MPorNot

template<class T >
Eigen::Matrix<int, Eigen::Dynamic, 1> sis::GeneralizedEigenSolver< std::complex< T > >::MPorNot

Definition at line 5234 of file sis.hpp.


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