From: hartmann Date: Sun, 24 Feb 2008 10:34:54 +0000 (+0000) Subject: New Boundary::get_new_point_on_face and get_intermediate_points_on_face functions... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46e5346423011c8a8a0bc4e2bef2ad3a86d83ccd;p=dealii-svn.git New Boundary::get_new_point_on_face and get_intermediate_points_on_face functions offer an dimension independent interface to this class. git-svn-id: https://svn.dealii.org/trunk@15763 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/grid/tria_boundary.h b/deal.II/deal.II/include/grid/tria_boundary.h index 9d33db0bb9..2ce14dc53b 100644 --- a/deal.II/deal.II/include/grid/tria_boundary.h +++ b/deal.II/deal.II/include/grid/tria_boundary.h @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -73,7 +73,7 @@ template class Triangulation; * around a given center point. * * @ingroup boundary - * @author Wolfgang Bangerth, 1999, 2001, Ralf Hartmann, 2001 + * @author Wolfgang Bangerth, 1999, 2001, Ralf Hartmann, 2001, 2008 */ template class Boundary : public Subscriptor @@ -155,6 +155,21 @@ class Boundary : public Subscriptor virtual Point get_new_point_on_quad (const typename Triangulation::quad_iterator &quad) const; + /** + * Depending on dim=2 or + * dim=3 this function + * calls the + * get_new_point_on_line or the + * get_new_point_on_quad + * function. It throws an + * exception for + * dim=1. This wrapper + * allows dimension independent + * programming. + */ + Point + get_new_point_on_face (const typename Triangulation::face_iterator &face) const; + /** * Return equally spaced * intermediate points on a line. @@ -217,6 +232,23 @@ class Boundary : public Subscriptor get_intermediate_points_on_quad (const typename Triangulation::quad_iterator &quad, std::vector > &points) const; + /** + * Depending on dim=2 or + * dim=3 this function + * calls the + * get_intermediate_points_on_line + * or the + * get_intermediate_points_on_quad + * function. It throws an + * exception for + * dim=1. This wrapper + * allows dimension independent + * programming. + */ + void + get_intermediate_points_on_face (const typename Triangulation::face_iterator &face, + std::vector > &points) const; + /** * Compute the normal vectors to * the boundary at each vertex of @@ -363,6 +395,39 @@ class StraightBoundary : public Boundary #ifndef DOXYGEN +template <> +Point<1> +Boundary<1>:: +get_new_point_on_face (const Triangulation<1>::face_iterator &) const; + +template <> +Point<2> +Boundary<2>:: +get_new_point_on_face (const Triangulation<2>::face_iterator &) const; + +template <> +Point<3> +Boundary<3>:: +get_new_point_on_face (const Triangulation<3>::face_iterator &) const; + +template <> +void +Boundary<1>:: +get_intermediate_points_on_face (const Triangulation<1>::face_iterator &, + std::vector > &) const; + +template <> +void +Boundary<2>:: +get_intermediate_points_on_face (const Triangulation<2>::face_iterator &, + std::vector > &) const; + +template <> +void +Boundary<3>:: +get_intermediate_points_on_face (const Triangulation<3>::face_iterator &, + std::vector > &) const; + template <> void StraightBoundary<1>:: diff --git a/deal.II/deal.II/source/grid/tria_boundary.cc b/deal.II/deal.II/source/grid/tria_boundary.cc index a4ce3d3890..a1628c34cd 100644 --- a/deal.II/deal.II/source/grid/tria_boundary.cc +++ b/deal.II/deal.II/source/grid/tria_boundary.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -62,6 +62,71 @@ get_intermediate_points_on_quad (const typename Triangulation::quad_iterato Assert (false, ExcPureFunctionCalled()); } +#if deal_II_dimension == 1 + +template <> +Point<1> +Boundary<1>:: +get_new_point_on_face (const Triangulation<1>::face_iterator &) const +{ + Assert (false, ExcImpossibleInDim(1)); + return Point<1>(); +} + +template <> +void +Boundary<1>:: +get_intermediate_points_on_face (const Triangulation<1>::face_iterator &, + std::vector > &) const +{ + Assert (false, ExcImpossibleInDim(1)); +} + +#endif + +#if deal_II_dimension == 2 + +template <> +Point<2> +Boundary<2>:: +get_new_point_on_face (const Triangulation<2>::face_iterator &face) const +{ + return get_new_point_on_line(face); +} + +template <> +void +Boundary<2>:: +get_intermediate_points_on_face (const Triangulation<2>::face_iterator &face, + std::vector > &points) const +{ + get_intermediate_points_on_line(face, points); +} + +#endif + + +#if deal_II_dimension == 3 + +template <> +Point<3> +Boundary<3>:: +get_new_point_on_face (const Triangulation<3>::face_iterator &face) const +{ + return get_new_point_on_quad(face); +} + +template <> +void +Boundary<3>:: +get_intermediate_points_on_face (const Triangulation<3>::face_iterator &face, + std::vector > &points) const +{ + get_intermediate_points_on_quad(face, points); +} + +#endif + template