]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
move vertices
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 2 Feb 2013 01:11:33 +0000 (01:11 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 2 Feb 2013 01:11:33 +0000 (01:11 +0000)
git-svn-id: https://svn.dealii.org/trunk@28215 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-49/step-49.cc

index dddb1bf62518b82e2ff8cfa5bf84ea3986d27241..df495b1dac88dab26f16a8b1d61ee46b98f0fd64 100644 (file)
@@ -98,7 +98,38 @@ void grid_2 ()
   grid_out.write_eps (triangulation, out);
 }
 
+// move vertices
+void grid_3 ()
+{
+  Triangulation<2> triangulation;
+  GridGenerator::hyper_cube_with_cylindrical_hole (triangulation, 0.25, 1.0);
+
+  Triangulation<2>::active_cell_iterator
+    cell = triangulation.begin_active(),
+    endc = triangulation.end();
+  for (; cell!=endc; ++cell)
+    {
+      for (unsigned int i=0;i<GeometryInfo<2>::vertices_per_cell;++i)
+       {         
+         Point<2> & v = cell->vertex(i);
+         if (std::abs(v(1)-1.0)<1e-5)
+           v(1)+=0.5;
+       }
+      
+    }
+  
+  const HyperBallBoundary<2> boundary_description(Point<2>(0,0),0.25);
+  triangulation.set_boundary (1, boundary_description);
+
+  triangulation.refine_global(2);
+  
 
+  triangulation.set_boundary (1);
+  
+  std::ofstream out ("grid-3.eps");
+  GridOut grid_out;
+  grid_out.write_eps (triangulation, out);
+}
 
 
 
@@ -110,4 +141,5 @@ int main ()
 {
   grid_1 ();
   grid_2 ();
+  grid_3 ();
 }

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.