interpolate_* \
have_same_coarse_mesh_* \
get_finest_common_cells_* \
- project_*[0-9]
+ project_*[0-9] \
+ minimal_cell_diameter \
+ maximal_cell_diameter
# from above list of regular expressions, generate the real set of
# tests
--- /dev/null
+//---------------------------- maximal_cell_diameter.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2001, 2002, 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.
+//
+//---------------------------- maximal_cell_diameter.cc ---------------------------
+
+
+#include "../tests.h"
+#include <base/logstream.h>
+#include <grid/tria.h>
+#include <grid/grid_generator.h>
+#include <grid/grid_tools.h>
+#include <grid/grid_out.h>
+
+#include <fstream>
+
+
+std::ofstream logfile("maximal_cell_diameter/output");
+
+
+
+template <int dim>
+void test1 ()
+{
+ // test 1: hypercube
+ if (true)
+ {
+ Triangulation<dim> tria;
+ GridGenerator::hyper_cube(tria);
+
+ for (unsigned int i=0; i<2; ++i)
+ {
+ tria.refine_global(2);
+ deallog << dim << "d, "
+ << "max diameter: "
+ << GridTools::maximal_cell_diameter (tria)
+ << std::endl;
+ Assert (GridTools::maximal_cell_diameter (tria)
+ >=
+ GridTools::minimal_cell_diameter (tria),
+ ExcInternalError());
+ };
+ };
+
+ // test 2: hyperball
+ if (dim >= 2)
+ {
+ Triangulation<dim> tria;
+ GridGenerator::hyper_ball(tria, Point<dim>(), 1);
+
+ for (unsigned int i=0; i<2; ++i)
+ {
+ tria.refine_global(2);
+ deallog << dim << "d, "
+ << "max diameter: "
+ << GridTools::maximal_cell_diameter (tria)
+ << std::endl;
+ Assert (GridTools::maximal_cell_diameter (tria)
+ >=
+ GridTools::minimal_cell_diameter (tria),
+ ExcInternalError());
+ };
+ };
+}
+
+
+int main ()
+{
+ logfile.precision(4);
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ test1<1> ();
+ test1<2> ();
+ test1<3> ();
+
+ return 0;
+}
+
--- /dev/null
+
+DEAL::1d, max diameter: 0.2500
+DEAL::1d, max diameter: 0.06250
+DEAL::2d, max diameter: 0.3536
+DEAL::2d, max diameter: 0.08839
+DEAL::2d, max diameter: 0.4183
+DEAL::2d, max diameter: 0.1140
+DEAL::3d, max diameter: 0.4330
+DEAL::3d, max diameter: 0.1083
+DEAL::3d, max diameter: 0.4817
+DEAL::3d, max diameter: 0.1324
--- /dev/null
+//---------------------------- minimal_cell_diameter.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2001, 2002, 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.
+//
+//---------------------------- minimal_cell_diameter.cc ---------------------------
+
+
+#include "../tests.h"
+#include <base/logstream.h>
+#include <grid/tria.h>
+#include <grid/grid_generator.h>
+#include <grid/grid_tools.h>
+#include <grid/grid_out.h>
+
+#include <fstream>
+
+
+std::ofstream logfile("minimal_cell_diameter/output");
+
+
+
+template <int dim>
+void test1 ()
+{
+ // test 1: hypercube
+ if (true)
+ {
+ Triangulation<dim> tria;
+ GridGenerator::hyper_cube(tria);
+
+ for (unsigned int i=0; i<2; ++i)
+ {
+ tria.refine_global(2);
+ deallog << dim << "d, "
+ << "min diameter: "
+ << GridTools::minimal_cell_diameter (tria)
+ << std::endl;
+ };
+ };
+
+ // test 2: hyperball
+ if (dim >= 2)
+ {
+ Triangulation<dim> tria;
+ GridGenerator::hyper_ball(tria, Point<dim>(), 1);
+
+ for (unsigned int i=0; i<2; ++i)
+ {
+ tria.refine_global(2);
+ deallog << dim << "d, "
+ << "min diameter: "
+ << GridTools::minimal_cell_diameter (tria)
+ << std::endl;
+ };
+ };
+}
+
+
+
+
+int main ()
+{
+ logfile.precision(4);
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ test1<1> ();
+ test1<2> ();
+ test1<3> ();
+
+ return 0;
+}
+
--- /dev/null
+
+DEAL::1d, min diameter: 0.2500
+DEAL::1d, min diameter: 0.06250
+DEAL::2d, min diameter: 0.3536
+DEAL::2d, min diameter: 0.08839
+DEAL::2d, min diameter: 0.2071
+DEAL::2d, min diameter: 0.04752
+DEAL::3d, min diameter: 0.4330
+DEAL::3d, min diameter: 0.1083
+DEAL::3d, min diameter: 0.1830
+DEAL::3d, min diameter: 0.04575