]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Implement TriaAccessor::diameter() for pyramid 11344/head
authorPeter Munch <peterrmuench@gmail.com>
Wed, 9 Dec 2020 08:26:52 +0000 (09:26 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Wed, 9 Dec 2020 08:26:52 +0000 (09:26 +0100)
include/deal.II/grid/tria_accessor.templates.h

index f0656f1e15524d11002509bf9e29784b99ab9b81..23939b0b502bc5b33a319e2150d8f79450542a96 100644 (file)
@@ -80,6 +80,19 @@ namespace internal
                              (vertices[3] - vertices[1]).norm(),
                              (vertices[3] - vertices[2]).norm()});
 
+          case ReferenceCell::Type::Pyramid:
+            // Return ...
+            return std::max({// the longest diagonal of the quadrilateral base
+                             // of the pyramid or ...
+                             (vertices[3] - vertices[0]).norm(),
+                             (vertices[2] - vertices[1]).norm(),
+                             // the longest edge connected with the apex of the
+                             // pyramid
+                             (vertices[4] - vertices[0]).norm(),
+                             (vertices[4] - vertices[1]).norm(),
+                             (vertices[4] - vertices[2]).norm(),
+                             (vertices[4] - vertices[3]).norm()});
+
           case ReferenceCell::Type::Wedge:
             // Return ...
             return std::max({// the longest of the 2*3=6 diagonals of the three

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.