From 54d49cd689b85b1624b29cc45de9e73ace8b2582 Mon Sep 17 00:00:00 2001 From: heltai Date: Mon, 27 Jan 2014 11:17:35 +0000 Subject: [PATCH] Fixed return value for get_manifold when querying cells. git-svn-id: https://svn.dealii.org/branches/branch_manifold_id@32325 0785d39b-7218-0410-832d-ea1e28bc413d --- .../deal.II/grid/tria_accessor.templates.h | 4 +- deal.II/source/grid/tria.cc | 43 ++----------------- 2 files changed, 6 insertions(+), 41 deletions(-) diff --git a/deal.II/include/deal.II/grid/tria_accessor.templates.h b/deal.II/include/deal.II/grid/tria_accessor.templates.h index c56468ae07..7e9cffa7e3 100644 --- a/deal.II/include/deal.II/grid/tria_accessor.templates.h +++ b/deal.II/include/deal.II/grid/tria_accessor.templates.h @@ -1958,7 +1958,9 @@ TriaAccessor::get_manifold () const mi = static_cast (structdim < dim ? this->objects().boundary_or_material_id[this->present_index].boundary_id: - this->objects().boundary_or_material_id[this->present_index].material_id); + dim < spacedim ? + this->objects().boundary_or_material_id[this->present_index].material_id: + numbers::invalid_manifold_id); return this->tria->get_manifold(mi); } diff --git a/deal.II/source/grid/tria.cc b/deal.II/source/grid/tria.cc index 8666be3812..85da38d151 100644 --- a/deal.II/source/grid/tria.cc +++ b/deal.II/source/grid/tria.cc @@ -4922,9 +4922,9 @@ namespace internal triangulation.vertices_used[next_unused_vertex] = true; // Ask the manifold where to put the new point. To - // maintain backward compatibility, if the line does - // not have a manifold id, query the cell boundary - // instead + // maintain backward compatibility, in codimension + // one if the line does not have a manifold id, + // query the cell boundary instead get_default_points_and_weights(sp, wp, line); if(dim < spacedim && line->manifold_id() == numbers::invalid_manifold_id) triangulation.vertices[next_unused_vertex] = @@ -4932,33 +4932,6 @@ namespace internal else triangulation.vertices[next_unused_vertex] = line->get_manifold().get_new_point(sp, wp); - -// if (spacedim == dim) -// { - // for the case of a domain - // in an equal-dimensional - // space we only have to - // treat boundary lines - // differently; for interior - // lines we can compute the - // midpoint as the mean of - // the two vertices: -// if (line->at_boundary()) -// triangulation.vertices[next_unused_vertex] -// = line->get_boundary().get_new_point_on_line(line); -// triangulation.get_boundary(line->boundary_indicator()) -// .get_new_point_on_line (line); -// else -// triangulation.vertices[next_unused_vertex] -// = (line->vertex(0) + line->vertex(1)) / 2; -// } -// else - // however, if spacedim>dim, we - // always have to ask the - // boundary object for its -// // answer -// triangulation.vertices[next_unused_vertex] -// = triangulation.get_boundary(line->user_index()).get_new_point_on_line (line); // now that we created // the right point, make @@ -5497,14 +5470,6 @@ namespace internal triangulation.vertices[next_unused_vertex] = line->get_manifold().get_new_point(sp, wp); - -// if (line->at_boundary()) -// triangulation.vertices[next_unused_vertex] -// = triangulation.get_boundary(line->boundary_indicator()).get_new_point_on_line (line); -// else -// triangulation.vertices[next_unused_vertex] -// = (line->vertex(0) + line->vertex(1)) / 2; - // now that we created // the right point, make // up the two child lines @@ -9168,8 +9133,6 @@ namespace internal get_default_points_and_weights(sp,wp,face); const Point new_bound = face->get_manifold().get_new_point(sp,wp); -// triangulation.get_boundary(face->boundary_indicator()) -// .get_new_point_on_face (face); // to check it, // transform to the // unit cell with -- 2.39.5