From 84c0b6c1199847fa85a7541975b203d4a8adda9a Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Wed, 9 Dec 2020 09:26:52 +0100 Subject: [PATCH] Implement TriaAccessor::diameter() for pyramid --- include/deal.II/grid/tria_accessor.templates.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/deal.II/grid/tria_accessor.templates.h b/include/deal.II/grid/tria_accessor.templates.h index f0656f1e15..23939b0b50 100644 --- a/include/deal.II/grid/tria_accessor.templates.h +++ b/include/deal.II/grid/tria_accessor.templates.h @@ -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 -- 2.39.5