]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
New, failing test.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 8 Oct 2012 02:38:53 +0000 (02:38 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 8 Oct 2012 02:38:53 +0000 (02:38 +0000)
git-svn-id: https://svn.dealii.org/trunk@26995 0785d39b-7218-0410-832d-ea1e28bc413d

tests/fail/anisotropic_crash.cc [new file with mode: 0644]
tests/fail/anisotropic_crash/cmp/generic [new file with mode: 0644]

diff --git a/tests/fail/anisotropic_crash.cc b/tests/fail/anisotropic_crash.cc
new file mode 100644 (file)
index 0000000..dc7084c
--- /dev/null
@@ -0,0 +1,68 @@
+//----------------------------  anisotropic_crash.cc  ---------------------------
+//    anisotropic_crash.cc,v 1.1 2003/06/09 15:59:07 wolf Exp
+//    Version:
+//
+//    Copyright (C) 2012 by the deal.II authors and Abner Salgado
+//
+//    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.
+//
+//----------------------------  anisotropic_crash.cc  ---------------------------
+
+
+// Trying to catch a bug in the construction of patches when
+// there is anisotropic refinement
+
+
+#include <deal.II/grid/tria.h>
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/grid_refinement.h>
+#include <deal.II/grid/grid_tools.h>
+
+#include <deal.II/dofs/dof_handler.h>
+#include <deal.II/fe/fe_q.h>
+
+/// to generate random numbers
+#include <cstdlib>
+
+using namespace dealii;
+
+int main(){
+                                  /// Create triangulation, DOF handler and finite element space
+  Triangulation<2> tri;
+  DoFHandler<2> dh( tri );
+  FE_Q<2> fe(1);
+  GridGenerator::hyper_cube( tri );
+  tri.refine_global( 2 );
+  const unsigned n_cycles = 8;
+  for( unsigned i=0; i<n_cycles; ++i ){
+                                    /// Construct the finite element space
+    dh.distribute_dofs( fe );
+                                    /// For each vertex find the patch
+    const unsigned n_dofs = dh.n_dofs(), n_vert = tri.n_used_vertices();
+    std::vector< Point<2> > vertices = tri.get_vertices();
+    for( unsigned v=0; v< n_vert; ++v ){
+      std::vector< DoFHandler<2>::active_cell_iterator > patch
+       = GridTools::find_cells_adjacent_to_vertex( dh, v );
+    }
+                                    /// loop over cells and randomly refine
+    DoFHandler<2>::active_cell_iterator cell = dh.begin_active(), end = dh.end();
+    for( ; cell != end; ++cell ){
+      int random = rand()%4;
+                                      /// If random is 0 or 1 we cut x or y, resp.
+      if( random < 2 )
+       cell->set_refine_flag( RefinementCase<2>::cut_axis( random ) );
+                                      /// If random is 2 we refine isotropically
+      if( random == 2 )
+       cell->set_refine_flag();
+                                      /// If random is 3 we don't refine
+    }
+                                    /// refine the mesh
+    tri.prepare_coarsening_and_refinement();
+    tri.execute_coarsening_and_refinement();
+  }
+  dh.clear();
+  return 0;
+}
diff --git a/tests/fail/anisotropic_crash/cmp/generic b/tests/fail/anisotropic_crash/cmp/generic
new file mode 100644 (file)
index 0000000..9494292
--- /dev/null
@@ -0,0 +1,110 @@
+
+DEAL::Checking Q1 in 1d:
+DEAL::Checking Q1 in 2d:
+DEAL::Checking Q1 in 3d:
+DEAL::Checking Q2 in 1d:
+DEAL::Checking Q2 in 2d:
+DEAL::Checking Q2 in 3d:
+DEAL::Checking Q3 in 1d:
+DEAL::Checking Q3 in 2d:
+DEAL::Checking Q3 in 3d:
+DEAL::Checking DGQ0 in 1d:
+DEAL::Checking DGQ0 in 2d:
+DEAL::Checking DGQ0 in 3d:
+DEAL::Checking DGQ1 in 1d:
+DEAL::Checking DGQ1 in 2d:
+DEAL::Checking DGQ1 in 3d:
+DEAL::Checking DGQ3 in 1d:
+DEAL::Checking DGQ3 in 2d:
+DEAL::Checking DGQ3 in 3d:
+DEAL::Checking DGP0 in 1d:
+DEAL::Checking DGP0 in 2d:
+DEAL::Checking DGP0 in 3d:
+DEAL::Checking DGP1 in 1d:
+DEAL::Checking DGP1 in 2d:
+DEAL::Checking DGP1 in 3d:
+DEAL::Checking DGP3 in 1d:
+DEAL::Checking DGP3 in 2d:
+DEAL::Checking DGP3 in 3d:
+DEAL::Checking Nedelec1 in 2d:
+DEAL::Checking Nedelec1 in 3d:
+DEAL::Checking RaviartThomas0 in 2d:
+DEAL::4
+DEAL::1
+DEAL:cg::Starting value 1.2
+DEAL:cg::Convergence step 10 value 0
+DEAL::L2_Error : 0
+DEAL::Checking RaviartThomas1 in 2d:
+DEAL::8
+DEAL::2
+DEAL:cg::Starting value 1.4
+DEAL:cg::Convergence step 12 value 0
+DEAL::L2_Error : 0
+DEAL::Checking RaviartThomas2 in 2d:
+DEAL::12
+DEAL::2
+DEAL:cg::Starting value 1.4
+DEAL:cg::Convergence step 14 value 0
+DEAL::L2_Error : 0
+DEAL::Checking RaviartThomasNodal0 in 2d:
+DEAL::4
+DEAL::1
+DEAL:cg::Starting value 0.49
+DEAL:cg::Convergence step 10 value 0
+DEAL::L2_Error : 0
+DEAL::Checking RaviartThomasNodal1 in 2d:
+DEAL::8
+DEAL::2
+DEAL:cg::Starting value 0.29
+DEAL:cg::Convergence step 12 value 0
+DEAL::L2_Error : 0
+DEAL::Checking RaviartThomasNodal2 in 2d:
+DEAL::12
+DEAL::3
+DEAL:cg::Starting value 0.23
+DEAL:cg::Convergence step 16 value 0
+DEAL::L2_Error : 0
+DEAL::Checking RaviartThomasNodal0 in 3d:
+DEAL::16
+DEAL::1
+DEAL:cg::Starting value 0.47
+DEAL:cg::Convergence step 9 value 0
+DEAL::L2_Error : 0
+DEAL::Checking RaviartThomasNodal1 in 3d:
+DEAL::64
+DEAL::4
+DEAL:cg::Starting value 0.20
+DEAL:cg::Convergence step 12 value 0
+DEAL::L2_Error : 0
+DEAL::Checking RaviartThomasNodal2 in 3d:
+DEAL::144
+DEAL::9
+DEAL:cg::Starting value 0.13
+DEAL:cg::Convergence step 15 value 0
+DEAL::L2_Error : 0
+DEAL::Checking FE_Q<1>(1)3 in 1d:
+DEAL::Checking FE_DGQ<1>(2)2 in 1d:
+DEAL::Checking FE_DGP<1>(3)1 in 1d:
+DEAL::Checking FE_Q<2>(1)3 in 2d:
+DEAL::Checking FE_DGQ<2>(2)2 in 2d:
+DEAL::Checking FE_DGP<2>(3)1 in 2d:
+DEAL::Checking FE_Q<3>(1)3 in 3d:
+DEAL::Checking FE_DGQ<3>(2)2 in 3d:
+DEAL::Checking FE_DGP<3>(3)1 in 3d:
+DEAL::Checking FE_Q<1>(1)3FE_DGQ<1>(2)2 in 1d:
+DEAL::Checking FE_DGQ<1>(2)2FE_DGP<1>(3)1 in 1d:
+DEAL::Checking FE_DGP<1>(3)1FE_DGQ<1>(2)2 in 1d:
+DEAL::Checking FE_Q<2>(1)3FE_DGQ<2>(2)2 in 2d:
+DEAL::Checking FE_DGQ<2>(2)2FE_DGP<2>(3)1 in 2d:
+DEAL::Checking FE_DGP<2>(3)1FE_DGQ<2>(2)2 in 2d:
+DEAL::Checking FE_Q<1>(1)3FE_DGP<1>(3)1FE_Q<1>(1)3 in 1d:
+DEAL::Checking FE_DGQ<1>(2)2FE_DGQ<1>(2)2FE_Q<1>(3)3 in 1d:
+DEAL::Checking FE_DGP<1>(3)1FE_DGP<1>(3)1FE_Q<1>(2)3 in 1d:
+DEAL::Checking FE_Q<2>(1)3FE_DGP<2>(3)1FE_Q<2>(1)3 in 2d:
+DEAL::Checking FE_DGQ<2>(2)2FE_DGQ<2>(2)2FE_Q<2>(3)3 in 2d:
+DEAL::Checking FE_DGP<2>(3)1FE_DGP<2>(3)1FE_Q<2>(2)3 in 2d:
+DEAL::Checking FE_DGQ<3>(1)3FE_DGP<3>(3)1FE_Q<3>(1)3 in 3d:
+DEAL::Checking (FESystem<2>(FE_Q<2>(1),3))3FE_DGQ<2>(0)1FE_Q<2>(1)3 in 2d:
+DEAL::Checking FE_DGQ<2>(3)1FESystem<2>(FE_DGQ<2>(0),3)1FESystem<2>(FE_Q<2>(2),1, FE_DGQ<2>(0),1)2 in 2d:
+DEAL::Checking FE_DGQ<2>(3)1FE_Nedelec<2>(1)2 in 2d:
+DEAL::Checking FE_Nedelec<2>(1)1FESystem<2>(FE_DGQ<2>(1),2)1FESystem<2>(FE_Q<2>(2),1, FE_Nedelec<2>(1),2)2 in 2d:

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.