]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Removed reference to Boundary from MappingQ
authorheltai <heltai@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 25 Aug 2013 17:29:50 +0000 (17:29 +0000)
committerheltai <heltai@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 25 Aug 2013 17:29:50 +0000 (17:29 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_manifold_id@30482 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/fe/mapping_q.h
deal.II/source/fe/mapping_q.cc

index 28e4aefcbf1e75d334bc88c11bcfc2198c4b87d2..e43960e0159e27146c9e4efa5e71dd248a25d49a 100644 (file)
@@ -464,13 +464,6 @@ void MappingQ<1>::compute_laplace_vector(Table<2,double> &) const;
 template <>
 void MappingQ<1>::add_line_support_points (const Triangulation<1>::cell_iterator &,
                                            std::vector<Point<1> > &) const;
-template <>
-void MappingQ<1,2>::add_line_support_points (const Triangulation<1,2>::cell_iterator &,
-                                             std::vector<Point<2> > &) const;
-template <>
-void MappingQ<1,3>::add_line_support_points (const Triangulation<1,3>::cell_iterator &,
-                                             std::vector<Point<3> > &) const;
-
 template<>
 void MappingQ<3>::add_quad_support_points(const Triangulation<3>::cell_iterator &cell,
                                           std::vector<Point<3> >                &a) const;
index 4ee1d4374c86afca511c663c7f6ffba075b4554d..26a26c7b25ac2386142dc5dbb0fa0b0db0670284 100644 (file)
@@ -22,7 +22,7 @@
 #include <deal.II/base/tensor_product_polynomials.h>
 #include <deal.II/lac/full_matrix.h>
 #include <deal.II/grid/tria_iterator.h>
-#include <deal.II/grid/tria_boundary.h>
+#include <deal.II/grid/manifold.h>
 #include <deal.II/dofs/dof_accessor.h>
 #include <deal.II/fe/fe_tools.h>
 #include <deal.II/fe/mapping_q.h>
@@ -756,89 +756,23 @@ MappingQ<1>::add_line_support_points (const Triangulation<1>::cell_iterator &,
 }
 
 
-
-template <>
-void
-MappingQ<1,2>::add_line_support_points (const Triangulation<1,2>::cell_iterator &cell,
-                                        std::vector<Point<2> > &a) const
-{
-  const unsigned int dim      = 1;
-  const unsigned int spacedim = 2;
-  // Ask for the mid point, if that's the only thing we need.
-  if (degree==2)
-    {
-      const Boundary<dim,spacedim> *const boundary
-        = &(cell->get_triangulation().get_boundary(cell->material_id()));
-      a.push_back(boundary->get_new_point_on_line(cell));
-    }
-  else
-    // otherwise call the more complicated functions and ask for inner points
-    // from the boundary description
-    {
-      std::vector<Point<spacedim> > line_points (degree-1);
-
-      const Boundary<dim,spacedim> *const boundary
-        = &(cell->get_triangulation().get_boundary(cell->material_id()));
-
-      boundary->get_intermediate_points_on_line (cell, line_points);
-      // Append all points
-      a.insert (a.end(), line_points.begin(), line_points.end());
-    }
-}
-
-
-
-template <>
-void
-MappingQ<1,3>::add_line_support_points (const Triangulation<1,3>::cell_iterator &cell,
-                                        std::vector<Point<3> > &a) const
-{
-  const unsigned int dim      = 1;
-  const unsigned int spacedim = 3;
-  // Ask for the mid point, if that's the only thing we need.
-  if (degree==2)
-    {
-      const Boundary<dim,spacedim> *const boundary
-        = &(cell->get_triangulation().get_boundary(cell->material_id()));
-      a.push_back(boundary->get_new_point_on_line(cell));
-    }
-  else
-    // otherwise call the more complicated functions and ask for inner points
-    // from the boundary description
-    {
-      std::vector<Point<spacedim> > line_points (degree-1);
-
-      const Boundary<dim,spacedim> *const boundary
-        = &(cell->get_triangulation().get_boundary(cell->material_id()));
-
-      boundary->get_intermediate_points_on_line (cell, line_points);
-      // Append all points
-      a.insert (a.end(), line_points.begin(), line_points.end());
-    }
-}
-
-
-
 template<int dim, int spacedim>
 void
 MappingQ<dim,spacedim>::add_line_support_points (const typename Triangulation<dim,spacedim>::cell_iterator &cell,
                                                  std::vector<Point<spacedim> > &a) const
 {
-  static const StraightBoundary<dim,spacedim> straight_boundary;
+  std::vector<Point<spacedim> > ps(2);
+  std::vector<double> ws(2, .5);
+  
   // if we only need the midpoint, then ask for it.
   if (degree==2)
     {
       for (unsigned int line_no=0; line_no<GeometryInfo<dim>::lines_per_cell; ++line_no)
         {
           const typename Triangulation<dim,spacedim>::line_iterator line = cell->line(line_no);
-          const Boundary<dim,spacedim> *const boundary
-            = (line->at_boundary()?
-               &line->get_triangulation().get_boundary(line->boundary_indicator()):
-               (dim != spacedim) ?
-               &line->get_triangulation().get_boundary(cell->material_id()):
-               &straight_boundary);
-
-          a.push_back(boundary->get_new_point_on_line(line));
+         ps[0] = line->vertex(0);
+         ps[1] = line->vertex(1);
+          a.push_back(line->get_manifold().get_new_point(ps,ws));
         };
     }
   else
@@ -852,15 +786,11 @@ MappingQ<dim,spacedim>::add_line_support_points (const typename Triangulation<di
       for (unsigned int line_no=0; line_no<GeometryInfo<dim>::lines_per_cell; ++line_no)
         {
           const typename Triangulation<dim,spacedim>::line_iterator line = cell->line(line_no);
+         ps[0] = line->vertex(0);
+         ps[1] = line->vertex(1);
 
-          const Boundary<dim,spacedim> *const boundary
-            = (line->at_boundary()?
-               &line->get_triangulation().get_boundary(line->boundary_indicator()) :
-               (dim != spacedim) ?
-               &line->get_triangulation().get_boundary(cell->material_id()) :
-               &straight_boundary);
-
-          boundary->get_intermediate_points_on_line (line, line_points);
+          line->get_manifold().get_intermediate_points (line_points, ps);
+         
           if (dim==3)
             {
               // in 3D, lines might be in wrong orientation. if so, reverse
@@ -892,8 +822,12 @@ add_quad_support_points(const Triangulation<3>::cell_iterator &cell,
                      lines_per_face    = GeometryInfo<3>::lines_per_face,
                      vertices_per_cell = GeometryInfo<3>::vertices_per_cell;
 
-  static const StraightBoundary<3> straight_boundary;
-  // used if face quad at boundary or entirely in the interior of the domain
+                                  // Used by the new Manifold
+                                  // interface. This vector collects
+                                  // the vertices used to compute the
+                                  // intermediate points.
+  std::vector<Point<3> > vertices(4);
+  
   std::vector<Point<3> > quad_points ((degree-1)*(degree-1));
   // used if only one line of face quad is at boundary
   std::vector<Point<3> > b(4*degree);
@@ -931,8 +865,10 @@ add_quad_support_points(const Triangulation<3>::cell_iterator &cell,
       // points on it
       if (face->at_boundary())
         {
-          face->get_triangulation().get_boundary(face->boundary_indicator())
-          .get_intermediate_points_on_quad (face, quad_points);
+         vertices.resize(4);
+         for(unsigned int i=0;i<4; ++i)
+           vertices[i] = face->vertex(i);
+          face->get_manifold().get_intermediate_points(quad_points, vertices);
           // in 3D, the orientation, flip and rotation of the face might not
           // match what we expect here, namely the standard orientation. thus
           // reorder points accordingly. since a Mapping uses the same shape
@@ -992,9 +928,11 @@ add_quad_support_points(const Triangulation<3>::cell_iterator &cell,
             }
           else
             {
-              // face is entirely in the interior. get intermediate points
-              // from a straight boundary object
-              straight_boundary.get_intermediate_points_on_quad (face, quad_points);
+              // face is entirely in the interior.
+             vertices.resize(4);
+             for(unsigned int i=0;i<4; ++i)
+               vertices[i] = face->vertex(i);
+              face->get_manifold().get_intermediate_points (vertices, quad_points);
               // in 3D, the orientation, flip and rotation of the face might
               // not match what we expect here, namely the standard
               // orientation. thus reorder points accordingly. since a Mapping
@@ -1019,9 +957,11 @@ add_quad_support_points(const Triangulation<2,3>::cell_iterator &cell,
                         std::vector<Point<3> >                &a) const
 {
   std::vector<Point<3> > quad_points ((degree-1)*(degree-1));
-
-  cell->get_triangulation().get_boundary(cell->material_id())
-  .get_intermediate_points_on_quad (cell, quad_points);
+  std::vector<Point<3> > vertices(4);
+  for(unsigned int i=0; i<4; ++i)
+    vertices[i] = cell->vertex(i);
+  
+  cell->get_manifold().get_intermediate_points (quad_points, vertices);
   for (unsigned int i=0; i<quad_points.size(); ++i)
     a.push_back(quad_points[i]);
 }

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.