Skip to content

Commit

Permalink
Add test for boundary ids for GridGenerator::half_hyper_shell
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamBenHarper committed Jan 30, 2020
1 parent 1f678ce commit 08149c9
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 0 deletions.
59 changes: 59 additions & 0 deletions tests/grid/grid_generator_half_hyper_shell.cc
Original file line number Diff line number Diff line change
@@ -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 <deal.II/base/tensor.h>

#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_out.h>
#include <deal.II/grid/tria.h>

#include "../tests.h"


template <int dim>
void
dim_test()
{
Triangulation<dim> tr;
double r_inner = 1.;
double r_outer = 2.;

GridGenerator::half_hyper_shell(tr, Point<dim>(), r_inner, r_outer, 0, true);

typename Triangulation<dim>::cell_iterator cell = tr.begin();

for (; cell != tr.end(); ++cell)
{
for (unsigned int f = 0; f < GeometryInfo<dim>::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>();
}
27 changes: 27 additions & 0 deletions tests/grid/grid_generator_half_hyper_shell.output
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 08149c9

Please sign in to comment.