From: Peter Munch Date: Tue, 1 Dec 2020 05:23:04 +0000 (+0100) Subject: Enable TriaAccessor::diameter() for wedges X-Git-Tag: v9.3.0-rc1~826^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F11287%2Fhead;p=dealii.git Enable TriaAccessor::diameter() for wedges --- 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