From: Denis Davydov Date: Fri, 18 Aug 2017 11:42:11 +0000 (+0200) Subject: make an Assert in LA::distributed::Vector::compress_finish() less rigid X-Git-Tag: v9.0.0-rc1~1213^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F4901%2Fhead;p=dealii.git make an Assert in LA::distributed::Vector::compress_finish() less rigid --- diff --git a/include/deal.II/lac/la_parallel_vector.templates.h b/include/deal.II/lac/la_parallel_vector.templates.h index d4489ca592..c98916c8d8 100644 --- a/include/deal.II/lac/la_parallel_vector.templates.h +++ b/include/deal.II/lac/la_parallel_vector.templates.h @@ -676,9 +676,15 @@ namespace LinearAlgebra for ( ; my_imports!=part.import_indices().end(); ++my_imports) for (unsigned int j=my_imports->first; jsecond; 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::epsilon(), ExcNonMatchingElements(*read_position, local_element(j), part.this_mpi_process()));