From 08149c92ef2fb08dd2d59e542db3f53f12fb4e27 Mon Sep 17 00:00:00 2001 From: Graham Harper Date: Wed, 29 Jan 2020 21:32:52 -0700 Subject: [PATCH] Add test for boundary ids for GridGenerator::half_hyper_shell --- tests/grid/grid_generator_half_hyper_shell.cc | 59 +++++++++++++++++++ .../grid_generator_half_hyper_shell.output | 27 +++++++++ 2 files changed, 86 insertions(+) create mode 100644 tests/grid/grid_generator_half_hyper_shell.cc create mode 100644 tests/grid/grid_generator_half_hyper_shell.output diff --git a/tests/grid/grid_generator_half_hyper_shell.cc b/tests/grid/grid_generator_half_hyper_shell.cc new file mode 100644 index 0000000000..119430e7c6 --- /dev/null +++ b/tests/grid/grid_generator_half_hyper_shell.cc @@ -0,0 +1,59 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2005 - 2018 by the deal.II authors +// +// This file is part of the deal.II library. +// +// The deal.II library is free software; you can use it, redistribute +// it, and/or modify it under the terms of the GNU Lesser General +// Public License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// The full text of the license can be found in the file LICENSE.md at +// the top level directory of deal.II. +// +// --------------------------------------------------------------------- + +// Test boundary ids for GridGenerator::half_hyper_shell() + +#include + +#include +#include +#include + +#include "../tests.h" + + +template +void +dim_test() +{ + Triangulation tr; + double r_inner = 1.; + double r_outer = 2.; + + GridGenerator::half_hyper_shell(tr, Point(), r_inner, r_outer, 0, true); + + typename Triangulation::cell_iterator cell = tr.begin(); + + for (; cell != tr.end(); ++cell) + { + for (unsigned int f = 0; f < GeometryInfo::faces_per_cell; ++f) + { + if (cell->face(f)->at_boundary()) + deallog << "half_hyper_shell<" << dim << ">:: cell " + << cell->index() << ", face " << f << ", id " + << cell->face(f)->boundary_id() << std::endl; + } + } +} + + +int +main() +{ + initlog(); + + dim_test<2>(); + dim_test<3>(); +} diff --git a/tests/grid/grid_generator_half_hyper_shell.output b/tests/grid/grid_generator_half_hyper_shell.output new file mode 100644 index 0000000000..9cc562e669 --- /dev/null +++ b/tests/grid/grid_generator_half_hyper_shell.output @@ -0,0 +1,27 @@ + +DEAL::half_hyper_shell<2>:: cell 0, face 0, id 3 +DEAL::half_hyper_shell<2>:: cell 0, face 2, id 1 +DEAL::half_hyper_shell<2>:: cell 0, face 3, id 0 +DEAL::half_hyper_shell<2>:: cell 1, face 2, id 1 +DEAL::half_hyper_shell<2>:: cell 1, face 3, id 0 +DEAL::half_hyper_shell<2>:: cell 2, face 2, id 1 +DEAL::half_hyper_shell<2>:: cell 2, face 3, id 0 +DEAL::half_hyper_shell<2>:: cell 3, face 2, id 1 +DEAL::half_hyper_shell<2>:: cell 3, face 3, id 0 +DEAL::half_hyper_shell<2>:: cell 4, face 1, id 2 +DEAL::half_hyper_shell<2>:: cell 4, face 2, id 1 +DEAL::half_hyper_shell<2>:: cell 4, face 3, id 0 +DEAL::half_hyper_shell<3>:: cell 0, face 2, id 2 +DEAL::half_hyper_shell<3>:: cell 0, face 4, id 0 +DEAL::half_hyper_shell<3>:: cell 0, face 5, id 0 +DEAL::half_hyper_shell<3>:: cell 1, face 0, id 0 +DEAL::half_hyper_shell<3>:: cell 1, face 1, id 0 +DEAL::half_hyper_shell<3>:: cell 1, face 2, id 2 +DEAL::half_hyper_shell<3>:: cell 2, face 2, id 2 +DEAL::half_hyper_shell<3>:: cell 2, face 4, id 0 +DEAL::half_hyper_shell<3>:: cell 2, face 5, id 0 +DEAL::half_hyper_shell<3>:: cell 3, face 0, id 0 +DEAL::half_hyper_shell<3>:: cell 3, face 1, id 0 +DEAL::half_hyper_shell<3>:: cell 3, face 2, id 2 +DEAL::half_hyper_shell<3>:: cell 4, face 0, id 1 +DEAL::half_hyper_shell<3>:: cell 4, face 1, id 0 -- 2.39.5