From ca9930277b5504414f30ac08b56d8ef68baf7138 Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Tue, 1 Dec 2020 06:23:04 +0100 Subject: [PATCH] Enable TriaAccessor::diameter() for wedges --- include/deal.II/grid/tria_accessor.templates.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/include/deal.II/grid/tria_accessor.templates.h b/include/deal.II/grid/tria_accessor.templates.h index 7d7b3f049d..07624ba4a4 100644 --- a/include/deal.II/grid/tria_accessor.templates.h +++ b/include/deal.II/grid/tria_accessor.templates.h @@ -1912,14 +1912,23 @@ TriaAccessor::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 -- 2.39.5