]> https://gitweb.dealii.org/ - dealii.git/commitdiff
test cochain runs on 2D with local refinement and on 3D with global
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Tue, 9 Nov 2010 16:26:19 +0000 (16:26 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Tue, 9 Nov 2010 16:26:19 +0000 (16:26 +0000)
git-svn-id: https://svn.dealii.org/trunk@22649 0785d39b-7218-0410-832d-ea1e28bc413d

tests/integrators/cochain_01.cc
tests/integrators/cochain_01/cmp/generic [new file with mode: 0644]
tests/lib/test_grids.h

index f410187d270cc30bda712eea79b3a73037fb5941..c217acda5297246a6608adaf22a9c536c37cbeac 100644 (file)
@@ -211,7 +211,7 @@ test_cochain(const Triangulation<dim>& tr, const FiniteElement<dim>& fe)
     }
 }
 
-void run (const Triangulation<2>& tr, unsigned int degree)
+void run2d (unsigned int degree)
 {
   std::ostringstream prefix;
   prefix << "d2-p" << degree;
@@ -224,12 +224,32 @@ void run (const Triangulation<2>& tr, unsigned int degree)
 
   FESystem<2> fe(h1,1,hdiv,1,l2,1);
 
-  test_cochain(tr, fe);
+  if (true)
+    {
+      Triangulation<2> tr;
+      TestGrids::hypercube(tr, 1);
+      test_cochain(tr, fe);
+    }
+  
+  if (true)
+    {
+      Triangulation<2> tr;
+      TestGrids::hypercube(tr, 2, true);
+      test_cochain(tr, fe);
+    }
+  
+  if (true)
+    {
+      Triangulation<2> tr;
+      TestGrids::hypercube(tr, 3, true);
+      test_cochain(tr, fe);
+    }
+  
   deallog.pop();
 }
 
 
-void run (const Triangulation<3>& tr, unsigned int degree)
+void run3d (unsigned int degree)
 {
   std::ostringstream prefix;
   prefix << "d3-p" << degree;
@@ -247,8 +267,20 @@ void run (const Triangulation<3>& tr, unsigned int degree)
 
   FESystem<3> fe(h1,1,hcurl,1,hdiv,1,l2,1);
 
-  test_cochain(tr, fe);
-  deallog.pop();
+    if (true)
+    {
+      Triangulation<3> tr;
+      TestGrids::hypercube(tr, 1);
+      test_cochain(tr, fe);
+    }
+    
+  if (true)
+    {
+      Triangulation<3> tr(Triangulation<3>::limit_level_difference_at_vertices);
+      TestGrids::hypercube(tr, 2, true);
+      test_cochain(tr, fe);
+    }
+deallog.pop();
 }
 
 
@@ -257,17 +289,16 @@ int main()
   const std::string logname = JobIdentifier::base_name(__FILE__) + std::string("/output");
   std::ofstream logfile(logname.c_str());
   deallog.attach(logfile);
-//  deallog.depth_console(0);
-//  deallog.threshold_double(1.e-10);
-
-  Triangulation<2> tr2;
-  TestGrids::hypercube(tr2, 1);
-  run(tr2, 0);
-  run(tr2, 1);
-  run(tr2, 2);
+  if (!debugging)
+    {
+      deallog.depth_console(0);
+      deallog.threshold_double(1.e-10);
+    }
+  
+  run2d(0);
+  run2d(1);
+  run2d(2);
   
-  Triangulation<3> tr3;
-  TestGrids::hypercube(tr3, 1);
-  run(tr3, 0);
-  run(tr3, 1);
+  run3d(0);
+  run3d(1);
 }
