]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Enable TriaAccessor::diameter() for wedges 11287/head
authorPeter Munch <peterrmuench@gmail.com>
Tue, 1 Dec 2020 05:23:04 +0000 (06:23 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Tue, 1 Dec 2020 06:54:27 +0000 (07:54 +0100)
include/deal.II/grid/tria_accessor.templates.h

index 7d7b3f049d2a56fabb3333b79d5bdb6ca72e449a..07624ba4a4749bbf2e4a3b8647816b7f1b7c0bfc 100644 (file)
@@ -1912,14 +1912,23 @@ TriaAccessor<structdim, dim, spacedim>::diameter() const
                          (this->vertex(3) - this->vertex(2)).norm()});
 
       case ReferenceCell::Type::Wedge:
-        // Return the longest of the 2*3=6 diagonals of the three quadrilateral
-        // sides of the wedge
-        return std::max({(this->vertex(4) - this->vertex(0)).norm(),
+        // Return ...
+        return std::max({// the longest of the 2*3=6 diagonals of the three
+                         // quadrilateral sides of the wedge or ...
+                         (this->vertex(4) - this->vertex(0)).norm(),
                          (this->vertex(3) - this->vertex(1)).norm(),
                          (this->vertex(5) - this->vertex(1)).norm(),
                          (this->vertex(4) - this->vertex(2)).norm(),
                          (this->vertex(5) - this->vertex(0)).norm(),
-                         (this->vertex(3) - this->vertex(2)).norm()});
+                         (this->vertex(3) - this->vertex(2)).norm(),
+                         // the longest of the 3*2=6 edges of the two triangular
+                         // faces of the wedge
+                         (this->vertex(1) - this->vertex(0)).norm(),
+                         (this->vertex(2) - this->vertex(1)).norm(),
+                         (this->vertex(2) - this->vertex(0)).norm(),
+                         (this->vertex(4) - this->vertex(3)).norm(),
+                         (this->vertex(5) - this->vertex(4)).norm(),
+                         (this->vertex(5) - this->vertex(3)).norm()});
 
       case ReferenceCell::Type::Hex:
         // Return the longest of the four diagonals of the hexahedron

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.