]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix small problem.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sat, 18 Jul 1998 14:40:40 +0000 (14:40 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sat, 18 Jul 1998 14:40:40 +0000 (14:40 +0000)
git-svn-id: https://svn.dealii.org/trunk@448 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/numerics/matrices.cc

index f25cffd6d279a8211ab2dc14cbb78f9c70d131e3..91b7f988f173ec8def601551085e92ee2af5865c 100644 (file)
@@ -14,6 +14,7 @@
 
 #include <algorithm>
 #include <set>
+#include <cmath>
 
 
 
@@ -220,7 +221,15 @@ void MatrixCreator<dim>::create_boundary_mass_matrix (const DoFHandler<dim>    &
                                           // points and finally all of its
                                           // entries in the cell matrix and
                                           // vector should be zero. If not, we
-                                          // throw an error
+                                          // throw an error (note: because of
+                                          // the evaluation of the shape
+                                          // functions only up to machine
+                                          // precision, the term "must be zero"
+                                          // really should mean: "should be
+                                          // very small". since this is only an
+                                          // assertion and not part of the
+                                          // code, we may choose "very small"
+                                          // quite arbitrarily)
                                           //
                                           // the main problem here is that the
                                           // matrix or vector entry should also
@@ -257,13 +266,19 @@ void MatrixCreator<dim>::create_boundary_mass_matrix (const DoFHandler<dim>    &
                           dof_to_boundary_mapping[dofs[j]],
                           cell_matrix(i,j));
              else
-               Assert (cell_matrix(i,j)==0, ExcInternalError ());
+               {
+                 Assert (fabs(cell_matrix(i,j)) <= 1e-10,
+                         ExcInternalError ());
+               };
          
          for (unsigned int j=0; j<dofs_per_cell; ++j)
            if (dofs_on_face.find(dofs[j]) != dofs_on_face.end())
              rhs_vector(dof_to_boundary_mapping[dofs[j]]) += cell_vector(j);
            else
-             Assert (cell_vector(j)==0, ExcInternalError());
+             {
+               Assert (fabs(cell_vector(j)) <= 1e-10,
+                       ExcInternalError());
+             };
        };
 };
 

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.