]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Convert integrators tests to ctest. Lots of timeout.
authorturcksin <turcksin@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 27 Aug 2013 16:36:30 +0000 (16:36 +0000)
committerturcksin <turcksin@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 27 Aug 2013 16:36:30 +0000 (16:36 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@30507 0785d39b-7218-0410-832d-ea1e28bc413d

42 files changed:
tests/integrators/CMakeLists.txt [new file with mode: 0644]
tests/integrators/Makefile [deleted file]
tests/integrators/assembler_simple_matrix_01.cc
tests/integrators/assembler_simple_matrix_01.output [moved from tests/integrators/assembler_simple_matrix_01/cmp/generic with 100% similarity]
tests/integrators/assembler_simple_matrix_02.cc
tests/integrators/assembler_simple_matrix_02.output [moved from tests/integrators/assembler_simple_matrix_02/cmp/generic with 100% similarity]
tests/integrators/assembler_simple_matrix_03.cc
tests/integrators/assembler_simple_matrix_03.output [moved from tests/integrators/assembler_simple_matrix_03/cmp/generic with 100% similarity]
tests/integrators/assembler_simple_matrix_03tri.cc
tests/integrators/assembler_simple_matrix_03tri.output [moved from tests/integrators/assembler_simple_matrix_03tri/cmp/generic with 100% similarity]
tests/integrators/assembler_simple_matrix_04.cc
tests/integrators/assembler_simple_matrix_04.output [moved from tests/integrators/assembler_simple_matrix_04/cmp/generic with 100% similarity]
tests/integrators/assembler_simple_mgmatrix_01.cc
tests/integrators/assembler_simple_mgmatrix_01.output [moved from tests/integrators/assembler_simple_mgmatrix_01/cmp/generic with 100% similarity]
tests/integrators/assembler_simple_mgmatrix_02.cc
tests/integrators/assembler_simple_mgmatrix_02.output [moved from tests/integrators/assembler_simple_mgmatrix_02/cmp/generic with 100% similarity]
tests/integrators/assembler_simple_mgmatrix_03.cc
tests/integrators/assembler_simple_mgmatrix_03.output [moved from tests/integrators/assembler_simple_mgmatrix_03/cmp/generic with 100% similarity]
tests/integrators/cells_and_faces_01.cc
tests/integrators/cells_and_faces_01.output [moved from tests/integrators/cells_and_faces_01/cmp/generic with 100% similarity]
tests/integrators/cochain_01.cc
tests/integrators/cochain_01.output [moved from tests/integrators/cochain_01/cmp/generic with 100% similarity]
tests/integrators/divergence_01.cc
tests/integrators/divergence_01.output [moved from tests/integrators/divergence_01/cmp/generic with 100% similarity]
tests/integrators/elasticity_01.cc
tests/integrators/elasticity_01.output [moved from tests/integrators/elasticity_01/cmp/generic with 100% similarity]
tests/integrators/functional_01.cc
tests/integrators/functional_01.output [moved from tests/integrators/functional_01/cmp/generic with 100% similarity]
tests/integrators/laplacian_01.cc
tests/integrators/laplacian_01.output [moved from tests/integrators/laplacian_01/cmp/generic with 100% similarity]
tests/integrators/mesh_worker_01.cc
tests/integrators/mesh_worker_01.output [moved from tests/integrators/mesh_worker_01/cmp/generic with 100% similarity]
tests/integrators/mesh_worker_02.cc
tests/integrators/mesh_worker_02.output [moved from tests/integrators/mesh_worker_02/cmp/generic with 100% similarity]
tests/integrators/mesh_worker_03.cc
tests/integrators/mesh_worker_03.output [moved from tests/integrators/mesh_worker_03/cmp/generic with 100% similarity]
tests/integrators/mesh_worker_1d_dg.cc
tests/integrators/mesh_worker_1d_dg.output [moved from tests/integrators/mesh_worker_1d_dg/cmp/generic with 100% similarity]
tests/integrators/mesh_worker_matrix_01.cc
tests/integrators/mesh_worker_matrix_01.output [moved from tests/integrators/mesh_worker_matrix_01/cmp/generic with 100% similarity]
tests/lib/dof_tools_frame.h [new file with mode: 0644]
tests/lib/test_grids.h [new file with mode: 0644]

diff --git a/tests/integrators/CMakeLists.txt b/tests/integrators/CMakeLists.txt
new file mode 100644 (file)
index 0000000..0efb828
--- /dev/null
@@ -0,0 +1 @@
+DEAL_II_PICKUP_TESTS()
diff --git a/tests/integrators/Makefile b/tests/integrators/Makefile
deleted file mode 100644 (file)
index 810bdc8..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-############################################################
-# $Id$
-# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
-############################################################
-
-include ../Makefile.paths
-include $D/common/Make.global_options
-include ../Makefile.rules
--include Makefile.depend
--include Makefile.tests
index 8ecaec7d24abdc0a19aa3e4ab2f71dc88e5a1483..bd08ef062379416c86397aa30856b0e878d84fa9 100644 (file)
@@ -50,7 +50,7 @@ void test(DOFINFO &info, MeshWorker::Assembler::MatrixSimple<MATRIX> &ass)
 
 int main()
 {
-  const std::string logname = JobIdentifier::base_name(__FILE__) + std::string("/output");
+  const std::string logname = "output";
   std::ofstream logfile(logname.c_str());
   deallog.attach(logfile);
   deallog.depth_console (0);
index 47144e3fa4e6348713d87c9a09d5c4c505e5f447..8ab2c270c713e8fdd0e363a80ff7a1522cbe9fc5 100644 (file)
@@ -79,7 +79,7 @@ void test(FiniteElement<dim> &fe)
 
 int main()
 {
-  const std::string logname = JobIdentifier::base_name(__FILE__) + std::string("/output");
+  const std::string logname = "output";
   std::ofstream logfile(logname.c_str());
   deallog.attach(logfile);
   deallog.depth_console (0);
index 5cf602c096e205e07cf0732ad5ff982883c48cc8..458a2e22c1e49c8fa6ee3a400818a570f4c7b0e3 100644 (file)
@@ -111,7 +111,7 @@ void test(FiniteElement<dim> &fe)
 
 int main()
 {
-  initlog(__FILE__);
+  initlog();
 
   FE_DGP<2> p0(0);
   FE_DGP<2> p1(1);
index fcd3f3204f116a83e72a04cfdd67cce54fa219e0..00dc84626c14e70fae9340099bd8cbda08835ebe 100644 (file)
@@ -112,7 +112,7 @@ void test(FiniteElement<dim> &fe)
 int main(int argc, char **argv)
 {
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
-  initlog(__FILE__);
+  initlog();
 
   FE_DGP<2> p0(0);
   FE_DGP<2> p1(1);
index f52b7feb13956e2e23e517e87e573304415c7e6f..22d1698ce691e06def5190ba955496190b7c5a97 100644 (file)
@@ -111,7 +111,7 @@ void test(FiniteElement<dim> &fe)
 
 int main()
 {
-  const std::string logname = JobIdentifier::base_name(__FILE__) + std::string("/output");
+  const std::string logname = "output";
   std::ofstream logfile(logname.c_str());
   deallog.attach(logfile);
   deallog.depth_console (0);
index c7cdbef5f4532b793c228caf8619ebc5d3bb2b59..b8e63805d89881fab3d8281f73c365f8d7833ba7 100644 (file)
@@ -50,7 +50,7 @@ void test(DOFINFO &info, MeshWorker::Assembler::MGMatrixSimple<MATRIX> &ass)
 
 int main()
 {
-  const std::string logname = JobIdentifier::base_name(__FILE__) + std::string("/output");
+  const std::string logname = "output";
   std::ofstream logfile(logname.c_str());
   deallog.attach(logfile);
   deallog.depth_console (0);
index 6499fe8e1066e9854ea75745554396e7c9506a77..bdd607403ed2fa0cb3b021ae07c147c40f302deb 100644 (file)
@@ -79,7 +79,7 @@ void test(FiniteElement<dim> &fe)
 
 int main()
 {
-  const std::string logname = JobIdentifier::base_name(__FILE__) + std::string("/output");
+  const std::string logname = "output";
   std::ofstream logfile(logname.c_str());
   deallog.attach(logfile);
   deallog.depth_console (0);
index 2ec9a66783101c3e9e06a270535401acfcd71122..dbbe2f7b1c215083f8b3978e6bc6236bf2298586 100644 (file)
@@ -117,7 +117,7 @@ void test(FiniteElement<dim> &fe)
 
 int main()
 {
-  const std::string logname = JobIdentifier::base_name(__FILE__) + std::string("/output");
+  const std::string logname = "output";
   std::ofstream logfile(logname.c_str());
   deallog.attach(logfile);
   deallog.depth_console (0);
index 0e63ac9a04d93c216d0e123c6e8e09eaff141eab..5a4063ae602270dbad53ec31147b85e34bc75f45 100644 (file)
@@ -184,7 +184,7 @@ test(const FiniteElement<dim> &fe)
 
 int main ()
 {
-  const std::string logname = JobIdentifier::base_name(__FILE__) + std::string("/output");
+  const std::string logname = "output";
   std::ofstream logfile(logname.c_str());
   deallog.attach(logfile);
   deallog.depth_console (0);
index 790a90e767124f692ce57c7a07cea0e0489c2164..a1a8d52462e212ecaccf19cf7605fe2227100485 100644 (file)
@@ -297,7 +297,7 @@ void run3d (unsigned int degree)
 
 int main()
 {
-  const std::string logname = JobIdentifier::base_name(__FILE__) + std::string("/output");
+  const std::string logname = "output";
   std::ofstream logfile(logname.c_str());
   deallog.attach(logfile);
   deallog.log_execution_time(false);
index 8907be10e838982255376734a28431b1f099c223..4a44b02966fe59972d68634edf1fd2297b790eb7 100644 (file)
@@ -269,7 +269,7 @@ test(Triangulation<dim> &tr)
 
 int main()
 {
-  const std::string logname = JobIdentifier::base_name(__FILE__) + std::string("/output");
+  const std::string logname = "output";
   std::ofstream logfile(logname.c_str());
   deallog.attach(logfile);
   deallog.depth_console(0);
index e62f83aa537b2b4ae0f04b0b69a48da63de566bd..f50aa9118f9e5c06c832c9965f1ad593064b1a82 100644 (file)
@@ -255,7 +255,7 @@ test(Triangulation<dim> &tr)
 
 int main()
 {
-  initlog(__FILE__);
+  initlog();
   deallog.threshold_double(1.e-10);
 
   Triangulation<2> tr2;
index a731e303545a25dd78aa7685d377dcc7b52710f8..f9053ceb232f6e7caa80b7925399c108753736d9 100644 (file)
@@ -155,7 +155,7 @@ test(const FiniteElement<dim> &fe)
 
 int main ()
 {
-  const std::string logname = JobIdentifier::base_name(__FILE__) + std::string("/output");
+  const std::string logname = "output";
   std::ofstream logfile(logname.c_str());
   deallog.attach(logfile);
   deallog.depth_console (0);
index f18d7f9e61207411f7ebbe3426b6c3fd71fb4073..1c55d7249ef3840e09ae08b32a8fbeef19bdb585 100644 (file)
@@ -279,7 +279,7 @@ test(Triangulation<dim> &tr)
 
 int main()
 {
-  initlog(__FILE__);
+  initlog();
   deallog.threshold_double(1.e-10);
 
   Triangulation<2> tr2;
index 66f81bbd6636ced252c31748c306975b71e42d19..8d5961a9fe0609ff8df4c3a3de7fbe4a9884242e 100644 (file)
@@ -198,7 +198,7 @@ test(const FiniteElement<dim> &fe)
 
 int main ()
 {
-  const std::string logname = JobIdentifier::base_name(__FILE__) + std::string("/output");
+  const std::string logname = "output";
   std::ofstream logfile(logname.c_str());
   deallog.attach(logfile);
   deallog.depth_console (0);
index 3b7d9985d6cfbf937d15f3ee5316427a68cb0793..fc5472622893c2823e9e222930cc30d8435c2522 100644 (file)
@@ -292,7 +292,7 @@ test(const FiniteElement<dim> &fe)
 
 int main ()
 {
-  const std::string logname = JobIdentifier::base_name(__FILE__) + std::string("/output");
+  const std::string logname = "output";
   std::ofstream logfile(logname.c_str());
   deallog.attach(logfile);
   deallog.depth_console (0);
index 609406761aeba07097f80f5f8c94078deef38fb8..84be179ccf3d44452658e65c7cfa44b8c49d8ebd 100644 (file)
@@ -306,7 +306,7 @@ test(const FiniteElement<dim> &fe)
 
 int main ()
 {
-  const std::string logname = JobIdentifier::base_name(__FILE__) + std::string("/output");
+  const std::string logname = "output";
   std::ofstream logfile(logname.c_str());
   deallog.attach(logfile);
   deallog.depth_console (0);
index 4e5734fee477f1c8025f1b3905242435a01d9d87..1db5ba294da52943c17d435c44d04cbc3670fff7 100644 (file)
@@ -437,7 +437,7 @@ namespace Advection
 
 int main ()
 {
-  const std::string logname = JobIdentifier::base_name(__FILE__) + std::string("/output");
+  const std::string logname = "output";
   std::ofstream logfile(logname.c_str());
   deallog.attach(logfile);
   deallog.depth_console (0);
index 2ed4bb5dad9f5683f1c48ea6965c7ebae49c3861..004d6a3d4e095c5c0c50fa4bd0606d95223b052a 100644 (file)
@@ -199,7 +199,7 @@ test(const FiniteElement<dim> &fe)
 
 int main ()
 {
-  const std::string logname = JobIdentifier::base_name(__FILE__) + std::string("/output");
+  const std::string logname = "output";
   std::ofstream logfile(logname.c_str());
   deallog.attach(logfile);
   deallog.depth_console (0);
diff --git a/tests/lib/dof_tools_frame.h b/tests/lib/dof_tools_frame.h
new file mode 100644 (file)
index 0000000..fbfcd5c
--- /dev/null
@@ -0,0 +1,130 @@
+// ---------------------------------------------------------------------
+// $Id: dof_tools_frame.h 30048 2013-07-18 19:42:36Z maier $
+//
+// Copyright (C) 2003 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+
+#include "../tests.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/grid/tria.h>
+#include <deal.II/grid/tria_iterator.h>
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/dofs/dof_accessor.h>
+#include <deal.II/dofs/dof_handler.h>
+#include <deal.II/dofs/dof_tools.h>
+#include <deal.II/fe/fe_q.h>
+#include <deal.II/fe/fe_dgq.h>
+#include <deal.II/fe/fe_dgp.h>
+#include <deal.II/fe/fe_nedelec.h>
+#include <deal.II/fe/fe_raviart_thomas.h>
+#include <deal.II/fe/fe_system.h>
+
+#include <fstream>
+#include <iostream>
+#include <iomanip>
+#include <string>
+
+
+// forward declaration of the function that must be provided in the
+// .cc files
+template <int dim>
+void
+check_this (const DoFHandler<dim> &dof_handler);
+
+
+void
+output_vector (std::vector<bool> &v)
+{
+  for (unsigned int i=0; i<v.size(); ++i)
+    deallog << (v[i] ? '1' : '0');
+  deallog << std::endl;
+}
+
+
+void
+output_vector (std::vector<unsigned int> &v)
+{
+  for (unsigned int i=0; i<v.size(); ++i)
+    deallog << ' ' << v[i];
+  deallog << std::endl;
+}
+
+
+
+template <int dim>
+void
+check (const Triangulation<dim> &tria,
+       const FiniteElement<dim> &fe)
+{
+  deallog << fe.get_name() << std::endl;
+
+  DoFHandler<dim> dof_handler (tria);
+  dof_handler.distribute_dofs (fe);
+
+  // call main function in .cc files
+  check_this (dof_handler);
+}
+
+
+template <int dim>
+void check_grid(const Triangulation<dim> &tr)
+{
+  FE_Q<dim> q1(1);
+  check(tr, q1);
+  FE_Q<dim> q2(2);
+  check(tr, q2);
+  FE_Q<dim> q3(3);
+  check(tr, q3);
+
+  FE_DGQ<dim> dgq0(0);
+  check(tr, dgq0);
+  FE_DGQ<dim> dgq1(1);
+  check(tr, dgq1);
+  FE_DGQ<dim> dgq2(2);
+  check(tr, dgq2);
+
+  FE_DGP<dim> dgp1(1);
+  check(tr, dgp1);
+  FE_DGP<dim> dgp2(2);
+  check(tr, dgp2);
+
+  FE_Nedelec<dim> nedelec1(1);
+  check(tr, nedelec1);
+
+  FE_RaviartThomas<dim> rt0(0);
+  check(tr, rt0);
+  FE_RaviartThomas<dim> rt1(1);
+  check(tr, rt1);
+  FE_RaviartThomas<dim> rt2(2);
+  check(tr, rt2);
+
+  FESystem<dim> s1(q1, 3);
+  check(tr, s1);
+  FESystem<dim> s2(dgq1, 2, q1, 1);
+  check(tr, s2);
+  FESystem<dim> s3(q1, 2, dgq0, 3);
+  check(tr, s3);
+  FESystem<dim> s4(q1, 3, dgq0, 2, dgp1, 1);
+  check(tr, s4);
+
+  FESystem<dim> s10(rt1, 1, dgq1, 1);
+  check(tr, s10);
+  FESystem<dim> s11(rt0, 2, rt1, 1);
+  check(tr, s11);
+
+  FESystem<dim> ss1(s1, 2, s3, 1);
+  check(tr, ss1);
+}
+
+
diff --git a/tests/lib/test_grids.h b/tests/lib/test_grids.h
new file mode 100644 (file)
index 0000000..c541b41
--- /dev/null
@@ -0,0 +1,130 @@
+// ---------------------------------------------------------------------
+// $Id: test_grids.h 30049 2013-07-18 19:42:40Z maier $
+//
+// Copyright (C) 2006 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+#include <deal.II/grid/tria.h>
+#include <deal.II/grid/tria_iterator.h>
+#include <deal.II/grid/tria_accessor.h>
+#include <deal.II/grid/grid_generator.h>
+
+/**
+ * A set of test meshes for the deal.II test suite.
+ *
+ * These meshes exhibit certain key features for writing tests. If you
+ * want to test certain properties of algorithms, the following table
+ * might be of help.
+ *
+ * <table border=1>
+ * <tr><th>Mesh</th><th>Feature tested</th></tr>
+ * <tr><td>#hypercube(tr)</td><td>works at all on a single
+ * cell</td></tr>
+ * <tr><td>#hypercube(tr,2)</td><td>works on uniform meshes</td></tr>
+ * <tr><td>#hypercube(tr,3,true)</td><td>works with local
+ * refinement</td></tr>
+ * <tr><td>#star_shaped(tr,1)</td><td>method is robust if more than
+ * usual cells meet in one vertex</td></tr>
+ * <tr><td>#star_shaped(tr,2,true)</td><td>method is robust if more than
+ * usual cells meet in one vertex and local refinement exceeds one
+ * level</td></tr>
+ * </table>
+ *
+ * @author Guido Kanschat
+ * @date 2006, 2010
+ */
+namespace TestGrids
+{
+  /**
+   * Generate grids based on
+   * hypercube. These meshes have a
+   * regular geometry and topology.
+   *
+   * @param <tt>refinement</tt>
+   * denotes the number of refinement
+   * steps of the root cell.
+   *
+   * @param if <tt>local</tt> is
+   * <tt>true</tt>, refine only the
+   * cell containing the corner with
+   * only negative coordinates.
+   */
+  template <int dim>
+  void hypercube(Triangulation<dim> &tr,
+                 unsigned int refinement = 0,
+                 bool local = false)
+  {
+    GridGenerator::hyper_cube(tr, -1., 1.);
+    if (refinement && !local)
+      tr.refine_global(refinement);
+    if (refinement && local)
+      {
+        tr.refine_global(1);
+        for (unsigned int i=1; i<refinement; ++i)
+          {
+            for (typename Triangulation<dim>::active_cell_iterator
+                 cell = tr.begin_active(); cell != tr.end(); ++cell)
+              {
+                const Point<dim> &p = cell->center();
+                bool negative = true;
+                for (unsigned int d=0; d<dim; ++d)
+                  if (p(d) >= 0.)negative = false;
+                if (negative)
+                  cell->set_refine_flag();
+              }
+            tr.execute_coarsening_and_refinement();
+          }
+      }
+    deallog << "Triangulation hypercube " << dim << "D refinement " << refinement;
+    if (local)
+      deallog << " local ";
+    deallog << " steps " << tr.n_active_cells() << " active cells "
+            << tr.n_cells() << " total cells " << std::endl;
+  }
+
+  /**
+   * Create a star-shaped mesh,
+   * having more than the average
+   * <tt>2<sup>dim</sup></tt> cells
+   * in the central vertex.
+   *
+   * @param <tt>refinement</tt>
+   * denotes the number of refinement
+   * steps of the root mesh.
+   *
+   * @param if <tt>local</tt> is
+   * <tt>true</tt>, refine only one
+   * of the coarse cells.
+   */
+  template <int dim>
+  void star_shaped(Triangulation<dim> &tr,
+                   unsigned int refinement = 0,
+                   bool local = false);
+  /**
+   * Local refinement of every other
+   * cell in a checkerboard fashion.
+   */
+  template <int dim>
+  void checkers(Triangulation<dim> &tr);
+  /**
+   * Islands of local refinement
+   */
+  template <int dim>
+  void islands(Triangulation<dim> &tr);
+  /**
+   * Local refinement with an
+   * unrefined hole.
+   */
+  template <int dim>
+  void laguna(Triangulation<dim> &tr);
+}

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.