]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 1 Oct 2003 22:25:32 +0000 (22:25 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 1 Oct 2003 22:25:32 +0000 (22:25 +0000)
git-svn-id: https://svn.dealii.org/trunk@8083 0785d39b-7218-0410-832d-ea1e28bc413d

tests/bits/mesh_3d_12.cc [new file with mode: 0644]

diff --git a/tests/bits/mesh_3d_12.cc b/tests/bits/mesh_3d_12.cc
new file mode 100644 (file)
index 0000000..d87a171
--- /dev/null
@@ -0,0 +1,104 @@
+//----------------------------  mesh_3d_12.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_12.cc  ---------------------------
+
+
+// the Kelly estimator used to fall over when presented with 3d meshes
+// with mis-oriented faces
+
+#include "mesh_3d.h"
+
+#include <base/logstream.h>
+#include <base/quadrature_lib.h>
+#include <lac/vector.h>
+#include <grid/tria.h>
+#include <grid/tria_accessor.h>
+#include <grid/tria_iterator.h>
+#include <grid/grid_reordering.h>
+#include <grid/grid_generator.h>
+#include <dofs/dof_handler.h>
+#include <fe/fe_q.h>
+#include <numerics/error_estimator.h>
+
+#include <fstream>
+
+
+void check_this (Triangulation<3> &tria)
+{
+  FE_Q<3> fe(1);
+  DoFHandler<3> dof_handler (tria);
+  dof_handler.distribute_dofs (fe);
+
+  Vector<double> u(dof_handler.n_dofs());
+  Vector<float>  e(tria.n_active_cells());
+  
+  KellyErrorEstimator<3>::estimate (dof_handler,
+                                    QGauss2<2>(),
+                                    FunctionMap<3>::type(),
+                                    u,
+                                    e);
+}
+
+
+void check (Triangulation<3> &tria)
+{
+  (++tria.begin_active())->set_refine_flag ();
+  tria.execute_coarsening_and_refinement ();
+  
+  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_12.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);
+  }
+  
+}
+
+  
+  

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.