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
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;
}
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;
}
-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
// $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
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;
}
}
// $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
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;
}
}