Class for the ARPACK eigensolver. More...
#include <eigen_solver.h>
Public Member Functions | |
ARPACK () | |
Constructor. More... | |
ARPACK (const ARPACK &) | |
Empty copy constructor. More... | |
virtual | ~ARPACK () |
Destructor, delete the linear solver. More... | |
int & | narnoldi () |
Access function for the number of Arnoldi vectors. More... | |
const int & | narnoldi () const |
Access function for the number of Arnoldi vectors (const version) More... | |
void | enable_compute_eigenvectors () |
Set to enable the computation of the eigenvectors (default) More... | |
void | disable_compute_eigenvectors () |
Set to disable the computation of the eigenvectors. More... | |
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) |
Solve the eigen problem. More... | |
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) |
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 where is complex while 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 | get_eigenvalues_left_of_shift () |
Set the desired eigenvalues to be left of the shift. More... | |
void | get_eigenvalues_right_of_shift () |
Set the desired eigenvalues to be right of the shift. More... | |
void | track_eigenvalue_real_part () |
Set the real part to be the quantity of interest (default) More... | |
void | track_eigenvalue_imaginary_part () |
Set the imaginary part fo the quantity of interest. More... | |
void | track_eigenvalue_magnitude () |
Set the magnitude to be the quantity of interest. More... | |
LinearSolver *& | linear_solver_pt () |
Return a pointer to the linear solver object. More... | |
LinearSolver *const & | linear_solver_pt () const |
Return a pointer to the linear solver object (const version) More... | |
Public Member Functions inherited from oomph::EigenSolver | |
EigenSolver () | |
Empty constructor. More... | |
EigenSolver (const EigenSolver &) | |
Empty copy constructor. More... | |
virtual | ~EigenSolver () |
Empty destructor. 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... | |
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... | |
LinearAlgebraDistribution * | distribution_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... | |
Private Attributes | |
LinearSolver * | Linear_solver_pt |
Pointer to a linear solver. More... | |
LinearSolver * | Default_linear_solver_pt |
Pointer to a default linear solver. More... | |
int | Spectrum |
Integer to set whether the real, imaginary or magnitude is required to be small or large. More... | |
int | NArnoldi |
Number of Arnoldi vectors to compute. More... | |
bool | Small |
Boolean to set which part of the spectrum left (default) or right of the shifted value. More... | |
bool | Compute_eigenvectors |
Boolean to indicate whether or not to compute the eigenvectors. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from oomph::DistributableLinearAlgebraObject | |
void | clear_distribution () |
clear the distribution of this distributable linear algebra object More... | |
Protected Attributes inherited from oomph::EigenSolver | |
double | Sigma_real |
Double value that represents the real part of the shift in shifted eigensolvers. More... | |
Class for the ARPACK eigensolver.
Definition at line 175 of file eigen_solver.h.
oomph::ARPACK::ARPACK | ( | ) |
Constructor.
Constructor, set default values and set the initial linear solver to be superlu.
Definition at line 49 of file eigen_solver.cc.
References Default_linear_solver_pt, and Linear_solver_pt.
|
inline |
Empty copy constructor.
Definition at line 205 of file eigen_solver.h.
|
virtual |
Destructor, delete the linear solver.
Destructor, delete the default linear solver.
Definition at line 62 of file eigen_solver.cc.
References Default_linear_solver_pt.
|
inline |
Set to disable the computation of the eigenvectors.
Definition at line 229 of file eigen_solver.h.
References Compute_eigenvectors.
|
inline |
Set to enable the computation of the eigenvectors (default)
Definition at line 223 of file eigen_solver.h.
References Compute_eigenvectors.
|
inline |
Set the desired eigenvalues to be left of the shift.
Definition at line 267 of file eigen_solver.h.
References Small.
|
inline |
Set the desired eigenvalues to be right of the shift.
Definition at line 273 of file eigen_solver.h.
References Small.
|
inline |
Return a pointer to the linear solver object.
Definition at line 297 of file eigen_solver.h.
References Linear_solver_pt.
|
inline |
Return a pointer to the linear solver object (const version)
Definition at line 303 of file eigen_solver.h.
References Linear_solver_pt.
|
inline |
Access function for the number of Arnoldi vectors.
Definition at line 211 of file eigen_solver.h.
References NArnoldi.
|
inline |
Access function for the number of Arnoldi vectors (const version)
Definition at line 217 of file eigen_solver.h.
References NArnoldi.
|
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. Eigenvalues may be infinite and are therefore returned as where is complex while 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.
Implements oomph::EigenSolver.
Definition at line 254 of file eigen_solver.h.
References oomph::oomph_info.
|
virtual |
Solve the eigen problem.
Use ARPACK to solve an eigen problem that is assembled by elements in a mesh in a Problem object.
Implements oomph::EigenSolver.
Definition at line 72 of file eigen_solver.cc.
References oomph::DistributableLinearAlgebraObject::build_distribution(), oomph::DoubleVector::clear(), oomph::Problem::communicator_pt(), Compute_eigenvectors, oomph::LinearSolver::disable_doc_time(), oomph::LinearSolver::disable_resolve(), oomph::DistributableLinearAlgebraObject::distribution_pt(), oomph::LinearSolver::enable_resolve(), oomph::Problem::get_eigenproblem_matrices(), i, Linear_solver_pt, NArnoldi, oomph::Problem::ndof(), oomph::oomph_info, oomph::LinearSolver::resolve(), oomph::EigenSolver::Sigma_real, Small, oomph::LinearSolver::solve(), and Spectrum.
|
inline |
Set the imaginary part fo the quantity of interest.
Definition at line 285 of file eigen_solver.h.
References Spectrum.
|
inline |
Set the magnitude to be the quantity of interest.
Definition at line 291 of file eigen_solver.h.
References Spectrum.
|
inline |
Set the real part to be the quantity of interest (default)
Definition at line 279 of file eigen_solver.h.
References Spectrum.
|
private |
Boolean to indicate whether or not to compute the eigenvectors.
Definition at line 197 of file eigen_solver.h.
Referenced by disable_compute_eigenvectors(), enable_compute_eigenvectors(), and solve_eigenproblem_legacy().
|
private |
Pointer to a default linear solver.
Definition at line 182 of file eigen_solver.h.
|
private |
Pointer to a linear solver.
Definition at line 179 of file eigen_solver.h.
Referenced by ARPACK(), linear_solver_pt(), and solve_eigenproblem_legacy().
|
private |
Number of Arnoldi vectors to compute.
Definition at line 190 of file eigen_solver.h.
Referenced by narnoldi(), and solve_eigenproblem_legacy().
|
private |
Boolean to set which part of the spectrum left (default) or right of the shifted value.
Definition at line 194 of file eigen_solver.h.
Referenced by get_eigenvalues_left_of_shift(), get_eigenvalues_right_of_shift(), and solve_eigenproblem_legacy().
|
private |
Integer to set whether the real, imaginary or magnitude is required to be small or large.
Definition at line 187 of file eigen_solver.h.
Referenced by solve_eigenproblem_legacy(), track_eigenvalue_imaginary_part(), track_eigenvalue_magnitude(), and track_eigenvalue_real_part().