]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Added tests for mapping q eulerian and transform_real_to_unit
authorheltai <heltai@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 17 May 2011 17:26:59 +0000 (17:26 +0000)
committerheltai <heltai@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 17 May 2011 17:26:59 +0000 (17:26 +0000)
git-svn-id: https://svn.dealii.org/trunk@23716 0785d39b-7218-0410-832d-ea1e28bc413d

tests/codim_one/mapping_03.cc
tests/codim_one/mapping_03/cmp/generic
tests/codim_one/mapping_q1.cc
tests/codim_one/mapping_q1_eulerian.cc

index 385f4069e84f90b22ac7ca384faf462ed9480994..dd64bda7235689636ab9355cc432e47c1c4b9026 100644 (file)
 
 
 template <int dim>
-void test ()
+void test (unsigned int degree)
 {
   Triangulation<dim-1, dim> mesh;
   GridGenerator::hyper_cube(mesh);
 
   QGauss<dim-1> quadrature(dim == 2 ? 3 : 2);
-  MappingQ<dim-1,dim> mapping(1);
+  MappingQ<dim-1,dim> mapping(degree);
   Point<dim> p;
 
                                   // Try to project a point on the
@@ -47,7 +47,7 @@ void test ()
   Point<dim-1> q =
     mapping.transform_real_to_unit_cell(mesh.begin_active(), p);
 
-  deallog << "P: " << p
+  deallog << "Mapping Q("<< degree<< "): P: " << p
          << ", on unit: " << q << endl;
   
 }
@@ -60,8 +60,11 @@ int main ()
   deallog.attach(logfile);
   deallog.depth_console(3);
 
-  test<2> ();
-  test<3> ();
+  test<2> (1);
+  test<2> (2);
+  
+  test<3> (1);
+  test<3> (2);
 
   return 0;
 }
index 44eb1f435e77ea832a7f811f4ed468150ac2c28e..5df3a30607c457aa2d41533b5e3b0c1573c0541b 100644 (file)
@@ -1,3 +1,5 @@
 
-DEAL::P: 0.200000 0.200000, on unit: 0.200000
-DEAL::P: 0.200000 0.200000 0.200000, on unit: 0.200000 0.200000
+DEAL::Mapping Q(1): P: 0.200000 0.200000, on unit: 0.200000
+DEAL::Mapping Q(2): P: 0.200000 0.200000, on unit: 0.200000
+DEAL::Mapping Q(1): P: 0.200000 0.200000 0.200000, on unit: 0.200000 0.200000
+DEAL::Mapping Q(2): P: 0.200000 0.200000 0.200000, on unit: 0.200000 0.200000
index a3e6f6364b440d2117aa1491939d6533323b39ec..5a37de4cda6e19fd3f592f3b5cf88d183a173997 100644 (file)
@@ -3,7 +3,7 @@
 //    $Id$
 //    Version: $Name$ 
 //
-//    Copyright (C) 2005, 2010 by the deal.II authors 
+//    Copyright (C) 2005, 2010, 2011 by the deal.II authors 
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -51,14 +51,17 @@ void test(std::string filename) {
     endc=tria.end() ;
   Point<spacedim> real;
   Point<dim> unit;
+  double eps = 1e-10;
   for(;cell!=endc;++cell)
     {
-      deallog<<cell<< std::endl;       
+      deallog<<cell<< std::endl;        
       for(unsigned int q=0; q<quad.size(); ++q)
        {
          real = mapping.transform_unit_to_real_cell(cell, quad.point(q));
-         // unit = mapping.transform_real_to_unit_cell(cell, real);
+         unit = mapping.transform_real_to_unit_cell(cell, real);
          deallog<<quad.point(q)<< " -> " << real << std::endl;
+         if( (unit-quad.point(q)).norm()>eps)
+           deallog<<quad.point(q)<< " ->-> " << unit << std::endl;
        }
     }     
     
index 96eb2b51a2b6595b3a4cd4baa2e7a18faa8d8567..c99ee613b2e67b2a94351b7c5fbacb332df4c812 100644 (file)
@@ -3,7 +3,7 @@
 //    $Id$
 //    Version: $Name$ 
 //
-//    Copyright (C) 2005, 2009, 2010 by the deal.II authors 
+//    Copyright (C) 2005, 2009, 2010, 2011 by the deal.II authors 
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -66,14 +66,17 @@ void test(std::string filename) {
     endc=tria.end() ;
   Point<spacedim> real;
   Point<dim> unit;
+  double eps = 1e-10;
   for(;cell!=endc;++cell)
     {
       deallog<<cell<< std::endl;       
       for(unsigned int q=0; q<quad.size(); ++q)
        {
          real = mapping.transform_unit_to_real_cell(cell, quad.point(q));
-         // unit = mapping.transform_real_to_unit_cell(cell, real);
+         unit = mapping.transform_real_to_unit_cell(cell, real);
          deallog<<quad.point(q)<< " -> " << real << std::endl;
+         if( (unit-quad.point(q)).norm()>eps)
+           deallog<<quad.point(q)<< " ->-> " << unit << std::endl;
        }
     }     
     

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.