]> https://gitweb.dealii.org/ - dealii.git/commitdiff
make an Assert in LA::distributed::Vector::compress_finish() less rigid 4901/head
authorDenis Davydov <davydden@gmail.com>
Fri, 18 Aug 2017 11:42:11 +0000 (13:42 +0200)
committerDenis Davydov <davydden@gmail.com>
Fri, 18 Aug 2017 11:42:11 +0000 (13:42 +0200)
include/deal.II/lac/la_parallel_vector.templates.h

index d4489ca5921a51e2495049a20b8e322361e5f124..c98916c8d80c3212c201510c4923364ec2188161 100644 (file)
@@ -676,9 +676,15 @@ namespace LinearAlgebra
             for ( ; my_imports!=part.import_indices().end(); ++my_imports)
               for (unsigned int j=my_imports->first; j<my_imports->second;
                    j++, read_position++)
+                // Below we use relatively large precision in units in the last place (ULP) as
+                // this Assert can be easily triggered in p::d::SolutionTransfer.
+                // The rationale is that during interpolation on two elements sharing
+                // the face, values on this face obtained from each side might
+                // be different due to additions being done in different order.
                 Assert(*read_position == Number() ||
                        std::abs(local_element(j) - *read_position) <=
-                       std::abs(local_element(j)) * 10000. *
+                       std::abs(local_element(j) + *read_position) *
+                       100000. *
                        std::numeric_limits<real_type>::epsilon(),
                        ExcNonMatchingElements(*read_position, local_element(j),
                                               part.this_mpi_process()));

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.