From: wolf Date: Tue, 30 Sep 2003 14:45:51 +0000 (+0000) Subject: New test. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9efabfaebedbd0da5a578bf345945cd7e4e9b686;p=dealii-svn.git New test. git-svn-id: https://svn.dealii.org/trunk@8069 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/bits/Makefile b/tests/bits/Makefile index da4cfb0712..2a20f57b5c 100644 --- a/tests/bits/Makefile +++ b/tests/bits/Makefile @@ -113,6 +113,7 @@ mesh_3d_7.exe : mesh_3d_7.g.$(OBJEXT) $(libraries) mesh_3d_8.exe : mesh_3d_8.g.$(OBJEXT) $(libraries) mesh_3d_9.exe : mesh_3d_9.g.$(OBJEXT) $(libraries) mesh_3d_10.exe : mesh_3d_10.g.$(OBJEXT) $(libraries) +mesh_3d_11.exe : mesh_3d_11.g.$(OBJEXT) $(libraries) q_points.exe : q_points.g.$(OBJEXT) $(libraries) @@ -145,6 +146,7 @@ tests = anna_1 anna_2 anna_3 anna_4 anna_5 anna_6 \ hyper_ball_3d cylinder coarsening_3d \ mesh_3d_1 mesh_3d_2 mesh_3d_3 mesh_3d_4 mesh_3d_5 \ mesh_3d_6 mesh_3d_7 mesh_3d_8 mesh_3d_9 mesh_3d_10 \ + mesh_3d_11 \ q_points ############################################################ diff --git a/tests/bits/mesh_3d_11.cc b/tests/bits/mesh_3d_11.cc new file mode 100644 index 0000000000..f64ff235c3 --- /dev/null +++ b/tests/bits/mesh_3d_11.cc @@ -0,0 +1,117 @@ +//---------------------------- mesh_3d_11.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2003 by the deal.II authors +// +// This file is subject to QPL and may not be distributed +// without copyright and license information. Please refer +// to the file deal.II/doc/license.html for the text and +// further information on this license. +// +//---------------------------- mesh_3d_11.cc --------------------------- + + +// check that each cell with a neighbor is also that neighbor's +// neighbor on exactly one side. this is tricky to get right for 3d +// meshes with misoriented faces +// +// also check that not only the neighborship is correctly set, but +// that they indeed share a common face + +#include "mesh_3d.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +void check_this (Triangulation<3> &tria) +{ + for (Triangulation<3>::cell_iterator cell=tria.begin(); + cell != tria.end(); ++cell) + for (unsigned int f=0; f::faces_per_cell; ++f) + if (!cell->at_boundary()) + { + const Triangulation<3>::cell_iterator neighbor = cell->neighbor(f); + const unsigned int nb_nb = cell->neighbor_of_neighbor(f); + + bool found = false; + for (unsigned int ff=0; ff::faces_per_cell; ++ff) + if (neighbor->neighbor(ff) == cell) + { + Assert (found == false, ExcInternalError()); + Assert (ff == nb_nb, ExcInternalError()); + + Assert (cell->face(f) == neighbor->face(ff), + ExcInternalError()); + + found = true; + + break; + } + Assert (found == true, ExcInternalError()); + } + deallog << " ok." << std::endl; +} + + +void check (Triangulation<3> &tria) +{ + deallog << "Initial check" << std::endl; + check_this (tria); + + for (unsigned int r=0; r<3; ++r) + { + tria.refine_global (1); + deallog << "Check " << r << std::endl; + check_this (tria); + } + + coarsen_global (tria); + deallog << "Check " << 1 << std::endl; + check_this (tria); + + tria.refine_global (1); + deallog << "Check " << 2 << std::endl; + check_this (tria); +} + + +int main () +{ + std::ofstream logfile("mesh_3d_11.output"); + deallog.attach(logfile); + deallog.depth_console(0); + + { + Triangulation<3> coarse_grid; + create_two_cubes (coarse_grid); + check (coarse_grid); + } + + { + Triangulation<3> coarse_grid; + create_L_shape (coarse_grid); + check (coarse_grid); + } + + { + Triangulation<3> coarse_grid; + GridGenerator::hyper_ball (coarse_grid); + check (coarse_grid); + } + +} + + +