]> https://gitweb.dealii.org/ - dealii.git/commitdiff
New test for GridGenerator::moebius(). Currently only works on branch_general_meshes...
authorTobias Leicht <tobias.leicht@dlr.de>
Fri, 26 Jan 2007 08:50:49 +0000 (08:50 +0000)
committerTobias Leicht <tobias.leicht@dlr.de>
Fri, 26 Jan 2007 08:50:49 +0000 (08:50 +0000)
git-svn-id: https://svn.dealii.org/trunk@14382 0785d39b-7218-0410-832d-ea1e28bc413d

tests/fail/grid_generator_04.cc [new file with mode: 0644]

diff --git a/tests/fail/grid_generator_04.cc b/tests/fail/grid_generator_04.cc
new file mode 100644 (file)
index 0000000..dd657c7
--- /dev/null
@@ -0,0 +1,105 @@
+//---------------------------------------------------------------------------
+//    $Id: grid_generator_02.cc 14204 2006-11-17 03:49:08Z bangerth $
+//    Version: $Name$ 
+//
+//    Copyright (C) 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.
+//
+//---------------------------------------------------------------------------
+
+
+// Test GridGenerator::moebius
+
+#include "../tests.h"
+#include <base/logstream.h>
+#include <base/tensor.h>
+#include <grid/tria.h>
+#include <grid/grid_generator.h>
+#include <grid/grid_out.h>
+#include <fe/fe_q.h>
+
+#include <fstream>
+#include <iostream>
+
+
+template<int dim>
+void test(std::ostream& out)
+{
+  Point<dim> p1;
+  p1[0] = 2.;
+  if (dim>1) p1[1] = -1.;
+  if (dim>2) p1[2] = 0.;
+  Point<dim> p2;
+  p2[0] = 3.;
+  if (dim>1) p2[1] = 2.;
+  if (dim>2) p2[2] = 4.;
+  Point<dim> p3;
+  p3[0] = 2.;
+  if (dim>1) p3[1] = 1.;
+  if (dim>2) p3[2] = 4.;
+  
+
+                                   // loop without rotation 
+  if (true)
+    {
+      deallog <<"moebius, no rotation" << std::endl;
+      Triangulation<dim> tr;
+      GridGenerator::moebius(tr, 20, 0, 10.0, 2.0);
+      GridOut().write_ucd(tr, out);
+    }
+
+                                   // loop with quarter rotation (1 * pi/2)
+  if (true)
+    {
+      deallog << "---------------------------"<<std::endl
+             << "moebius, quarter rotation (1* Pi/2)" << std::endl;
+      Triangulation<dim> tr;
+      GridGenerator::moebius(tr, 20, 1, 10.0, 2.0);
+      GridOut().write_ucd(tr, out);
+    }
+
+                                   // loop with half rotation (2 * pi/2)
+  if (true)
+    {
+      deallog << "---------------------------"<<std::endl
+             << "moebius, half rotation (2* Pi/2)" << std::endl;
+      Triangulation<dim> tr;
+      GridGenerator::moebius(tr, 20, 2, 10.0, 2.0);
+      GridOut().write_ucd(tr, out);
+    }
+
+                                   // loop with three quarter rotation (3 * pi/2)
+  if (true)
+    {
+      deallog << "---------------------------"<<std::endl
+             << "moebius, three quarter rotation (3* Pi/2)" << std::endl;
+      Triangulation<dim> tr;
+      GridGenerator::moebius(tr, 20, 3, 10.0, 2.0);
+      GridOut().write_ucd(tr, out);
+    }
+
+                                   // loop with full rotation (1 * pi/2)
+  if (true)
+    {
+      deallog << "---------------------------"<<std::endl
+             << "moebius, full rotation (2* Pi)" << std::endl;
+      Triangulation<dim> tr;
+      GridGenerator::moebius(tr, 20, 4, 10.0, 2.0);
+      GridOut().write_ucd(tr, out);
+    }
+}
+
+
+int main()
+{
+  std::ofstream logfile("grid_generator_04/output");
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+  
+  test<3>(logfile);
+}

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.