]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fixed step-29.
authorLuca Heltai <luca.heltai@gmail.com>
Tue, 31 Mar 2015 18:55:22 +0000 (20:55 +0200)
committerLuca Heltai <luca.heltai@sissa.it>
Tue, 7 Apr 2015 14:02:15 +0000 (16:02 +0200)
examples/step-29/step-29.cc

index d5d4ec69f281b01f179ad358887a4d2768724515..110770468d222c07c8c721804c6a82d799179873 100644 (file)
@@ -36,7 +36,7 @@
 #include <deal.II/grid/grid_generator.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/manifold_lib.h>
 
 #include <deal.II/dofs/dof_handler.h>
 #include <deal.II/dofs/dof_accessor.h>
@@ -479,7 +479,9 @@ namespace Step29
     // find the faces where the transducer is to be located, which in fact is
     // just the single edge from 0.4 to 0.6 on the x-axis. This is where we
     // want the refinements to be made according to a circle shaped boundary,
-    // so we mark this edge with a different boundary indicator.
+    // so we mark this edge with a different manifold indicator. Since we will
+    // Dirichlet boundary conditions on the transducer, we also change its
+    // boundary indicator.
     GridGenerator::subdivided_hyper_cube (triangulation, 5, 0, 1);
 
     typename Triangulation<dim>::cell_iterator
@@ -489,10 +491,11 @@ namespace Step29
     for (; cell!=endc; ++cell)
       for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
         if ( cell->face(face)->at_boundary() &&
-             ((cell->face(face)->center() - transducer).norm_square() < 0.01) )
-
-          cell->face(face)->set_boundary_indicator (1);
-
+             ((cell->face(face)->center() - transducer).norm_square() < 0.01) ) {
+         
+         cell->face(face)->set_boundary_indicator (1);
+          cell->face(face)->set_manifold_id (1);
+       }
     // For the circle part of the transducer lens, a hyper-ball object is used
     // (which, of course, in 2D just represents a circle), with radius and
     // center as computed above. By marking this object as
@@ -500,8 +503,8 @@ namespace Step29
     // program and thereby longer than the triangulation object we will
     // associated with it. We then assign this boundary-object to the part of
     // the boundary with boundary indicator 1:
-    static const HyperBallBoundary<dim> boundary(focal_point, radius);
-    triangulation.set_boundary(1, boundary);
+    static const SphericalManifold<dim> boundary(focal_point);
+    triangulation.set_manifold(1, boundary);
 
     // Now global refinement is executed. Cells near the transducer location
     // will be automatically refined according to the circle shaped boundary

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.