From 1dff27636fe963969d79424054e65aa731d2a29e Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sun, 24 Jan 2021 22:00:36 -0700 Subject: [PATCH] Simplify some code. --- source/grid/reference_cell.cc | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) 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}; -- 2.39.5