From: David Wells Date: Fri, 19 May 2023 12:59:33 +0000 (-0400) Subject: Relax the check for points inside a pyramid. X-Git-Tag: v9.5.0-rc1~161^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d9ad233cd78f151a01e20242d8e56fc1751c113;p=dealii.git Relax the check for points inside a pyramid. --- diff --git a/include/deal.II/grid/reference_cell.h b/include/deal.II/grid/reference_cell.h index b769c476d6..db61250178 100644 --- a/include/deal.II/grid/reference_cell.h +++ b/include/deal.II/grid/reference_cell.h @@ -2622,7 +2622,7 @@ ReferenceCell::contains_point(const Point &p, const double tolerance) const // We are inside the pyramid if the distance from the axis is less // than (1-z) - return (distance_from_axis < 1 + tolerance - p[z_coordinate]); + return (distance_from_axis <= 1 + tolerance - p[z_coordinate]); } case ReferenceCells::Wedge: { diff --git a/tests/grid/reference_cell_type_04.cc b/tests/grid/reference_cell_type_04.cc index 07c69f4b44..cbb8a9a2d6 100644 --- a/tests/grid/reference_cell_type_04.cc +++ b/tests/grid/reference_cell_type_04.cc @@ -35,6 +35,12 @@ test(const ReferenceCell &reference_cell) unsigned int n_samples_inside = 0; const unsigned int n_samples = 200000; + // sanity check: does the reference cell contain its own nodes? + for (unsigned int vertex_no : reference_cell.vertex_indices()) + AssertThrow(reference_cell.contains_point( + reference_cell.template vertex(vertex_no)), + ExcInternalError()); + for (unsigned int n = 0; n < n_samples; ++n) { // Choose a random point in the box [-1,1]^d that contains all