ExcMessage ("Need to set at least two iterations to find eigenvalues."));
// set a very strict tolerance to force at least two iterations
- ReductionControl control (data.eig_cg_n_iterations, 1e-20, 1e-20);
+ ReductionControl control (data.eig_cg_n_iterations, 1e-35, 1e-10);
GrowingVectorMemory<VECTOR> memory;
VECTOR *rhs = memory.alloc();
VECTOR *dummy = memory.alloc();
- rhs->reinit(data.matrix_diagonal_inverse, true);
+ rhs->reinit(data.matrix_diagonal_inverse);
dummy->reinit(data.matrix_diagonal_inverse);
+
+ // heuristically, a right hand side close to a constant has been shown
+ // to quickly reveal the largest eigenvalue. however, avoid to use the
+ // exact constant because that might be not in the range space of some
+ // matrices (purely Neumann matrices with constant mode filtered out by
+ // orthogonal projection in the matrix-vector product)
*rhs = 1./std::sqrt(static_cast<double>(matrix.m()));
+ if (rhs->locally_owned_elements().is_element(0))
+ (*rhs)(0) = 0.;
+ rhs->compress(VectorOperation::insert);
internal::PreconditionChebyshev::EigenvalueTracker eigenvalue_tracker;
SolverCG<VECTOR> solver (control, memory);
catch (SolverControl::NoConvergence &)
{
}
- Assert(control.last_step() >= 2,
- ExcMessage("Could not find eigenvalues"));
memory.free(dummy);
memory.free(rhs);
DEAL:2d::Cycle 0
DEAL:2d::Number of degrees of freedom: 81
-DEAL:2d:cg::Starting value 1.00
-DEAL:2d:cg::Convergence step 3 value 0
-DEAL:2d:cg::Starting value 1.00
-DEAL:2d:cg::Failure step 10 value 0
-DEAL:2d:cg::Starting value 1.00
+DEAL:2d:cg::Starting value 0.943
+DEAL:2d:cg::Convergence step 2 value 0
+DEAL:2d:cg::Starting value 0.980
+DEAL:2d:cg::Convergence step 8 value 0
+DEAL:2d:cg::Starting value 0.994
DEAL:2d:cg::Failure step 10 value 0.00110
DEAL:2d:cg::Starting value 0.132
DEAL:2d:cg::Convergence step 4 value 0
DEAL:2d::
DEAL:2d::Cycle 1
DEAL:2d::Number of degrees of freedom: 289
-DEAL:2d:cg::Starting value 1.00
-DEAL:2d:cg::Convergence step 3 value 0
-DEAL:2d:cg::Starting value 1.00
-DEAL:2d:cg::Failure step 10 value 0
-DEAL:2d:cg::Starting value 1.00
+DEAL:2d:cg::Starting value 0.943
+DEAL:2d:cg::Convergence step 2 value 0
+DEAL:2d:cg::Starting value 0.980
+DEAL:2d:cg::Convergence step 8 value 0
+DEAL:2d:cg::Starting value 0.994
DEAL:2d:cg::Failure step 10 value 0.00110
-DEAL:2d:cg::Starting value 1.00
+DEAL:2d:cg::Starting value 0.998
DEAL:2d:cg::Failure step 10 value 0.153
DEAL:2d:cg::Starting value 0.0677
DEAL:2d:cg::Convergence step 5 value 0
DEAL:2d::
DEAL:2d::Cycle 2
DEAL:2d::Number of degrees of freedom: 1089
-DEAL:2d:cg::Starting value 1.00
-DEAL:2d:cg::Convergence step 3 value 0
-DEAL:2d:cg::Starting value 1.00
-DEAL:2d:cg::Failure step 10 value 0
-DEAL:2d:cg::Starting value 1.00
+DEAL:2d:cg::Starting value 0.943
+DEAL:2d:cg::Convergence step 2 value 0
+DEAL:2d:cg::Starting value 0.980
+DEAL:2d:cg::Convergence step 8 value 0
+DEAL:2d:cg::Starting value 0.994
DEAL:2d:cg::Failure step 10 value 0.00110
-DEAL:2d:cg::Starting value 1.00
+DEAL:2d:cg::Starting value 0.998
DEAL:2d:cg::Failure step 10 value 0.153
DEAL:2d:cg::Starting value 1.00
DEAL:2d:cg::Failure step 10 value 1.07
DEAL:2d::
DEAL:3d::Cycle 0
DEAL:3d::Number of degrees of freedom: 125
-DEAL:3d:cg::Starting value 1.00
-DEAL:3d:cg::Convergence step 3 value 0
-DEAL:3d:cg::Starting value 1.00
-DEAL:3d:cg::Failure step 10 value 0
+DEAL:3d:cg::Starting value 0.981
+DEAL:3d:cg::Convergence step 2 value 0
+DEAL:3d:cg::Starting value 0.996
+DEAL:3d:cg::Convergence step 10 value 0
DEAL:3d:cg::Starting value 0.125
DEAL:3d:cg::Convergence step 5 value 0
DEAL:3d::
DEAL:3d::Cycle 1
DEAL:3d::Number of degrees of freedom: 729
-DEAL:3d:cg::Starting value 1.00
-DEAL:3d:cg::Convergence step 3 value 0
-DEAL:3d:cg::Starting value 1.00
-DEAL:3d:cg::Failure step 10 value 0
-DEAL:3d:cg::Starting value 1.00
+DEAL:3d:cg::Starting value 0.981
+DEAL:3d:cg::Convergence step 2 value 0
+DEAL:3d:cg::Starting value 0.996
+DEAL:3d:cg::Convergence step 10 value 0
+DEAL:3d:cg::Starting value 0.999
DEAL:3d:cg::Failure step 10 value 0.000695
DEAL:3d:cg::Starting value 0.0479
DEAL:3d:cg::Convergence step 4 value 0
DEAL:3d::
DEAL:3d::Cycle 2
DEAL:3d::Number of degrees of freedom: 4913
-DEAL:3d:cg::Starting value 1.00
-DEAL:3d:cg::Convergence step 3 value 0
-DEAL:3d:cg::Starting value 1.00
-DEAL:3d:cg::Failure step 10 value 0
-DEAL:3d:cg::Starting value 1.00
+DEAL:3d:cg::Starting value 0.981
+DEAL:3d:cg::Convergence step 2 value 0
+DEAL:3d:cg::Starting value 0.996
+DEAL:3d:cg::Convergence step 10 value 0
+DEAL:3d:cg::Starting value 0.999
DEAL:3d:cg::Failure step 10 value 0.000695
DEAL:3d:cg::Starting value 1.00
DEAL:3d:cg::Failure step 10 value 0.0952