From: Wolfgang Bangerth Date: Wed, 30 May 2012 14:26:33 +0000 (+0000) Subject: Implement one function though it isn't quite enoughg to get the Triangulation<1,3... X-Git-Tag: v8.0.0~2556 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8708c3053a845925e3b3fde5015cddf6edd77c02;p=dealii.git Implement one function though it isn't quite enoughg to get the Triangulation<1,3> case going. git-svn-id: https://svn.dealii.org/trunk@25574 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/fe/mapping_q.h b/deal.II/include/deal.II/fe/mapping_q.h index f1bd43d103..75d2122f54 100644 --- a/deal.II/include/deal.II/fe/mapping_q.h +++ b/deal.II/include/deal.II/fe/mapping_q.h @@ -553,21 +553,31 @@ class MappingQ : public MappingQ1 template<> MappingQ<1>::MappingQ (const unsigned int, const bool); template<> MappingQ<1>::~MappingQ (); -template<> void MappingQ<1>::compute_shapes_virtual ( - const std::vector > &unit_points, - MappingQ1<1>::InternalData &data) const; -template <> void MappingQ<1>::set_laplace_on_quad_vector( - Table<2,double> &) const; -template <> void MappingQ<3>::set_laplace_on_hex_vector( - Table<2,double> &lohvs) const; -template <> 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<3>::add_quad_support_points( - const Triangulation<3>::cell_iterator &cell, - std::vector > &a) const; + +template<> +void MappingQ<1>::compute_shapes_virtual (const std::vector > &unit_points, + MappingQ1<1>::InternalData &data) const; +template <> +void MappingQ<1>::set_laplace_on_quad_vector(Table<2,double> &) const; + +template <> +void MappingQ<3>::set_laplace_on_hex_vector(Table<2,double> &lohvs) const; + +template <> +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; #endif // DOXYGEN diff --git a/deal.II/source/fe/mapping_q.cc b/deal.II/source/fe/mapping_q.cc index 5657c97f90..a6e9222bf2 100644 --- a/deal.II/source/fe/mapping_q.cc +++ b/deal.II/source/fe/mapping_q.cc @@ -908,7 +908,6 @@ MappingQ::compute_support_points_laplace(const typename Triangulat switch (dim) { case 1: - Assert(spacedim == 2, ExcInternalError()); add_line_support_points(cell, a); break; case 2: @@ -937,7 +936,7 @@ MappingQ::compute_support_points_laplace(const typename Triangulat default: Assert(false, ExcNotImplemented()); break; - }; + } } @@ -960,7 +959,42 @@ void MappingQ<1,2>::add_line_support_points (const Triangulation<1,2>::cell_iterator &cell, std::vector > &a) const { - const unsigned int dim=1, spacedim=2; + 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)