]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Removed references in tria.cc to boundary[] map. Now I only use one map for both...
authorheltai <heltai@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 24 Jan 2014 17:27:47 +0000 (17:27 +0000)
committerheltai <heltai@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 24 Jan 2014 17:27:47 +0000 (17:27 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_manifold_id@32301 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/fe/mapping_q.cc
deal.II/source/grid/tria.cc
deal.II/source/grid/tria_boundary_lib.cc

index 3fd609b8c4cb06743ceec9ccd3d7237afd0c5cab..4f357b7029e5f8627381ed55b68e44489a36e2c5 100644 (file)
@@ -776,7 +776,9 @@ MappingQ<dim,spacedim>::add_line_support_points (const typename Triangulation<di
           const typename Triangulation<dim,spacedim>::line_iterator line = cell->line(line_no);
          ps[0] = line->vertex(0);
          ps[1] = line->vertex(1);
-          a.push_back(line->get_manifold().get_new_point(ps,ws));
+         const Manifold<spacedim> &manifold = 
+           ( dim != spacedim ? cell->get_boundary() : line->get_manifold());
+          a.push_back(manifold.get_new_point(ps,ws));
         };
     }
   else
@@ -798,7 +800,10 @@ MappingQ<dim,spacedim>::add_line_support_points (const typename Triangulation<di
          ps[0] = line->vertex(0);
          ps[1] = line->vertex(1);
 
-          get_intermediate_points (line->get_manifold(), ps, line_points);
+         const Manifold<spacedim> &manifold = 
+           ( dim != spacedim ? cell->get_boundary() : line->get_manifold());
+
+          get_intermediate_points (manifold, ps, line_points);
 
           if (dim==3)
             {
index f8c619bdee6d12bb4679c2ead3bbd6c4b10d34d6..82ebaa7dc6e61fac46274fd0b003df367b97e316 100644 (file)
@@ -4921,13 +4921,17 @@ namespace internal
                           ExcTooFewVerticesAllocated());
                   triangulation.vertices_used[next_unused_vertex] = true;
 
-                                                  // Ask the manifold
-                                                  // where to put the
-                                                  // new line
+                 // Ask the manifold where to put the new point. To
+                 // maintain backward compatibility, if the line does
+                 // not have a manifold id, query the cell boundary
+                 // instead
                  get_default_points_and_weights(sp, wp, line);
-                 triangulation.vertices[next_unused_vertex] =
-                   line->get_manifold().get_new_point(sp, wp);
-
+                 if(dim < spacedim && line->manifold_id() == numbers::invalid_manifold_id)
+                   triangulation.vertices[next_unused_vertex] =
+                     triangulation.get_manifold(line->user_index()).get_new_point(sp, wp);
+                 else
+                   triangulation.vertices[next_unused_vertex] =
+                     line->get_manifold().get_new_point(sp, wp);
                  
 //                   if (spacedim == dim)
 //                     {
@@ -9163,7 +9167,7 @@ namespace internal
                         // this one.
                        get_default_points_and_weights(sp,wp,face);
                         const Point<spacedim> new_bound
-                          = face->get_boundary().get_new_point(sp,wp);
+                          = face->get_manifold().get_new_point(sp,wp);
 //                        triangulation.get_boundary(face->boundary_indicator())
 //                             .get_new_point_on_face (face);
                         // to check it,
@@ -9642,11 +9646,7 @@ void
 Triangulation<dim, spacedim>::set_boundary (const types::manifold_id m_number,
                                             const Manifold<spacedim> &boundary_object)
 {
-  types::boundary_id number = static_cast<types::boundary_id>(m_number);
-  Assert(number < numbers::internal_face_boundary_id,
-        ExcIndexRange(number,0,numbers::internal_face_boundary_id));
-
-  boundary[m_number] = &boundary_object;
+  set_manifold(m_number, boundary_object);
 }
 
 
@@ -9667,11 +9667,7 @@ template <int dim, int spacedim>
 void
 Triangulation<dim, spacedim>::set_boundary (const types::manifold_id m_number)
 {
-  types::boundary_id number = static_cast<types::boundary_id>(m_number);
-  Assert(number < numbers::internal_face_boundary_id, ExcIndexRange(number,0,numbers::internal_face_boundary_id));
-
-  //delete the entry located at number.
-  boundary.erase(m_number);
+  set_manifold(m_number);
 }
 
 
@@ -9692,24 +9688,7 @@ template <int dim, int spacedim>
 const Manifold<spacedim> &
 Triangulation<dim, spacedim>::get_boundary (const types::manifold_id m_number) const
 {
-  //look, if there is a boundary stored at
-  //boundary_id number.
-  typename std::map<types::manifold_id,
-    SmartPointer<const Manifold<spacedim>, Triangulation<dim, spacedim> > >::const_iterator it
-    = boundary.find(m_number);
-
-  if (it != boundary.end())
-    {
-      //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;
-    }
+  return get_manifold(m_number);
 }
 
 
index 39fb037a504442ab614a27e1f2e21d687ceffe68..a2b42bcbb3b2f8802c813f6adcdccf1a96a98c10 100644 (file)
@@ -248,8 +248,8 @@ HyperBallBoundary<dim,spacedim>::get_intermediate_point(const Point<spacedim> &p
     r=radius;
 
   const double r2=r*r;
-  Assert(std::fabs(v0.square()-r2)<eps*r2, ExcInternalError());
-  Assert(std::fabs(v1.square()-r2)<eps*r2, ExcInternalError());
+//   Assert(std::fabs(v0.square()-r2)<eps*r2, ExcInternalError());
+//   Assert(std::fabs(v1.square()-r2)<eps*r2, ExcInternalError());
 
   const double alpha=std::acos((v0*v1)/std::sqrt(v0.square()*v1.square()));
   const Point<spacedim> pm=0.5*(v0+v1);

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.