]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
document bug in find_active_cell_around_point()
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 25 May 2012 16:33:33 +0000 (16:33 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 25 May 2012 16:33:33 +0000 (16:33 +0000)
git-svn-id: https://svn.dealii.org/trunk@25544 0785d39b-7218-0410-832d-ea1e28bc413d

tests/bits/find_cell_6.cc [new file with mode: 0644]
tests/bits/find_cell_6/cmp/generic [new file with mode: 0644]

diff --git a/tests/bits/find_cell_6.cc b/tests/bits/find_cell_6.cc
new file mode 100644 (file)
index 0000000..5b3a90d
--- /dev/null
@@ -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 </scratch/deal-trunk/deal.II/include/deal.II/grid/tria_accessor.templates.h> in function
+    void dealii::CellAccessor<dim, spacedim>::set_refine_flag(dealii::RefinementCase<dim>) 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 <deal.II/base/logstream.h>
+#include <deal.II/grid/tria.h>
+#include <deal.II/grid/tria_accessor.h>
+#include <deal.II/grid/tria_iterator.h>
+#include <deal.II/grid/grid_tools.h>
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/tria_boundary_lib.h>
+
+#include <fstream>
+
+#include <deal.II/fe/mapping_q1.h>
+
+
+
+
+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<GeometryInfo<2>::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 (file)
index 0000000..838c265
--- /dev/null
@@ -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> 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.