Description

template<typename ScalarT>
class chrono::modal::ChGeneralizedEigenvalueSolver< ScalarT >

Base interface class for generalized eigenvalue solvers A*x = lambda*B*x.

Currently it is implied that the derived eigensolvers are iterative.

#include <ChGeneralizedEigenvalueSolver.h>

Collaboration diagram for chrono::modal::ChGeneralizedEigenvalueSolver< ScalarT >:

Public Types

using ScalarType = ScalarT
 

Public Member Functions

double GetTimeMatrixAssembly () const
 Get cumulative time for matrix assembly.
 
double GetTimeEigenSetup () const
 Get cumulative time for the eigensolver setup.
 
double GetTimeEigenSolver () const
 Get cumulative time for the eigensolver solution.
 
double GetTimeSolutionPostProcessing () const
 Get cumulative time for post-solver solution postprocessing.
 

Static Public Member Functions

static void SortRitzPairs (ChVectorDynamic< ScalarType > &eigvals, ChMatrixDynamic< ScalarType > &eigvects, std::function< bool(const ChVectorDynamic< ScalarType > &, int, int)> ordering_fun=[](const ChVectorDynamic< std::complex< double >> &eigv, int a, int b) { return std::abs(eigv(a))< std::abs(eigv(b));})
 Sort the eigenvalues and eigenvectors in the order specified by the ordering function in-place.
 
static double GetMaxResidual (const ChSparseMatrix &A, const ChSparseMatrix &B, const ChMatrixDynamic< ScalarType > &eigvects, const ChVectorDynamic< ScalarType > &eigvals)
 
static double GetMaxResidual (const ChSparseMatrix &K, const ChSparseMatrix &M, const ChSparseMatrix &Cq, const ChMatrixDynamic< ScalarType > &eigvects, const ChVectorDynamic< ScalarType > &eigvals)
 
static double GetMaxResidual (const ChSparseMatrix &K, const ChSparseMatrix &R, const ChSparseMatrix &M, const ChSparseMatrix &Cq, const ChMatrixDynamic< ScalarType > &eigvects, const ChVectorDynamic< ScalarType > &eigvals)
 
static double BuildUndampedSystem (const ChSparseMatrix &M, const ChSparseMatrix &K, const ChSparseMatrix &Cq, ChSparseMatrix &A, ChSparseMatrix &B, bool scaleCq)
 Build the quadratic eigenvalue problem matrix for the undamped case. More...
 
static double BuildDampedSystem (const ChSparseMatrix &M, const ChSparseMatrix &R, const ChSparseMatrix &K, const ChSparseMatrix &Cq, ChSparseMatrix &A, ChSparseMatrix &B, bool scaleCq)
 Build the quadratic eigenvalue problem matrix for the damped case. More...
 
static void InsertUniqueRitzPairs (const ChVectorDynamic< ScalarType > &eigvals_source, const ChMatrixDynamic< ScalarType > &eigvects_source, ChVectorDynamic< ScalarType > &eigvals_total, ChMatrixDynamic< ScalarType > &eigvects_total, std::function< double(ScalarType)> freq_from_eigval_fun, int &found_eigs, int num_eigvals_source, double equal_freq_tolerance=1e-4)
 Add unique ritz pairs to a wider set of ritz pairs. More...
 

Public Attributes

double tolerance = 1e-6
 tolerance for the iterative solver.
 
int max_iterations = 500
 upper limit for the number of iterations. If too low might not converge.
 
bool verbose = false
 turn to true to see some diagnostic.
 
bool sort_ritz_pairs = true
 sort the eigenvalues based on the smallest absolute value
 

Static Protected Member Functions

static Eigen::PermutationMatrix< Eigen::Dynamic, Eigen::Dynamic > GetPermutationMatrix (int num_elements, std::function< bool(int, int)> ordering_fun)
 Returns the permutation matrix to sort the given elements based on the ordering function.
 

Protected Attributes

ChTimer m_timer_matrix_assembly
 timer for matrix assembly
 
ChTimer m_timer_eigen_setup
 timer for eigensolver setup
 
ChTimer m_timer_eigen_solver
 timer for eigensolver solution
 
ChTimer m_timer_solution_postprocessing
 timer for conversion of eigensolver solution
 
const int m_min_subspace_size = 30
 

Friends

template<typename EigSolverType >
int Solve (EigSolverType &eig_solver, ChSparseMatrix &A, ChSparseMatrix &B, ChMatrixDynamic< typename EigSolverType::ScalarType > &eigvects, ChVectorDynamic< typename EigSolverType::ScalarType > &eigvals, const std::list< std::pair< int, typename EigSolverType::ScalarType >> &eig_requests, bool uniquify, int eigvects_clipping_length)
 

Member Function Documentation

◆ BuildDampedSystem()

template<typename ScalarT>
static double chrono::modal::ChGeneralizedEigenvalueSolver< ScalarT >::BuildDampedSystem ( const ChSparseMatrix M,
const ChSparseMatrix R,
const ChSparseMatrix K,
const ChSparseMatrix Cq,
ChSparseMatrix A,
ChSparseMatrix B,
bool  scaleCq 
)
inlinestatic

Build the quadratic eigenvalue problem matrix for the damped case.

The optional scaling of the Cq matrix improves the conditioning of the eigenvalue problem. If enabled, the user must take care of rescaling back the eigenvectors; e.g. eigvects.bottomRows(Cq.rows()) *= scaling The scaling value is returned by the function.

◆ BuildUndampedSystem()

template<typename ScalarT>
static double chrono::modal::ChGeneralizedEigenvalueSolver< ScalarT >::BuildUndampedSystem ( const ChSparseMatrix M,
const ChSparseMatrix K,
const ChSparseMatrix Cq,
ChSparseMatrix A,
ChSparseMatrix B,
bool  scaleCq 
)
inlinestatic

Build the quadratic eigenvalue problem matrix for the undamped case.

The optional scaling of the Cq matrix improves the conditioning of the eigenvalue problem. If enabled, the user must take care of rescaling back the eigenvectors; e.g. eigvects.bottomRows(Cq.rows()) *= scaling The scaling value is returned by the function.

◆ InsertUniqueRitzPairs()

template<typename ScalarT>
static void chrono::modal::ChGeneralizedEigenvalueSolver< ScalarT >::InsertUniqueRitzPairs ( const ChVectorDynamic< ScalarType > &  eigvals_source,
const ChMatrixDynamic< ScalarType > &  eigvects_source,
ChVectorDynamic< ScalarType > &  eigvals_total,
ChMatrixDynamic< ScalarType > &  eigvects_total,
std::function< double(ScalarType)>  freq_from_eigval_fun,
int &  found_eigs,
int  num_eigvals_source,
double  equal_freq_tolerance = 1e-4 
)
inlinestatic

Add unique ritz pairs to a wider set of ritz pairs.

The ('eigvals_source', 'eigvects_source') are going to be added to the ('eigvals_total', 'eigvects_total') set only if the frequency of the modes are unique with respect to the ones already stored. The 'freq_from_eigval_fun' function is used to extract the frequency from the eigenvalues. 'found_eigs' is the number of eigenvalues already stored in the ('eigvals_total', 'eigvects_total') set. Most of the times is equal to eigvects_total.cols(), but it might be less if some exceeding eigenvalues have been found. Similar consideration for 'num_eigvals_source'. 'equal_freq_tolerance' is the tolerance used to consider two frequencies as equal.


The documentation for this class was generated from the following file:
  • /builds/uwsbel/chrono/src/chrono_modal/ChGeneralizedEigenvalueSolver.h