diff --git a/tests/integrators/cochain_01/cmp/generic b/tests/integrators/cochain_01/cmp/generic
new file mode 100644 (file)
index 0000000..58aefa2
--- /dev/null
@@ -0,0 +1,91 @@
+
+DEAL:d2-p0::Setup
+DEAL:d2-p0::Triangulation hypercube 2D refinement 1 steps 4 active cells 5 total cells 
+DEAL:d2-p0::Form 0
+DEAL:d2-p0::Difference d*d 0
+DEAL:d2-p0::Form 1
+DEAL:d2-p0::d^2            0
+DEAL:d2-p0::d*d^2          0
+DEAL:d2-p0::Difference d*d 0
+DEAL:d2-p0::Triangulation hypercube 2D refinement 2 local  steps 7 active cells 9 total cells 
+DEAL:d2-p0::Form 0
+DEAL:d2-p0::Difference d*d 0
+DEAL:d2-p0::Form 1
+DEAL:d2-p0::d^2            0
+DEAL:d2-p0::d*d^2          0
+DEAL:d2-p0::Difference d*d 0
+DEAL:d2-p0::Triangulation hypercube 2D refinement 3 local  steps 25 active cells 33 total cells 
+DEAL:d2-p0::Form 0
+DEAL:d2-p0::Difference d*d 0
+DEAL:d2-p0::Form 1
+DEAL:d2-p0::d^2            0
+DEAL:d2-p0::d*d^2          0
+DEAL:d2-p0::Difference d*d 0
+DEAL:d2-p1::Setup
+DEAL:d2-p1::Triangulation hypercube 2D refinement 1 steps 4 active cells 5 total cells 
+DEAL:d2-p1::Form 0
+DEAL:d2-p1::Difference d*d 0
+DEAL:d2-p1::Form 1
+DEAL:d2-p1::d^2            0
+DEAL:d2-p1::d*d^2          0
+DEAL:d2-p1::Difference d*d 0
+DEAL:d2-p1::Triangulation hypercube 2D refinement 2 local  steps 7 active cells 9 total cells 
+DEAL:d2-p1::Form 0
+DEAL:d2-p1::Difference d*d 0
+DEAL:d2-p1::Form 1
+DEAL:d2-p1::d^2            0
+DEAL:d2-p1::d*d^2          0
+DEAL:d2-p1::Difference d*d 0
+DEAL:d2-p1::Triangulation hypercube 2D refinement 3 local  steps 25 active cells 33 total cells 
+DEAL:d2-p1::Form 0
+DEAL:d2-p1::Difference d*d 0
+DEAL:d2-p1::Form 1
+DEAL:d2-p1::d^2            0
+DEAL:d2-p1::d*d^2          0
+DEAL:d2-p1::Difference d*d 0
+DEAL:d2-p2::Setup
+DEAL:d2-p2::Triangulation hypercube 2D refinement 1 steps 4 active cells 5 total cells 
+DEAL:d2-p2::Form 0
+DEAL:d2-p2::Difference d*d 0
+DEAL:d2-p2::Form 1
+DEAL:d2-p2::d^2            0
+DEAL:d2-p2::d*d^2          0
+DEAL:d2-p2::Difference d*d 0
+DEAL:d2-p2::Triangulation hypercube 2D refinement 2 local  steps 7 active cells 9 total cells 
+DEAL:d2-p2::Form 0
+DEAL:d2-p2::Difference d*d 0
+DEAL:d2-p2::Form 1
+DEAL:d2-p2::d^2            0
+DEAL:d2-p2::d*d^2          0
+DEAL:d2-p2::Difference d*d 0
+DEAL:d2-p2::Triangulation hypercube 2D refinement 3 local  steps 25 active cells 33 total cells 
+DEAL:d2-p2::Form 0
+DEAL:d2-p2::Difference d*d 0
+DEAL:d2-p2::Form 1
+DEAL:d2-p2::d^2            0
+DEAL:d2-p2::d*d^2          0
+DEAL:d2-p2::Difference d*d 0
+DEAL:d3-p0::Setup
+DEAL:d3-p0::Triangulation hypercube 3D refinement 1 steps 8 active cells 9 total cells 
+DEAL:d3-p0::Form 0
+DEAL:d3-p0::Difference d*d 0
+DEAL:d3-p0::Form 1
+DEAL:d3-p0::d^2            0
+DEAL:d3-p0::d*d^2          0
+DEAL:d3-p0::Difference d*d 0
+DEAL:d3-p0::Form 2
+DEAL:d3-p0::d^2            0
+DEAL:d3-p0::d*d^2          0
+DEAL:d3-p0::Difference d*d 0
+DEAL:d3-p1::Setup
+DEAL:d3-p1::Triangulation hypercube 3D refinement 1 steps 8 active cells 9 total cells 
+DEAL:d3-p1::Form 0
+DEAL:d3-p1::Difference d*d 0
+DEAL:d3-p1::Form 1
+DEAL:d3-p1::d^2            0
+DEAL:d3-p1::d*d^2          0
+DEAL:d3-p1::Difference d*d 0
+DEAL:d3-p1::Form 2
+DEAL:d3-p1::d^2            0
+DEAL:d3-p1::d*d^2          0
+DEAL:d3-p1::Difference d*d 0
index f5e44d56d7a28079356012025492140d673808ce..d8b2614b18d4c03962d783091fb49e86579fec6e 100644 (file)
@@ -59,7 +59,7 @@ namespace TestGrids
                 unsigned int refinement = 0,
                 bool local = false)
   {
-    GridGenerator::hyper_cube(tr);
+    GridGenerator::hyper_cube(tr, -1., 1.);
     if (refinement && !local)
       tr.refine_global(refinement);
     if (refinement && local)
@@ -74,6 +74,8 @@ namespace TestGrids
                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();
          }

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.