|
Feel++ 0.91.0
|
base class for eigen solvers More...
#include <solvereigen.hpp>
Public Types | |
Typedefs | |
| typedef T | value_type |
| typedef type_traits< T >::real_type | real_type |
| typedef SolverEigen< value_type > | solvereigen_type |
|
typedef boost::shared_ptr < solvereigen_type > | solvereigen_ptrtype |
|
typedef boost::tuple < size_type, size_type, value_type > | solve_return_type |
| typedef Vector< value_type > | vector_type |
|
typedef boost::shared_ptr < vector_type > | vector_ptrtype |
| typedef MatrixSparse< value_type > | sparse_matrix_type |
|
typedef boost::shared_ptr < sparse_matrix_type > | sparse_matrix_ptrtype |
|
typedef boost::tuple < real_type, real_type, vector_ptrtype > | eigenpair_type |
|
typedef std::map< real_type, eigenpair_type > | eigenmodes_type |
Public Member Functions | |
Accessors | |
| std::string const & | prefix () const |
| EigenSolverType | eigenSolverType () const |
| EigenProblemType | eigenProblemType () const |
| PositionOfSpectrum | postitionOfSpectrum () const |
| SpectralTransformType | spectralTransform () const |
| size_type | numberOfEigenvalues () const |
| size_type | numberOfEigenvaluesConverged () const |
| value_type | tolerance () const |
| size_type | maxIterations () const |
Mutators | |
| void | setEigenSolverType (const EigenSolverType est) |
| void | setEigenProblemType (EigenProblemType ept) |
| void | setPositionOfSpectrum (PositionOfSpectrum pos) |
| void | setSpectralTransform (SpectralTransformType st) |
| void | setTolerance (value_type tol) |
| void | setMaxIterations (size_type maxiter) |
| void | setNumberOfEigenValues (size_type nev) |
| void | setNumberOfEigenValuesConverged (size_type ncv) |
Methods | |
| bool | initialized () const |
| virtual void | clear () |
| virtual void | init ()=0 |
| BOOST_PARAMETER_MEMBER_FUNCTION ((solve_return_type), solve, tag,(required(matrixA,(sparse_matrix_ptrtype))(matrixB,(sparse_matrix_ptrtype)))(optional(maxit,(size_type), 1000)(tolerance,(double), 1e-11))) | |
| virtual solve_return_type | solve (MatrixSparse< value_type > &matrix_A, int nev, int ncv, const double tol, const unsigned int m_its)=0 |
| solve_return_type | solve (boost::shared_ptr< MatrixSparse< value_type > > &matrix_A, int nev, int ncv, const double tol, const unsigned int m_its) |
| virtual solve_return_type | solve (MatrixSparse< value_type > &matrix_A, MatrixSparse< value_type > &matrix_B, int nev, int ncv, const double tol, const unsigned int m_its)=0 |
| solve_return_type | solve (boost::shared_ptr< MatrixSparse< value_type > > &matrix_A, boost::shared_ptr< MatrixSparse< value_type > > &matrix_B, int nev, int ncv, const double tol, const unsigned int m_its) |
Protected Attributes | |
| std::string | M_prefix |
| EigenSolverType | M_eigen_solver_type |
| EigenProblemType | M_eigen_problem_type |
| PositionOfSpectrum | M_position_of_spectrum |
| SpectralTransformType | M_spectral_transform |
| bool | M_is_initialized |
| size_type | M_nev |
| number of eigenvalues | |
| size_type | M_ncv |
| number of eigenvalues | |
| size_type | M_maxit |
| max number of iterations | |
| value_type | M_tolerance |
| tolerance | |
Constructors, destructor | |
| SolverEigen () | |
| SolverEigen (po::variables_map const &vm, std::string const &prefix="") | |
| SolverEigen (SolverEigen const &) | |
| virtual | ~SolverEigen () |
| virtual eigenpair_type | eigenPair (unsigned int i)=0 |
| virtual eigenmodes_type | eigenModes ()=0 |
| static boost::shared_ptr < SolverEigen< value_type > > | build (const SolverPackage solver_package=SOLVERS_SLEPC) |
| static boost::shared_ptr < SolverEigen< value_type > > | build (po::variables_map const &vm, std::string const &prefix=std::string()) |
base class for eigen solvers
| Feel::SolverEigen< T >::SolverEigen | ( | ) |
Constructor. Initializes Solver data structures
| Feel::SolverEigen< T >::SolverEigen | ( | po::variables_map const & | vm, |
| std::string const & | prefix = "" |
||
| ) |
Constructor. Initializes Solver data structures
The prefix parameter allows to set different eigensolver options for different eigensolver. It allows to distinguish between these options
// register two slepc eigensolver options add_options( solvereigen_options( "eigen1" ) ).add_options( solvereigen_options( "eigen2" )); // build an eigen solver associated with option set eigen1 SolverEigen<double>::build( vm, "eigen1" );
| vm | variables map |
| prefix | string that allows for various options of the same type |
| Feel::SolverEigen< T >::SolverEigen | ( | SolverEigen< T > const & | eis | ) |
copy constructor
| Feel::SolverEigen< T >::~SolverEigen | ( | ) | [virtual] |
Destructor.
| boost::shared_ptr< SolverEigen< T > > Feel::SolverEigen< T >::build | ( | po::variables_map const & | vm, |
| std::string const & | prefix = std::string() |
||
| ) | [static] |
Builds a SolverEigen using the linear solver package specified by vm
| vm | variables_map that contains the command line options and their defaults |
| prefix | string that allows for various options of the same type |
| boost::shared_ptr< SolverEigen< T > > Feel::SolverEigen< T >::build | ( | const SolverPackage | solver_package = SOLVERS_SLEPC | ) | [static] |
Builds a SolverEigen using the linear solver package specified by solver_package
| virtual void Feel::SolverEigen< T >::clear | ( | ) | [inline, virtual] |
Release all memory and clear data structures.
| virtual eigenpair_type Feel::SolverEigen< T >::eigenPair | ( | unsigned int | i | ) | [pure virtual] |
Returns the ith eigenvalue (real and imaginary part), and copies the \ ith eigen vector to the solution vector.
| EigenProblemType Feel::SolverEigen< T >::eigenProblemType | ( | ) | const [inline] |
Returns the type of the eigen problem.
References Feel::SolverEigen< T >::M_eigen_problem_type.
| EigenSolverType Feel::SolverEigen< T >::eigenSolverType | ( | ) | const [inline] |
Returns the type of eigensolver to use.
References Feel::SolverEigen< T >::M_eigen_solver_type.
| virtual void Feel::SolverEigen< T >::init | ( | ) | [pure virtual] |
Initialize data structures if not done so already.
| bool Feel::SolverEigen< T >::initialized | ( | ) | const [inline] |
References Feel::SolverEigen< T >::M_is_initialized.
| size_type Feel::SolverEigen< T >::maxIterations | ( | ) | const [inline] |
Returns the maximum number of iterations
References Feel::SolverEigen< T >::M_maxit.
| size_type Feel::SolverEigen< T >::numberOfEigenvalues | ( | ) | const [inline] |
Returns the number of eigenvalues to compute
References Feel::SolverEigen< T >::M_nev.
| size_type Feel::SolverEigen< T >::numberOfEigenvaluesConverged | ( | ) | const [inline] |
Returns the number of eigenvalues to compute
References Feel::SolverEigen< T >::M_ncv.
| PositionOfSpectrum Feel::SolverEigen< T >::postitionOfSpectrum | ( | ) | const [inline] |
Returns the position of the spectrum to compute.
References Feel::SolverEigen< T >::M_position_of_spectrum.
| std::string const& Feel::SolverEigen< T >::prefix | ( | ) | const [inline] |
References Feel::SolverEigen< T >::M_prefix.
| void Feel::SolverEigen< T >::setEigenProblemType | ( | EigenProblemType | ept | ) | [inline] |
Sets the type of the eigenproblem.
References Feel::SolverEigen< T >::M_eigen_problem_type.
| void Feel::SolverEigen< T >::setEigenSolverType | ( | const EigenSolverType | est | ) | [inline] |
Sets the type of eigensolver to use.
References Feel::SolverEigen< T >::M_eigen_solver_type.
| void Feel::SolverEigen< T >::setMaxIterations | ( | size_type | maxiter | ) | [inline] |
set the max number of iterations
| maxiter | maximum number of iterations |
References Feel::SolverEigen< T >::M_maxit.
| void Feel::SolverEigen< T >::setNumberOfEigenValues | ( | size_type | nev | ) | [inline] |
set the number of eigenvalues to compute
References Feel::SolverEigen< T >::M_nev.
| void Feel::SolverEigen< T >::setNumberOfEigenValuesConverged | ( | size_type | ncv | ) | [inline] |
set the number of eigenvalues to have converged
References Feel::SolverEigen< T >::M_ncv.
| void Feel::SolverEigen< T >::setPositionOfSpectrum | ( | PositionOfSpectrum | pos | ) | [inline] |
Sets the position of the spectrum.
References Feel::SolverEigen< T >::M_position_of_spectrum.
| void Feel::SolverEigen< T >::setSpectralTransform | ( | SpectralTransformType | st | ) | [inline] |
set the spectral transform
References Feel::SolverEigen< T >::M_spectral_transform.
| void Feel::SolverEigen< T >::setTolerance | ( | value_type | tol | ) | [inline] |
| virtual solve_return_type Feel::SolverEigen< T >::solve | ( | MatrixSparse< value_type > & | matrix_A, |
| MatrixSparse< value_type > & | matrix_B, | ||
| int | nev, | ||
| int | ncv, | ||
| const double | tol, | ||
| const unsigned int | m_its | ||
| ) | [pure virtual] |
Solves the generalized eigen value problem
and returns the number of converged eigenpairs and the number of iterations.
| solve_return_type Feel::SolverEigen< T >::solve | ( | boost::shared_ptr< MatrixSparse< value_type > > & | matrix_A, |
| int | nev, | ||
| int | ncv, | ||
| const double | tol, | ||
| const unsigned int | m_its | ||
| ) | [inline] |
Solves the standard eigen problem and returns the number of converged eigenpairs and the number of iterations.
References Feel::SolverEigen< T >::solve().
| solve_return_type Feel::SolverEigen< T >::solve | ( | boost::shared_ptr< MatrixSparse< value_type > > & | matrix_A, |
| boost::shared_ptr< MatrixSparse< value_type > > & | matrix_B, | ||
| int | nev, | ||
| int | ncv, | ||
| const double | tol, | ||
| const unsigned int | m_its | ||
| ) | [inline] |
Solves the generalized eigen value problem
and returns the number of converged eigenpairs and the number of iterations.
References Feel::SolverEigen< T >::solve().
| virtual solve_return_type Feel::SolverEigen< T >::solve | ( | MatrixSparse< value_type > & | matrix_A, |
| int | nev, | ||
| int | ncv, | ||
| const double | tol, | ||
| const unsigned int | m_its | ||
| ) | [pure virtual] |
Solves the standard eigen problem and returns the number of converged eigenpairs and the number of iterations.
Referenced by Feel::SolverEigen< T >::solve().
| SpectralTransformType Feel::SolverEigen< T >::spectralTransform | ( | ) | const [inline] |
Returns the spectral transforms
References Feel::SolverEigen< T >::M_spectral_transform.
| value_type Feel::SolverEigen< T >::tolerance | ( | ) | const [inline] |
Returns the tolerance to be reached by eigenvalue solver
References Feel::SolverEigen< T >::M_tolerance.
EigenProblemType Feel::SolverEigen< T >::M_eigen_problem_type [protected] |
Enum stating which type of eigen problem we deal with.
Referenced by Feel::SolverEigen< T >::eigenProblemType(), and Feel::SolverEigen< T >::setEigenProblemType().
EigenSolverType Feel::SolverEigen< T >::M_eigen_solver_type [protected] |
Enum stating which type of eigensolver to use.
Referenced by Feel::SolverEigen< T >::eigenSolverType(), and Feel::SolverEigen< T >::setEigenSolverType().
bool Feel::SolverEigen< T >::M_is_initialized [protected] |
Flag indicating if the data structures have been initialized.
Referenced by Feel::SolverEigen< T >::initialized().
PositionOfSpectrum Feel::SolverEigen< T >::M_position_of_spectrum [protected] |
Enum stating where to evaluate the spectrum.
Referenced by Feel::SolverEigen< T >::postitionOfSpectrum(), and Feel::SolverEigen< T >::setPositionOfSpectrum().
std::string Feel::SolverEigen< T >::M_prefix [protected] |
prefix to differentiate eigen solvers
Referenced by Feel::SolverEigen< T >::prefix().
SpectralTransformType Feel::SolverEigen< T >::M_spectral_transform [protected] |
spectral transformation type
Referenced by Feel::SolverEigen< T >::setSpectralTransform(), and Feel::SolverEigen< T >::spectralTransform().
1.7.4