![]() |
Reference documentation for deal.II version 9.1.1
|
Functions | |
| template<typename NumberType > | |
| std::array< NumberType, 3 > | givens_rotation (const NumberType &x, const NumberType &y) |
| template<typename NumberType > | |
| std::array< NumberType, 3 > | hyperbolic_rotation (const NumberType &x, const NumberType &y) |
| template<typename OperatorType , typename VectorType > | |
| double | lanczos_largest_eigenvalue (const OperatorType &H, const VectorType &v0, const unsigned int k, VectorMemory< VectorType > &vector_memory, std::vector< double > *eigenvalues=nullptr) |
| template<typename OperatorType , typename VectorType > | |
| void | chebyshev_filter (VectorType &x, const OperatorType &H, const unsigned int n, const std::pair< double, double > unwanted_spectrum, const double tau, VectorMemory< VectorType > &vector_memory) |
A collection of linear-algebra utilities.
| std::array<NumberType, 3> Utilities::LinearAlgebra::givens_rotation | ( | const NumberType & | x, |
| const NumberType & | y | ||
| ) |
Return the elements of a continuous Givens rotation matrix and the norm of the input vector.
That is for a given pair x and y, return
,
and
such that
| std::array<NumberType, 3> Utilities::LinearAlgebra::hyperbolic_rotation | ( | const NumberType & | x, |
| const NumberType & | y | ||
| ) |
Return the elements of a hyperbolic rotation matrix.
That is for a given pair x and y, return
,
and
such that
Real valued solution only exists if
, the function will throw an error otherwise.
| double Utilities::LinearAlgebra::lanczos_largest_eigenvalue | ( | const OperatorType & | H, |
| const VectorType & | v0, | ||
| const unsigned int | k, | ||
| VectorMemory< VectorType > & | vector_memory, | ||
| std::vector< double > * | eigenvalues = nullptr |
||
| ) |
Estimate an upper bound for the largest eigenvalue of H by a k -step Lanczos process starting from the initial vector v0. Typical values of k are below 10. This estimator computes a k-step Lanczos decomposition
where
contains k Lanczos basis,
,
is the tridiagonal Lanczos matrix,
is a residual vector
, and
is the k-th canonical basis of
. The returned value is
. If eigenvalues is not nullptr, the eigenvalues of
will be written there.
vector_memory is used to allocate memory for temporary vectors. OperatorType has to provide vmult operation with VectorType.
This function implements the algorithm from
.| void Utilities::LinearAlgebra::chebyshev_filter | ( | VectorType & | x, |
| const OperatorType & | H, | ||
| const unsigned int | n, | ||
| const std::pair< double, double > | unwanted_spectrum, | ||
| const double | tau, | ||
| VectorMemory< VectorType > & | vector_memory | ||
| ) |
Apply Chebyshev polynomial of the operator H to x. For a non-defective operator
with a complete set of eigenpairs
, the action of a polynomial filter
is given by
, where
. Thus by appropriately choosing the polynomial filter, one can alter the eigenmodes contained in
.
This function uses Chebyshev polynomials of first kind. Below is an example of polynomial
of degree
normalized to unity at
.
|
By introducing a linear mapping
from unwanted_spectrum to
, we can dump the corresponding modes in x. The higher the polynomial degree
, the more rapid it grows outside of the
. In order to avoid numerical overflow, we normalize polynomial filter to unity at tau. Thus, the filtered operator is
.
The action of the Chebyshev filter only requires evaluation of vmult() of H and is based on the recursion equation for Chebyshev polynomial of degree
:
with
and
.
vector_memory is used to allocate memory for temporary objects.
This function implements the algorithm (with a minor fix of sign of
) from
tau is equal to std::numeric_limits<double>::infinity(), no normalization will be performed.
1.8.16