-
Notifications
You must be signed in to change notification settings - Fork 736
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for boundary ids for GridGenerator::half_hyper_shell
- Loading branch information
1 parent
1f678ce
commit 08149c9
Showing
2 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |