From 9a5be61b57088787c80620d303d4960bd6a4ebfe Mon Sep 17 00:00:00 2001 From: hartmann Date: Wed, 22 Jun 2005 08:33:59 +0000 Subject: [PATCH] Use get_new_point_on_quad as optimization of get_intermediate_points_on_quad in case of one point. git-svn-id: https://svn.dealii.org/trunk@10920 0785d39b-7218-0410-832d-ea1e28bc413d --- .../deal.II/source/grid/tria_boundary_lib.cc | 88 +++++++++++-------- 1 file changed, 51 insertions(+), 37 deletions(-) diff --git a/deal.II/deal.II/source/grid/tria_boundary_lib.cc b/deal.II/deal.II/source/grid/tria_boundary_lib.cc index 0117fc8934..119237eb44 100644 --- a/deal.II/deal.II/source/grid/tria_boundary_lib.cc +++ b/deal.II/deal.II/source/grid/tria_boundary_lib.cc @@ -145,22 +145,27 @@ CylinderBoundary<3>::get_intermediate_points_on_quad ( const Triangulation<3>::quad_iterator &quad, std::vector > &points) const { - unsigned int m=static_cast (std::sqrt(static_cast(points.size()))); - Assert(points.size()==m*m, ExcInternalError()); - - std::vector > lp3(m); - std::vector > lp1(m); - - get_intermediate_points_on_line(quad->line(3), lp3); - get_intermediate_points_on_line(quad->line(1), lp1); - - std::vector > lps(m); - for (unsigned int i=0; i (std::sqrt(static_cast(points.size()))); + Assert(points.size()==m*m, ExcInternalError()); + + std::vector > lp3(m); + std::vector > lp1(m); + + get_intermediate_points_on_line(quad->line(3), lp3); + get_intermediate_points_on_line(quad->line(1), lp1); - for (unsigned int j=0; j > lps(m); + for (unsigned int i=0; i::get_intermediate_points_on_quad ( const Triangulation<3>::quad_iterator &quad, std::vector > &points) const { - unsigned int m=static_cast (std::sqrt(static_cast(points.size()))); - Assert(points.size()==m*m, ExcInternalError()); - - std::vector > lp3(m); - std::vector > lp1(m); - - get_intermediate_points_on_line(quad->line(3), lp3); - get_intermediate_points_on_line(quad->line(1), lp1); - - std::vector > lps(m); - for (unsigned int i=0; i (std::sqrt(static_cast(points.size()))); + Assert(points.size()==m*m, ExcInternalError()); + + std::vector > lp3(m); + std::vector > lp1(m); - for (unsigned int j=0; jline(3), lp3); + get_intermediate_points_on_line(quad->line(1), lp1); + + std::vector > lps(m); + for (unsigned int i=0; i:: get_intermediate_points_on_quad (const typename Triangulation::quad_iterator &quad, std::vector > &points) const { - // check whether center of object is - // at x==0, since then it belongs - // to the plane part of the - // boundary - const Point quad_center = quad->center(); - if (quad_center(0) == this->center(0)) - StraightBoundary::get_intermediate_points_on_quad (quad, points); + if (points.size()==1) + points[0]=get_new_point_on_quad(quad); else - HyperBallBoundary::get_intermediate_points_on_quad (quad, points); + { + // check whether center of + // object is at x==0, since + // then it belongs to the plane + // part of the boundary + const Point quad_center = quad->center(); + if (quad_center(0) == this->center(0)) + StraightBoundary::get_intermediate_points_on_quad (quad, points); + else + HyperBallBoundary::get_intermediate_points_on_quad (quad, points); + } } - #if deal_II_dimension == 1 template <> -- 2.39.5