From b79cf2f7a3b7bd59953aaf1f36a8cfad30fa27d0 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Tue, 9 Sep 2014 17:15:34 +0200 Subject: [PATCH] comment on spurious eigenvalues in Step-36 --- examples/step-36/doc/intro.dox | 16 ++++++++++++++++ examples/step-36/step-36.cc | 22 ++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/examples/step-36/doc/intro.dox b/examples/step-36/doc/intro.dox index f0eb3867cb..32f9a74845 100644 --- a/examples/step-36/doc/intro.dox +++ b/examples/step-36/doc/intro.dox @@ -93,6 +93,22 @@ $A$ and $M$ that we will solve in the current tutorial program. We will want to solve it for the lowermost few eigenvalue/eigenfunction pairs. +Zero Dirichlet boundary conditions result in some degrees of freedom (DoFs) being constrained. +Those DoFs will not be eliminated from the algebraic system. +Rather, during assembly process +the condensed matrices $A$ and $M$ are made to have zero rows and columns for the corresponding +DoFs and non-zero diagonal elements. +For the local matrices these diagonal elements, if non-zero, +are set to their absolute value. Otherwise, they are set to the average of +absolute values of the diagonal. +This results in a block-diagonal structure of $A$ and $M$, where one block +corresponds to the eigenpairs of interest and the other introduces +spurious (real) positive eigenvalues $\varepsilon_{h,i}=A_{ii}/M_{ii}$ (where $i$ are constrained DoFs). +In order to filter out the spurious eigenvalues, one could scale the diagonal elements of either matrix +thus shifting them away from the frequency of interest in the eigen-spectrum. +However, this strategy was not pursued here as those eigenvalues happen to be greater than the lowest +five that we will calculate. +

Implementation details

The program below is essentially just a slightly modified version of diff --git a/examples/step-36/step-36.cc b/examples/step-36/step-36.cc index acf41d7fa2..4b5c78c59b 100644 --- a/examples/step-36/step-36.cc +++ b/examples/step-36/step-36.cc @@ -292,6 +292,28 @@ namespace Step36 // be compressed as no more entries will be added: stiffness_matrix.compress (VectorOperation::add); mass_matrix.compress (VectorOperation::add); + + + // Before leaving the function, + // we calculate spurious eigenvalues, + // introduced to the system by zero Dirichlet constraints. + double min_ev = 1e+10, + max_ev = -min_ev; + + for (unsigned int ind = 0; ind < dof_handler.n_dofs(); ind++) + if (constraints.is_constrained(ind)) + { + const double ev = stiffness_matrix(ind,ind)/mass_matrix(ind,ind); + if ( min_ev > ev ) + min_ev = ev; + if ( max_ev < ev ) + max_ev = ev; + } + + std::cout << " Spurious eigenvalues are in " + << "["<