]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Make the drop tolerance a parameter.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 20 Aug 2008 13:08:59 +0000 (13:08 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 20 Aug 2008 13:08:59 +0000 (13:08 +0000)
git-svn-id: https://svn.dealii.org/trunk@16610 0785d39b-7218-0410-832d-ea1e28bc413d

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

index c99e0061d48b98ea7860f98408bcd8bf6b5e6df1..b53d41447225105e0f45456d955e31c3b23f172e 100644 (file)
@@ -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<double>       &dst,
                const Vector<double> &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<int> row_lengths (n_u);
     for (SparseMatrix<double>::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<double>::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();

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.