]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Relax the check for points inside a pyramid.
authorDavid Wells <drwells@email.unc.edu>
Fri, 19 May 2023 12:59:33 +0000 (08:59 -0400)
committerDavid Wells <drwells@email.unc.edu>
Fri, 19 May 2023 13:51:55 +0000 (09:51 -0400)
include/deal.II/grid/reference_cell.h
tests/grid/reference_cell_type_04.cc

index b769c476d6814ce771d0604e9bcf306a78d50669..db61250178306ec1e534aefd11a63ae82ac1a6a7 100644 (file)
@@ -2622,7 +2622,7 @@ ReferenceCell::contains_point(const Point<dim> &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:
         {
index 07c69f4b442c1694e04cbd6cae2bc40c3b4e1089..cbb8a9a2d6b980687ee6170e25563c7d9b13853a 100644 (file)
@@ -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<dim>(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

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.