From 9e15229e5f92494172af6450411f64e66ba11c31 Mon Sep 17 00:00:00 2001 From: bangerth Date: Wed, 20 Aug 2008 13:08:59 +0000 Subject: [PATCH] Make the drop tolerance a parameter. git-svn-id: https://svn.dealii.org/trunk@16610 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-31/step-31.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/deal.II/examples/step-31/step-31.cc b/deal.II/examples/step-31/step-31.cc index c99e0061d4..b53d414472 100644 --- a/deal.II/examples/step-31/step-31.cc +++ b/deal.II/examples/step-31/step-31.cc @@ -119,7 +119,8 @@ class PreconditionerTrilinosAmg : public Subscriptor const unsigned int null_space_dimension, const bool higher_order_elements, const bool elliptic, - const bool output_details); + const bool output_details, + const double drop_tolerance = 1e-13); void vmult (Vector &dst, const Vector &src) const; @@ -143,7 +144,8 @@ void PreconditionerTrilinosAmg::initialize ( const unsigned int null_space_dimension, const bool elliptic, const bool higher_order_elements, - const bool output_details + const bool output_details, + const double drop_tolerance ) { const unsigned int n_u = matrix.m(); @@ -157,7 +159,7 @@ void PreconditionerTrilinosAmg::initialize ( std::vector row_lengths (n_u); for (SparseMatrix::const_iterator p = matrix.begin(); p != matrix.end(); ++p) - if (std::abs(p->value()) > 1e-13) + if (std::abs(p->value()) > drop_tolerance) ++row_lengths[p->row()]; Matrix.reset (new Epetra_CrsMatrix(Copy, *Map, &row_lengths[0], true)); @@ -173,7 +175,7 @@ void PreconditionerTrilinosAmg::initialize ( unsigned int index = 0; for (SparseMatrix::const_iterator p = matrix.begin(row); p != matrix.end(row); ++p) - if (std::abs(p->value()) > 1e-13) + if (std::abs(p->value()) > drop_tolerance) { row_indices[index] = p->column(); values[index] = p->value(); -- 2.39.5