From 2cd55a7384bf1b06487572cfff9e64dfe380d8b9 Mon Sep 17 00:00:00 2001 From: heltai Date: Sun, 25 Aug 2013 17:29:50 +0000 Subject: [PATCH] Removed reference to Boundary from MappingQ 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 | 7 -- deal.II/source/fe/mapping_q.cc | 122 +++++++------------------ 2 files changed, 31 insertions(+), 98 deletions(-) diff --git a/deal.II/include/deal.II/fe/mapping_q.h b/deal.II/include/deal.II/fe/mapping_q.h index 28e4aefcbf..e43960e015 100644 --- a/deal.II/include/deal.II/fe/mapping_q.h +++ b/deal.II/include/deal.II/fe/mapping_q.h @@ -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 > &) const; -template <> -void MappingQ<1,2>::add_line_support_points (const Triangulation<1,2>::cell_iterator &, - std::vector > &) const; -template <> -void MappingQ<1,3>::add_line_support_points (const Triangulation<1,3>::cell_iterator &, - std::vector > &) const; - template<> void MappingQ<3>::add_quad_support_points(const Triangulation<3>::cell_iterator &cell, std::vector > &a) const; diff --git a/deal.II/source/fe/mapping_q.cc b/deal.II/source/fe/mapping_q.cc index 4ee1d4374c..26a26c7b25 100644 --- a/deal.II/source/fe/mapping_q.cc +++ b/deal.II/source/fe/mapping_q.cc @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include @@ -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 > &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 *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 > line_points (degree-1); - - const Boundary *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 > &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 *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 > line_points (degree-1); - - const Boundary *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::add_line_support_points (const typename Triangulation::cell_iterator &cell, std::vector > &a) const { - static const StraightBoundary straight_boundary; + std::vector > ps(2); + std::vector ws(2, .5); + // if we only need the midpoint, then ask for it. if (degree==2) { for (unsigned int line_no=0; line_no::lines_per_cell; ++line_no) { const typename Triangulation::line_iterator line = cell->line(line_no); - const Boundary *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::add_line_support_points (const typename Triangulation::lines_per_cell; ++line_no) { const typename Triangulation::line_iterator line = cell->line(line_no); + ps[0] = line->vertex(0); + ps[1] = line->vertex(1); - const Boundary *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 > 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); @@ -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 > &a) const { std::vector > quad_points ((degree-1)*(degree-1)); - - cell->get_triangulation().get_boundary(cell->material_id()) - .get_intermediate_points_on_quad (cell, quad_points); + std::vector > 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