From: Wolfgang Bangerth Date: Mon, 25 Jan 2021 05:00:36 +0000 (-0700) Subject: Simplify some code. X-Git-Tag: v9.3.0-rc1~563^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1dff27636fe963969d79424054e65aa731d2a29e;p=dealii.git Simplify some code. --- diff --git a/source/grid/reference_cell.cc b/source/grid/reference_cell.cc index 2ce04c7d8e..19a303d0b8 100644 --- a/source/grid/reference_cell.cc +++ b/source/grid/reference_cell.cc @@ -75,19 +75,11 @@ namespace ReferenceCell } else if (reference_cell == Type::Tri) { - std::vector> vertices; - if (spacedim == 2) - { - vertices.emplace_back(0.0, 0.0); - vertices.emplace_back(1.0, 0.0); - vertices.emplace_back(0.0, 1.0); - } - else if (spacedim == 3) - { - vertices.emplace_back(0.0, 0.0, 0.0); - vertices.emplace_back(1.0, 0.0, 0.0); - vertices.emplace_back(0.0, 1.0, 0.0); - } + const std::vector> vertices = { + Point(), // the origin + Point::unit_vector(0), // unit point along x-axis + Point::unit_vector(1) // unit point along y-axis + }; std::vector> cells(1); cells[0].vertices = {0, 1, 2};