]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Avoid triggering an exception.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 17 Jan 2014 19:23:42 +0000 (19:23 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 17 Jan 2014 19:23:42 +0000 (19:23 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_manifold_id@32237 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/fe/mapping_q.cc

index 726a2bbcc151419d49a4a6a7109ad3136c8c9fae..91e743e9570529fafc9d9c61881e4195a93c7732 100644 (file)
@@ -1,7 +1,7 @@
 // ---------------------------------------------------------------------
 // $Id$
 //
-// Copyright (C) 2001 - 2013 by the deal.II authors
+// Copyright (C) 2001 - 2014 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -763,7 +763,7 @@ MappingQ<dim,spacedim>::add_line_support_points (const typename Triangulation<di
 {
   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)
     {
@@ -785,12 +785,17 @@ MappingQ<dim,spacedim>::add_line_support_points (const typename Triangulation<di
       // get the boundary description and second compute the points on it
       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 typename Triangulation<dim,spacedim>::line_iterator
+           line = (dim == 1
+                   ?
+                   static_cast<typename Triangulation<dim,spacedim>::line_iterator>(cell)
+                   :
+                   cell->line(line_no));
          ps[0] = line->vertex(0);
          ps[1] = line->vertex(1);
 
           line->get_manifold().get_intermediate_points (ps, line_points);
-         
+
           if (dim==3)
             {
               // in 3D, lines might be in wrong orientation. if so, reverse
@@ -827,7 +832,7 @@ add_quad_support_points(const Triangulation<3>::cell_iterator &cell,
                                   // 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);
@@ -960,7 +965,7 @@ add_quad_support_points(const Triangulation<2,3>::cell_iterator &cell,
   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 (vertices, quad_points);
   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.