From 9263944b537e2b5856012c460512004595c4cf8b Mon Sep 17 00:00:00 2001 From: David Wells Date: Sat, 11 May 2019 13:18:51 -0400 Subject: [PATCH] step-34: update manifold description. We clone manifolds now. --- examples/step-34/step-34.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/examples/step-34/step-34.cc b/examples/step-34/step-34.cc index 30a89f590b..4922584df7 100644 --- a/examples/step-34/step-34.cc +++ b/examples/step-34/step-34.cc @@ -484,21 +484,19 @@ namespace Step34 // in 3d. // // The other detail that is required for appropriate refinement of - // the boundary element mesh, is an accurate description of the - // manifold that the mesh is approximating. We already saw this + // the boundary element mesh is an accurate description of the + // manifold that the mesh approximates. We already saw this // several times for the boundary of standard finite element meshes // (for example in step-5 and step-6), and here the principle and // usage is the same, except that the SphericalManifold class takes // an additional template parameter that specifies the embedding - // space dimension. The function object still has to be static to - // live at least as long as the triangulation object to which it is - // attached. + // space dimension. template void BEMProblem::read_domain() { - static const Point center = Point(); - static const SphericalManifold manifold(center); + const Point center = Point(); + const SphericalManifold manifold(center); std::ifstream in; switch (dim) @@ -520,6 +518,9 @@ namespace Step34 gi.read_ucd(in); tria.set_all_manifold_ids(1); + // The call to Triangulation::set_manifold copies the manifold (via + // Manifold::clone()), so we do not need to worry about invalid pointers + // to manifold: tria.set_manifold(1, manifold); } -- 2.39.5