Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do we *need* to always compute eigenvalues in SolverCG? #6074

Open
bangerth opened this issue Oct 11, 2024 · 1 comment
Open

Do we *need* to always compute eigenvalues in SolverCG? #6074

bangerth opened this issue Oct 11, 2024 · 1 comment

Comments

@bangerth
Copy link
Contributor

A recent report on the ASPECT forum (https://community.geodynamics.org/t/issues-with-block-gmg-solver-scheme/3703) shows that SolverCG now requires LAPACK. That surprised me, and it turns out that it is because we are always computing the eigenvalue approximations:

template <typename VectorType>
DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
inline void SolverCG<VectorType>::compute_eigs_and_cond(
  const std::vector<typename VectorType::value_type> &diagonal,
  const std::vector<typename VectorType::value_type> &offdiagonal,
  const boost::signals2::signal<void(const std::vector<double> &)>
                                              &eigenvalues_signal,
  const boost::signals2::signal<void(double)> &cond_signal)
{
  // Avoid computing eigenvalues unless they are needed.
  if (!cond_signal.empty() || !eigenvalues_signal.empty())                // ******************* apparently there are signals attached
    {
      TridiagonalMatrix<typename VectorType::value_type> T(diagonal.size(),
                                                           true);
      for (size_type i = 0; i < diagonal.size(); ++i)
        {
          T(i, i) = diagonal[i];
          if (i < diagonal.size() - 1)
            T(i, i + 1) = offdiagonal[i];
        }
      T.compute_eigenvalues();                                 // ***************** triggers call to LAPACK

      [...]

But I can't seem to find in ASPECT or deal.II where we are actually attaching signals that are monitoring the eigenvalues or condition number. Where is this place, and is this on purpose?

@tjhei
Copy link
Member

tjhei commented Oct 11, 2024

But I can't seem to find in ASPECT or deal.II where we are actually attaching signals that are monitoring the eigenvalues or condition number. Where is this place, and is this on purpose?

Yes, we need eigenvalue estimates for the Chebyshev smoother for GMG:

mg_smoother_A[level].estimate_eigenvalues(temp_velocity);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants