]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Comment in the call to set_which_eigenpairs. Make sure constrained DoFs have
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 1 Jul 2009 08:58:30 +0000 (08:58 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 1 Jul 2009 08:58:30 +0000 (08:58 +0000)
non-zero diagonal entries in the matrix.

git-svn-id: https://svn.dealii.org/trunk@19010 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-36/step-36.cc

index 347b9931e9ee9cd87a070630acf3116817c305ef..008ee2bb216e6d9f6a5ea18b2069534662e8f0b7 100644 (file)
@@ -215,6 +215,20 @@ void EigenvalueProblem<dim>::assemble_system ()
                                 // vectors in an assembled state.
   stiffness_matrix.compress();
   mass_matrix.compress();
+
+                                  // make sure that the diagonal entries of
+                                  // constrained degrees of freedom are
+                                  // non-zero to ensure that the matrix is
+                                  // actually invertible
+  for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
+    if (constraints.is_constrained(i))
+      {
+       stiffness_matrix.set (i, i, 1);
+       mass_matrix.set (i, i, 1);
+      }
+  
+  stiffness_matrix.compress();
+  mass_matrix.compress();  
 }
 
 
@@ -230,7 +244,7 @@ void EigenvalueProblem<dim>::solve ()
                                 // choose which part of the spectrum to
                                 // solve for
 
-  //  eigensolver.set_which_eigenpairs ();
+  eigensolver.set_which_eigenpairs (EPS_SMALLEST_MAGNITUDE);
 
                                 // then actually solve the system,
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.