From 7932aefd37689ba9eefa0a7e133750e57887a168 Mon Sep 17 00:00:00 2001 From: Luca Heltai Date: Tue, 31 Mar 2015 20:55:22 +0200 Subject: [PATCH] Fixed step-29. --- examples/step-29/step-29.cc | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/examples/step-29/step-29.cc b/examples/step-29/step-29.cc index d5d4ec69f2..110770468d 100644 --- a/examples/step-29/step-29.cc +++ b/examples/step-29/step-29.cc @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include @@ -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::cell_iterator @@ -489,10 +491,11 @@ namespace Step29 for (; cell!=endc; ++cell) for (unsigned int face=0; face::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 boundary(focal_point, radius); - triangulation.set_boundary(1, boundary); + static const SphericalManifold 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 -- 2.39.5