]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Implement one function though it isn't quite enoughg to get the Triangulation<1,3...
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 30 May 2012 14:26:33 +0000 (14:26 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 30 May 2012 14:26:33 +0000 (14:26 +0000)
git-svn-id: https://svn.dealii.org/trunk@25574 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/fe/mapping_q.h
deal.II/source/fe/mapping_q.cc

index f1bd43d103f82e7e6f174575938e3886e072acef..75d2122f54806a001780393142133324f0d5f1d7 100644 (file)
@@ -553,21 +553,31 @@ class MappingQ : public MappingQ1<dim,spacedim>
 template<> MappingQ<1>::MappingQ (const unsigned int,
                                   const bool);
 template<> MappingQ<1>::~MappingQ ();
-template<> void MappingQ<1>::compute_shapes_virtual (
-  const std::vector<Point<1> > &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<Point<1> > &) const;
-template<> void MappingQ<3>::add_quad_support_points(
-  const Triangulation<3>::cell_iterator &cell,
-  std::vector<Point<3> >                &a) const;
+
+template<>
+void MappingQ<1>::compute_shapes_virtual (const std::vector<Point<1> > &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<Point<1> > &) const;
+template <>
+void MappingQ<1,2>::add_line_support_points (const Triangulation<1,2>::cell_iterator &,
+                                            std::vector<Point<2> > &) const;
+template <>
+void MappingQ<1,3>::add_line_support_points (const Triangulation<1,3>::cell_iterator &,
+                                            std::vector<Point<3> > &) const;
+
+template<>
+void MappingQ<3>::add_quad_support_points(const Triangulation<3>::cell_iterator &cell,
+                                         std::vector<Point<3> >                &a) const;
 
 #endif // DOXYGEN
 
index 5657c97f90c77e92a981e5b5745605b33be553a0..a6e9222bf2ef5749f38635968d72d644a87c5e29 100644 (file)
@@ -908,7 +908,6 @@ MappingQ<dim,spacedim>::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<dim,spacedim>::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<Point<2> > &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<dim,spacedim> * 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<Point<spacedim> > line_points (degree-1);
+
+      const Boundary<dim,spacedim> * 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<Point<3> > &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)

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.