Amg_preconditioner->initialize(stokes_preconditioner_matrix.block(0,0),
TrilinosWrappers::PreconditionAMG::AdditionalData
- (true, true, 5e-2, null_space, 0, false));
+ (true, true, 5e-2, null_space, 3, 0, false));
Mp_preconditioner = boost::shared_ptr<TrilinosWrappers::PreconditionIC>
(new TrilinosWrappers::PreconditionIC());
1e-8*temperature_rhs.l2_norm());
SolverCG<TrilinosWrappers::MPI::Vector> cg (solver_control);
- TrilinosWrappers::PreconditionSSOR preconditioner;
- preconditioner.initialize (temperature_matrix, 1.2);
+ TrilinosWrappers::PreconditionChebyshev preconditioner;
+ TrilinosWrappers::PreconditionChebyshev::AdditionalData data;
+ data.degree=3;
+ data.eigenvalue_ratio = 3;
+ data.max_eigenvalue = 2;
+ preconditioner.initialize (temperature_matrix, 3);
cg.solve (temperature_matrix, temperature_solution,
temperature_rhs, preconditioner);
* fact that some of the entries in the preconditioner matrix are zero
* and hence can be neglected.
*
- * The implementation is able to distinguish between matrices from
- * elliptic problems and convection dominated problems. We use the
- * standard options provided by Trilinos ML for elliptic problems,
- * except that we use a Chebyshev smoother instead of a symmetric
- * Gauss-Seidel smoother. For most elliptic problems, Chebyshev
- * provides a better damping of high frequencies (in the algebraic
- * sense) than Gauss-Seidel (SSOR).
+ * The implementation is able to distinguish between matrices from elliptic
+ * problems and convection dominated problems. We use the standard options
+ * provided by Trilinos ML for elliptic problems, except that we use a
+ * Chebyshev smoother instead of a symmetric Gauss-Seidel smoother. For
+ * most elliptic problems, Chebyshev provides a better damping of high
+ * frequencies (in the algebraic sense) than Gauss-Seidel (SSOR), and is
+ * faster (Chebyshev requires only some matrix-vector products, whereas SSOR
+ * requires substitutions which are more expensive).
*
* @ingroup TrilinosWrappers
* @ingroup Preconditioners
const bool higher_order_elements = false,
const double aggregation_threshold = 1e-4,
const std::vector<std::vector<bool> > &constant_modes = std::vector<std::vector<bool> > (1),
+ const unsigned int smoother_sweeps = 3,
const unsigned int smoother_overlap = 0,
const bool output_details = false);
*/
std::vector<std::vector<bool> > constant_modes;
+ /**
+ * Determines how many sweeps of the
+ * smoother should be performed. When
+ * the flag <tt>elliptic</tt> is set
+ * to <tt>true</tt>, i.e., for
+ * elliptic or almost elliptic
+ * problems, the polynomial degree of
+ * the Chebyshev smoother is set to
+ * <tt>smoother_sweeps</tt>. In the
+ * non-elliptic case,
+ * <tt>smoother_sweeps</tt> sets the
+ * number of SSOR relaxation sweeps
+ * for post-smoothing to be
+ * performed.
+ */
+ unsigned int smoother_sweeps;
+
/**
* Determines the overlap in
* the SSOR/Chebyshev error
const bool higher_order_elements,
const double aggregation_threshold,
const std::vector<std::vector<bool> > &constant_modes,
+ const unsigned int smoother_sweeps,
const unsigned int smoother_overlap,
const bool output_details)
:
higher_order_elements (higher_order_elements),
aggregation_threshold (aggregation_threshold),
constant_modes (constant_modes),
+ smoother_sweeps (smoother_sweeps),
smoother_overlap (smoother_overlap),
output_details (output_details)
{}
{
ML_Epetra::SetDefaults("SA",parameter_list);
parameter_list.set("smoother: type", "Chebyshev");
- parameter_list.set("smoother: sweeps", 4);
+ parameter_list.set("smoother: sweeps",
+ (int)additional_data.smoother_sweeps);
}
else
{
ML_Epetra::SetDefaults("NSSA",parameter_list);
parameter_list.set("aggregation: type", "Uncoupled");
parameter_list.set("aggregation: block scaling", true);
+ parameter_list.set("smoother: sweeps",
+ (int)additional_data.smoother_sweeps);
}
parameter_list.set("smoother: ifpack overlap",