]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fixed another two distorted cells bugs.
authorheltai <heltai@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 28 Jan 2014 15:27:53 +0000 (15:27 +0000)
committerheltai <heltai@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 28 Jan 2014 15:27:53 +0000 (15:27 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_manifold_id@32334 0785d39b-7218-0410-832d-ea1e28bc413d

tests/bits/distorted_cells_05.cc
tests/bits/distorted_cells_06.cc

index 7fe258c2454d6b6a2e45e6dcee2a1ec2f040ec55..b49450635d02765c2bbbce472bac0de936948513 100644 (file)
 
 
 template <int dim>
-class MyBoundary : public Boundary<dim>
+class MyBoundary : public Manifold<dim>
 {
   virtual Point<dim>
-  get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const
+  get_new_point (const std::vector<Point<dim> > &p,
+                const std::vector<double> &w) const
   {
-    deallog << "Finding point between "
-            << line->vertex(0) << " and "
-            << line->vertex(1) << std::endl;
-
-    // in 2d, find a point that
-    // lies on the opposite side
-    // of the quad. in 3d, choose
-    // the midpoint of the edge
-    if (dim == 2)
-      return Point<dim>(0,1.25);
-    else
-      return (line->vertex(0) + line->vertex(1)) / 2;
-  }
-
-  virtual Point<dim>
-  get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const
-  {
-    deallog << "Finding point between "
-            << quad->vertex(0) << " and "
-            << quad->vertex(1) << " and "
-            << quad->vertex(2) << " and "
-            << quad->vertex(3) << std::endl;
-
-    return Point<dim>(0,0,1.25);
-  }
-
-  virtual
-  Point<dim>
-  project_to_surface (const typename Triangulation<dim>::line_iterator &,
-                      const Point<dim> &p) const
-  {
-    deallog << "Projecting line point " << p << std::endl;
-
-    if (dim == 2)
-      return Point<dim>(p[0], 1.25-2.25*std::fabs(p[0]));
-    else
-      return p;
-  }
-
-  virtual
-  Point<dim>
-  project_to_surface (const typename Triangulation<dim>::quad_iterator &,
-                      const Point<dim> &p) const
-  {
-    deallog << "Projecting quad point " << p << std::endl;
-
-    Assert (dim == 3, ExcInternalError());
-
-    return Point<dim>(p[0], p[1],
-                      1.25-2.25*std::max(std::fabs(p[0]),
-                                         std::fabs(p[1])));
-  }
-
+    switch(p.size()) {
+    case 2:
+      {
+       deallog << "Finding point between "
+               << p[0] << " and "
+               << p[1] << std::endl;
+
+       // in 2d, find a point that
+       // lies on the opposite side
+       // of the quad. in 3d, choose
+       // the midpoint of the edge
+       if (dim == 2)
+         return Point<dim>(0,1.25);
+       else
+         return (p[0] + p[1]) / 2;
+      }
+      break;
+    default:
+      {
+       deallog << "Finding point between "
+               << p[0] << " and "
+               << p[1] << " and "
+               << p[2] << " and "
+               << p[3] << std::endl;
+
+       return Point<dim>(0,0,1.25);
+      }
+      break;
+    }
+  };
+    
+    
   virtual
   Point<dim>
-  project_to_surface (const typename Triangulation<dim>::hex_iterator &,
-                      const Point<dim> &) const
+  project_to_manifold (const std::vector<Point<dim> > &v, 
+                      const Point<dim> &p) const
   {
-    Assert (false, ExcInternalError());
-    return Point<dim>();
-  }
+    switch(v.size()) {
+    case 2:
+      {
+       deallog << "Projecting line point " << p << std::endl;
+
+       if (dim == 2)
+         return Point<dim>(p[0], 1.25-2.25*std::fabs(p[0]));
+       else
+         return p;
+      }
+      break;
+    case 4:
+      {
+       deallog << "Projecting quad point " << p << std::endl;
+
+       Assert (dim == 3, ExcInternalError());
+
+       return Point<dim>(p[0], p[1],
+                         1.25-2.25*std::max(std::fabs(p[0]),
+                                            std::fabs(p[1])));
+      }
+      break;
+    default:
+      {
+       Assert (false, ExcInternalError());
+       return Point<dim>();
+      }
+    }
+  };
 };
 
 
index 7e8bae09bf46c59e0fca222cab2145aa3fc19205..fdb4d5d37820dad29e765e6826e6ca9fb0f4182b 100644 (file)
 
 
 template <int dim>
-class MyBoundary : public Boundary<dim>
+class MyBoundary : public Manifold<dim>
 {
   virtual Point<dim>
-  get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const
+  get_new_point (const std::vector<Point<dim> > &p,
+                const std::vector<double> &w) const
   {
-    deallog << "Finding point between "
-            << line->vertex(0) << " and "
-            << line->vertex(1) << std::endl;
-
-    return Point<dim>(0,0.5,0.9);
-  }
-
-  virtual Point<dim>
-  get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &) const
-  {
-    Assert (false, ExcInternalError());
-    return Point<dim>(0,0,1.25);
-  }
+    switch(p.size()) {
+    case 2:
+      {
+       deallog << "Finding point between "
+               << p[0] << " and "
+               << p[1] << std::endl;
+       return Point<dim>(0,0.5,0.9);
+      }
+      break;
+    default:
+      {
+       Assert (false, ExcInternalError());
+       return Point<dim>(0,0,1.25);
+      }
+      break;
+    }
+  };
 };
 
 

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.