]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use Manifold, not boundary, functionality.
authorLuca Heltai <luca.heltai@sissa.it>
Wed, 23 Mar 2016 15:26:07 +0000 (16:26 +0100)
committerDavid Wells <wellsd2@rpi.edu>
Sun, 8 Oct 2017 23:21:48 +0000 (19:21 -0400)
source/fe/mapping_c1.cc
source/grid/grid_generator.cc
source/grid/tria.cc

index 216d11aeb2030b5d091418b7a7b4d55dbd6a826c..f20482269e71977e1e72f8e4624a012b97afb5d2 100644 (file)
@@ -66,7 +66,9 @@ MappingC1<2>::MappingC1Generic::add_line_support_points (const Triangulation<2>:
                                                          std::vector<Point<2> > &a) const
 {
   const unsigned int dim = 2;
-  std::vector<Point<dim> > line_points (2);
+  const std::array<double, 2> interior_gl_points
+  {{0.5 - 0.5*std::sqrt(1.0/5.0), 0.5 + 0.5*std::sqrt(1.0/5.0)}};
+
 
   // loop over each of the lines, and if it is at the boundary, then first get
   // the boundary description and second compute the points on it. if not at
@@ -79,11 +81,10 @@ MappingC1<2>::MappingC1Generic::add_line_support_points (const Triangulation<2>:
         {
           // first get the normal vectors at the two vertices of this line
           // from the boundary description
-          const Boundary<dim> &boundary
-            = line->get_triangulation().get_boundary(line->boundary_id());
+          const Manifold<dim> &manifold = line->get_manifold();
 
-          Boundary<dim>::FaceVertexNormals face_vertex_normals;
-          boundary.get_normals_at_vertices (line, face_vertex_normals);
+          Manifold<dim>::FaceVertexNormals face_vertex_normals;
+          manifold.get_normals_at_vertices (line, face_vertex_normals);
 
           // then transform them into interpolation points for a cubic
           // polynomial
@@ -124,9 +125,8 @@ MappingC1<2>::MappingC1Generic::add_line_support_points (const Triangulation<2>:
                              -face_vertex_normals[1][0] * std::sin(alpha)))
                            -2*c;
 
-          QGaussLobatto<1> quad_points(4);
-          const double t1 = quad_points.point(1)[0];
-          const double t2 = quad_points.point(2)[0];
+          const double t1 = interior_gl_points[0];
+          const double t2 = interior_gl_points[1];
           const double s_t1 = (((-b-c)*t1+b)*t1+c)*t1;
           const double s_t2 = (((-b-c)*t2+b)*t2+c)*t2;
 
@@ -149,11 +149,15 @@ MappingC1<2>::MappingC1Generic::add_line_support_points (const Triangulation<2>:
             };
         }
       else
-        // not at boundary
+        // not at boundary, so just use scaled Gauss-Lobatto points (i.e., use
+        // plain straight lines).
         {
-          static const StraightBoundary<dim> straight_boundary;
-          straight_boundary.get_intermediate_points_on_line (line, line_points);
-          a.insert (a.end(), line_points.begin(), line_points.end());
+          // Note that the zeroth Gauss-Lobatto point is a boundary point, so
+          // we push back mapped versions of the first and second.
+          a.push_back((1.0 - interior_gl_points[0])*line->vertex(0) +
+                      (interior_gl_points[0]*line->vertex(1)));
+          a.push_back((1.0 - interior_gl_points[1])*line->vertex(0) +
+                      (interior_gl_points[1]*line->vertex(1)));
         }
     }
 }
index f839683775f158087e03e04a70ba8817dde6fe4b..9307cf69f51001b326af525a57c9b7de5eb0b936 100644 (file)
 #include <deal.II/grid/grid_generator.h>
 #include <deal.II/grid/grid_reordering.h>
 #include <deal.II/grid/grid_tools.h>
+#include <deal.II/grid/manifold_lib.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
-#include <deal.II/grid/tria_boundary_lib.h>
 #include <deal.II/grid/intergrid_map.h>
 
 #include <deal.II/distributed/tria.h>
@@ -3484,11 +3484,11 @@ namespace GridGenerator
         // once and then re-arrange all
         // interior nodes so that the mesh is
         // the least distorted
-        HyperShellBoundary<3> boundary (p);
+        SphericalManifold<3> boundary (p);
         Triangulation<3> tmp;
         hyper_shell (tmp, p, inner_radius, outer_radius, 12);
-        tmp.set_boundary(0, boundary);
-        tmp.set_boundary(1, boundary);
+        tmp.set_manifold(0, boundary);
+        tmp.set_manifold(1, boundary);
         tmp.refine_global (1);
 
         // let's determine the distance at
index 5bdb643229239dfe2030b4a00dd126367a56d0e5..d7fdfb36871d89b1276a0b148f909fcd88f1bb0e 100644 (file)
@@ -8932,6 +8932,16 @@ namespace internal
         return true;
       }
     };
+
+
+
+    template <int dim, int spacedim>
+    const Manifold<dim, spacedim> &
+    get_default_flat_manifold()
+    {
+      static const FlatManifold<dim, spacedim> flat_manifold;
+      return flat_manifold;
+    }
   }
 }
 
@@ -9219,12 +9229,10 @@ Triangulation<dim, spacedim>::get_manifold (const types::manifold_id m_number) c
       //if we have found an entry, return it
       return *(it->second);
     }
-  else
-    {
-      //if we have not found an entry connected with number, we return
-      //straight_boundary
-      return straight_boundary;
-    }
+
+  // if we have not found an entry connected with number, we return
+  // the default (flat) manifold
+  return internal::Triangulation::get_default_flat_manifold<dim,spacedim>();
 }
 
 

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.