Function Dune::GDT::internal::smallest_nonzero_generalized_eigenvalue¶
Function template Dune::GDT::internal::smallest_nonzero_generalized_eigenvalue¶
-
template<class E>
double Dune::GDT::internal::smallest_nonzero_generalized_eigenvalue(const int &lhs, const int &rhs, const E &element, const std::string &matrix_pair)¶ The smallest strictly positive eigenvalue of
lhs x = lambda rhs x, ignoring the numerically zero ones. Shared by both estimators below: each of them is the maximum over all elements of the mesh width times (a power of) this eigenvalue, they only differ in which pair of local product matrices they feed in.Note
The lhs of both pairs is only positive semi-definite: the constants are in the kernel of the H1 product, and a cube’s order 2 Lagrange basis has an interior node whose basis function vanishes on the whole element boundary. That is why the zero eigenvalues are filtered out here instead of simply taking the minimum. Only the rhs has to be positive definite, which is all dsygv requires.
Note
The cutoff separating “numerically zero” from “genuinely nonzero” is relative to the spectrum, and rejects negative eigenvalues outright. Both matter, because the spectrum scales with the element: the eigenvalues of the H1/L2 pair are O(h^-2), those of the face/element L2 pair O(h^-1). - An absolute cutoff is a mesh-size-dependent statement about which modes count. On a 10^5 x 10^5 x 10^5 box the whole H1/L2 spectrum sits below 1e-7, so every mode reads as zero and no constant can be computed at all – even though the mesh is perfectly well behaved and the constant is the same 6 as on the unit cube. - The zero modes come out of lapack as ±eps * max|lambda|, so on a fine mesh (a large spectrum) the negative ones clear any fixed cutoff. Taking
abs(ev) > cutoffthen lets a negative mode through as the minimum, andsqrtof it is NaN – whichstd::maxsilently discards, leaving the estimate at itsmin()seed.