From f7c743b85e87a2faf1c4049e859831e1054042df Mon Sep 17 00:00:00 2001 From: bangerth Date: Fri, 17 Jan 2014 19:23:42 +0000 Subject: [PATCH] Avoid triggering an exception. git-svn-id: https://svn.dealii.org/branches/branch_manifold_id@32237 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/source/fe/mapping_q.cc | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/deal.II/source/fe/mapping_q.cc b/deal.II/source/fe/mapping_q.cc index 726a2bbcc1..91e743e957 100644 --- a/deal.II/source/fe/mapping_q.cc +++ b/deal.II/source/fe/mapping_q.cc @@ -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::add_line_support_points (const typename Triangulation > ps(2); std::vector ws(2, .5); - + // if we only need the midpoint, then ask for it. if (degree==2) { @@ -785,12 +785,17 @@ MappingQ::add_line_support_points (const typename Triangulation::lines_per_cell; ++line_no) { - const typename Triangulation::line_iterator line = cell->line(line_no); + const typename Triangulation::line_iterator + line = (dim == 1 + ? + static_cast::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 > vertices(4); - + std::vector > quad_points ((degree-1)*(degree-1)); // used if only one line of face quad is at boundary std::vector > b(4*degree); @@ -960,7 +965,7 @@ add_quad_support_points(const Triangulation<2,3>::cell_iterator &cell, std::vector > 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