]> https://gitweb.dealii.org/ - dealii.git/commitdiff
New Boundary::get_new_point_on_face and get_intermediate_points_on_face functions...
authorRalf Hartmann <Ralf.Hartmann@dlr.de>
Sun, 24 Feb 2008 10:34:54 +0000 (10:34 +0000)
committerRalf Hartmann <Ralf.Hartmann@dlr.de>
Sun, 24 Feb 2008 10:34:54 +0000 (10:34 +0000)
git-svn-id: https://svn.dealii.org/trunk@15763 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/grid/tria_boundary.h
deal.II/deal.II/source/grid/tria_boundary.cc

index 9d33db0bb9a13b9cede6b6ff59e2a6d36bd2138b..2ce14dc53b14bf9ec87e1be0103487d19df748d2 100644 (file)
@@ -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 <int dim> 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 <int dim>
 class Boundary : public Subscriptor
@@ -155,6 +155,21 @@ class Boundary : public Subscriptor
     virtual Point<dim>
     get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const;
 
+                                    /**
+                                     * Depending on <tt>dim=2</tt> or
+                                     * <tt>dim=3</tt> this function
+                                     * calls the
+                                     * get_new_point_on_line or the
+                                     * get_new_point_on_quad
+                                     * function. It throws an
+                                     * exception for
+                                     * <tt>dim=1</tt>. This wrapper
+                                     * allows dimension independent
+                                     * programming.
+                                     */
+    Point<dim>
+    get_new_point_on_face (const typename Triangulation<dim>::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<dim>::quad_iterator &quad,
                                     std::vector<Point<dim> > &points) const;
 
+                                    /**
+                                     * Depending on <tt>dim=2</tt> or
+                                     * <tt>dim=3</tt> this function
+                                     * calls the
+                                     * get_intermediate_points_on_line
+                                     * or the
+                                     * get_intermediate_points_on_quad
+                                     * function. It throws an
+                                     * exception for
+                                     * <tt>dim=1</tt>. This wrapper
+                                     * allows dimension independent
+                                     * programming.
+                                     */
+    void
+    get_intermediate_points_on_face (const typename Triangulation<dim>::face_iterator &face,
+                                    std::vector<Point<dim> > &points) const;
+
                                     /**
                                      * Compute the normal vectors to
                                      * the boundary at each vertex of
@@ -363,6 +395,39 @@ class StraightBoundary : public Boundary<dim>
 
 #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<Point<1> > &) const;
+
+template <>
+void
+Boundary<2>::
+get_intermediate_points_on_face (const Triangulation<2>::face_iterator &,
+                                std::vector<Point<2> > &) const;
+
+template <>
+void
+Boundary<3>::
+get_intermediate_points_on_face (const Triangulation<3>::face_iterator &,
+                                std::vector<Point<3> > &) const;
+
 template <>
 void
 StraightBoundary<1>::
index a4ce3d3890c0289a8e4fcb1c7d26429855a86c8a..a1628c34cdef1500ace57371c72044c99c3b38b5 100644 (file)
@@ -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<dim>::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<Point<1> > &) 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<Point<2> > &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<Point<3> > &points) const
+{
+  get_intermediate_points_on_quad(face, points);
+}
+
+#endif
+
 
 
 template <int dim>

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.