From: Peter Munch Date: Wed, 9 Dec 2020 08:26:52 +0000 (+0100) Subject: Implement TriaAccessor::diameter() for pyramid X-Git-Tag: v9.3.0-rc1~783^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84c0b6c1199847fa85a7541975b203d4a8adda9a;p=dealii.git Implement TriaAccessor::diameter() for pyramid --- 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