From 070d10038ba7c176539b04f9514432ad4113ac7b Mon Sep 17 00:00:00 2001 From: Jason Sheldon Date: Fri, 7 Aug 2015 15:46:52 -0400 Subject: [PATCH] Changed function name and added test --- include/deal.II/fe/mapping.h | 2 +- source/fe/mapping.cc | 2 +- tests/fe/mapping_project_01.cc | 127 +++++++++++++++++++++++++++++ tests/fe/mapping_project_01.output | 23 ++++++ 4 files changed, 152 insertions(+), 2 deletions(-) create mode 100644 tests/fe/mapping_project_01.cc create mode 100644 tests/fe/mapping_project_01.output diff --git a/include/deal.II/fe/mapping.h b/include/deal.II/fe/mapping.h index 4cb023ce56..dce14e0666 100644 --- a/include/deal.II/fe/mapping.h +++ b/include/deal.II/fe/mapping.h @@ -285,7 +285,7 @@ public: * so it throws an exception in this case. */ virtual Point - transform_real_to_unit_projected_to_face ( + project_real_point_to_unit_point_on_face ( const typename Triangulation::cell_iterator &cell, const unsigned int &face_no, const Point &p) const; diff --git a/source/fe/mapping.cc b/source/fe/mapping.cc index f3e7432afe..46b5378c2a 100644 --- a/source/fe/mapping.cc +++ b/source/fe/mapping.cc @@ -42,7 +42,7 @@ Mapping::get_vertices ( template Point Mapping:: -transform_real_to_unit_projected_to_face ( +project_real_point_to_unit_point_on_face ( const typename Triangulation::cell_iterator &cell, const unsigned int &face_no, const Point &p) const diff --git a/tests/fe/mapping_project_01.cc b/tests/fe/mapping_project_01.cc new file mode 100644 index 0000000000..dd85fa48da --- /dev/null +++ b/tests/fe/mapping_project_01.cc @@ -0,0 +1,127 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2015 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. +// +// --------------------------------------------------------------------- + +// Tests for project_real_point_to_unit_point_on_face in 2D and 3D on a cube, +// and also in 3D with a parallelepiped, checks against expected values. + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace dealii; +void dim2_grid () +{ + Triangulation<2> triangulation; + + const Point<2> p_ll (-1, -1);//lower left point + const Point<2> p_ur (1, 1);//upper right point + GridGenerator::hyper_rectangle (triangulation, p_ll, p_ur, false); + + const Point<2> testp (.5, -.5); //test point + + MappingQ1<2> mapping; + + deallog<<"Check project for 2D cube from (-1,-1), to (1,1)."<::active_cell_iterator + cell = triangulation.begin_active(), + endc = triangulation.end(); + deallog<<"The test point has real coordinates: "<::faces_per_cell; ++face) + { + deallog<<"For face: "< triangulation; + + const Point<3> p_ll (-1, -1, -1);//lower left point + const Point<3> p_ur (1, 1, 1);//upper right point + GridGenerator::hyper_rectangle (triangulation, p_ll, p_ur, false); + + const Point<3> testp (.5, -.5, 0); //test point + + MappingQ1<3> mapping; + + deallog<<"Check project for 3D cube from (-1,-1,-1) to (1,1,1)."<::active_cell_iterator + cell = triangulation.begin_active(), + endc = triangulation.end(); + deallog<<"The test point has real coordinates: "<::faces_per_cell; ++face) + { + deallog<<"For face: "< triangulation; + + Point<3> (corners) [3]; + corners[0] = Point<3> (2, 0, 0); + corners[1] = Point<3> (0, 2, 0); + corners[2] = Point<3> (0, 1, 2); + + GridGenerator::parallelepiped (triangulation, corners); + + const Point<3> testp (1, 1, 1); //test point + + MappingQ1<3> mapping; + + deallog<<"Check project for 3D parallelepiped with vectors (2, 0, 0), (0, 2, 0), and (0, 1, 2)."<::active_cell_iterator + cell = triangulation.begin_active(), + endc = triangulation.end(); + deallog<<"The test point has real coordinates: "<::faces_per_cell; ++face) + { + deallog<<"For face: "<