From bddd0abf117af6a72a3fb80754752d468f165fcd Mon Sep 17 00:00:00 2001 From: hartmann Date: Wed, 27 Oct 2004 15:12:28 +0000 Subject: [PATCH] Small test case for which neighbor_child_on_subface fails. git-svn-id: https://svn.dealii.org/trunk@9725 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/bits/mesh_3d_17.cc | 102 +++++++++++++++++++++++++++++++++++++++ tests/bits/two_cubes.inp | 19 ++++++++ 2 files changed, 121 insertions(+) create mode 100644 tests/bits/mesh_3d_17.cc create mode 100644 tests/bits/two_cubes.inp diff --git a/tests/bits/mesh_3d_17.cc b/tests/bits/mesh_3d_17.cc new file mode 100644 index 0000000000..80fdbe6945 --- /dev/null +++ b/tests/bits/mesh_3d_17.cc @@ -0,0 +1,102 @@ +// check TriaCellAccessor::neighbor_child_on_subface + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +using namespace std; + +void check_this (Triangulation<3> &tria) +{ + FE_Q<3> fe(1); + + DoFHandler<3> dof_handler (tria); + dof_handler.distribute_dofs (fe); + + const unsigned int dim=3; + DoFHandler::active_cell_iterator + cell = dof_handler.begin_active(), + endc = dof_handler.end(); + for (unsigned int cell_no=0; cell!=endc; ++cell, ++cell_no) + for (unsigned int face_no=0; face_no::faces_per_cell; ++face_no) + { + const DoFHandler::face_iterator + face=cell->face(face_no); + + if (!face->at_boundary()) + { + Assert (cell->neighbor(face_no).state() == IteratorState::valid, + ExcInternalError()); + DoFHandler::cell_iterator neighbor= + cell->neighbor(face_no); + + if (face->has_children()) + { + const unsigned int neighbor2=cell->neighbor_of_neighbor(face_no); + + deallog << "cell_no=" << cell_no << ", face_no=" << face_no << endl; + deallog << " cell->face_orientation(face_no)=" + << cell->face_orientation(face_no) << endl; + deallog << " neighbor2=" << neighbor2 << endl; + deallog << " neighbor->face_orientation(neighbor2)=" + << neighbor->face_orientation(neighbor2) << endl; + + + for (unsigned int subface_no=0; + subface_no::subfaces_per_face; + ++subface_no) + { + deallog << "subface_no=" << subface_no << endl; + DoFHandler::cell_iterator neighbor_child= + cell->neighbor_child_on_subface(face_no, subface_no); + } + } + } + } +} + + + +void check (Triangulation<3> &tria) +{ + tria.begin_active()->set_refine_flag (); + tria.execute_coarsening_and_refinement (); + + if (false) + { + GridOut grid_out; + ofstream grid_stream("grid.gnuplot"); + grid_out.write_gnuplot(tria, grid_stream); + } + + check_this (tria); +} + +int main () +{ + ofstream logfile("mesh_3d_17.output"); + deallog.attach(logfile); + deallog.depth_console(0); + + Triangulation<3> coarse_grid; + GridIn<3> in; + in.attach_triangulation(coarse_grid); + ifstream ucd_file("two_cubes.inp"); + in.read_ucd(ucd_file); + ucd_file.close(); + + check (coarse_grid); +} + diff --git a/tests/bits/two_cubes.inp b/tests/bits/two_cubes.inp new file mode 100644 index 0000000000..4fc03cde0e --- /dev/null +++ b/tests/bits/two_cubes.inp @@ -0,0 +1,19 @@ +# 9 10 11 +# 6 7 8 +# 3 4 5 +# 0 1 2 +12 2 0 0 0 +0 -1 0 1 +1 0 0 1 +2 1 0 1 +3 -1 1 1 +4 0 1 1 +5 1 1 1 +6 -1 0 0 +7 0 0 0 +8 1 0 0 +9 -1 1 0 +10 0 1 0 +11 1 1 0 +0 0 hex 1 2 5 4 7 8 11 10 +1 0 hex 1 4 3 0 7 10 9 6 -- 2.39.5