From: heister Date: Fri, 25 May 2012 16:33:33 +0000 (+0000) Subject: document bug in find_active_cell_around_point() X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3fa1153c1f644659d264c7aef746d39ad54128f0;p=dealii-svn.git document bug in find_active_cell_around_point() git-svn-id: https://svn.dealii.org/trunk@25544 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/bits/find_cell_6.cc b/tests/bits/find_cell_6.cc new file mode 100644 index 0000000000..5b3a90df62 --- /dev/null +++ b/tests/bits/find_cell_6.cc @@ -0,0 +1,85 @@ +//---------------------------- find_cell_5.cc --------------------------- +// $Id: find_cell_5.cc 25229 2012-03-09 18:34:59Z pauletti $ +// Version: $Name$ +// +// Copyright (C) 2003, 2004, 2005, 2006 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. +// +//---------------------------- find_cell_5.cc --------------------------- + +// find_active_cell_around_point() uses the closest vertex +// to find the corresponding cell. This fail(ed) if it is +// a hanging node for that cell. +// this test documents this error: +/* +An error occurred in line <2552> of file in function + void dealii::CellAccessor::set_refine_flag(dealii::RefinementCase) const [with int dim = 2, int spacedim = 2] +The violated condition was: + this->used() && this->active() +The name and call sequence of the exception was: + ExcRefineCellNotActive() +Additional Information: +(none) +*/ + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + + + + +void check (Triangulation<2> &tria) +{ + Point<2> p (0.25,0.6); + + Triangulation<2>::active_cell_iterator cell + = GridTools::find_active_cell_around_point (tria, p); + + deallog << cell << std::endl; + for (unsigned int v=0; v::vertices_per_cell; ++v) + deallog << "<" << cell->vertex(v) << "> "; + deallog << std::endl; + +} + + +int main () +{ + std::ofstream logfile("find_cell_6/output"); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + try + { + Triangulation<2> coarse_grid; + GridGenerator::hyper_cube (coarse_grid); + coarse_grid.refine_global (1); + coarse_grid.begin()->set_refine_flag(); + coarse_grid.execute_coarsening_and_refinement(); + check (coarse_grid); + } + catch (const std::exception &exc) + { + // we shouldn't get here... + deallog << "Caught an error..." << std::endl; + deallog << exc.what() << std::endl; + } +} + + + diff --git a/tests/bits/find_cell_6/cmp/generic b/tests/bits/find_cell_6/cmp/generic new file mode 100644 index 0000000000..838c265721 --- /dev/null +++ b/tests/bits/find_cell_6/cmp/generic @@ -0,0 +1,3 @@ + +DEAL::3.462 +DEAL::<0.750000 0.625000 0.625000> <0.875000 0.625000 0.625000> <0.750000 0.750000 0.625000> <0.875000 0.750000 0.625000> <0.750000 0.625000 0.750000> <0.875000 0.625000 0.750000> <0.750000 0.750000 0.750000> <0.875000 0.750000 0.750000>