5#ifndef SPARSELINEAREIGENSYSTEM_BASE_H
6#define SPARSELINEAREIGENSYSTEM_BASE_H
18 PetscErrorCode monitor_function(EPS eps, PetscInt its,PetscInt nconv,
19 PetscScalar *eigr,PetscScalar *eigi,
21 PetscInt nest,
void *mctx) {
22 std::cout <<
"[MONITOR] nconv = " << nconv;
23 std::cout <<
" its = " << its <<
"\n";
24 std::cout <<
"[MONITOR] est_err() = ";
25 for(
int i = 0; i < nest; i++) {
26 std::cout << errest[i] <<
" ";
37 template <
typename _Type>
38 class SparseLinearEigenSystem :
public LinearEigenSystem_base {
45 SparseLinearEigenSystem(SparseMatrix<_Type>* Aptr, SparseMatrix<_Type>* Bptr);
48 ~SparseLinearEigenSystem();
52 unsigned get_nconv()
const;
56 void set_nev(
unsigned n);
60 void set_target(std::complex<double> target);
65 void set_order(std::string order_string);
68 bool& region_defined();
76 void set_region(
const double& a,
const double& b,
const double& c,
const double& d);
79 bool& guess_defined();
83 void set_initial_guess(
const DenseVector<_Type>& guess);
91 void eigensolve_slepc();
102 bool m_region_defined;
104 bool m_guess_defined;
107 double m_real_left,m_real_right,m_imag_bottom,m_imag_top;
110 DenseVector<_Type> m_initial_guess;
113 SparseMatrix<_Type>* m_pA;
115 SparseMatrix<_Type>* m_pB;
Specification of the linear eigensystem base class.
A matrix class that constructs a SPARSE matrix as an STL Vector of SparseVectors, inheriting from Mat...
A collection of OO numerical routines aimed at simple (typical) applied problems in continuum mechani...