From: heltai Date: Thu, 22 Aug 2013 14:24:48 +0000 (+0000) Subject: Fixed all examples, so that they use manifold instead of boundary. Only the code... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09e3b22f13c89b32ae5a6ad51605677e9af8c3b9;p=dealii-svn.git Fixed all examples, so that they use manifold instead of boundary. Only the code is fixed, not the documentation.... git-svn-id: https://svn.dealii.org/branches/branch_manifold_id@30417 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-1/step-1.cc b/deal.II/examples/step-1/step-1.cc index 724dd45e95..96c701da2a 100644 --- a/deal.II/examples/step-1/step-1.cc +++ b/deal.II/examples/step-1/step-1.cc @@ -1,20 +1,18 @@ -/* --------------------------------------------------------------------- - * $Id$ - * - * Copyright (C) 1999 - 2013 by the deal.II authors - * - * This file is part of the deal.II library. - * - * The deal.II library is free software; you can use it, redistribute - * it, and/or modify it under the terms of the GNU Lesser General - * Public License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * The full text of the license can be found in the file LICENSE at - * the top level of the deal.II distribution. - * - * --------------------------------------------------------------------- - - */ +// --------------------------------------------------------------------- +// $Id$ +// +// Copyright (C) 1999 - 2013 by the deal.II authors +// +// This file is part of the deal.II library. +// +// The deal.II library is free software; you can use it, redistribute +// it, and/or modify it under the terms of the GNU Lesser General +// Public License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// The full text of the license can be found in the file LICENSE at +// the top level of the deal.II distribution. +// +// --------------------------------------------------------------------- // @sect3{Include files} @@ -38,8 +36,6 @@ // And this for the declarations of the `sqrt' and `fabs' functions: #include -#include - // The final step in importing deal.II is this: All deal.II functions and // classes are in a namespace dealii, to make sure they don't // clash with symbols from other libraries you may want to use in conjunction @@ -75,9 +71,9 @@ void first_grid () // Now we want to write a graphical representation of the mesh to an output // file. The GridOut class of deal.II can do that in a number of different // output formats; here, we choose encapsulated postscript (eps) format: - std::ofstream out ("grid-1.msh"); + std::ofstream out ("grid-1.eps"); GridOut grid_out; - grid_out.write_msh (triangulation, out); + grid_out.write_eps (triangulation, out); } @@ -95,18 +91,13 @@ void second_grid () // We then fill it with a ring domain. The center of the ring shall be the // point (1,0), and inner and outer radius shall be 0.5 and 1. The number of // circumferential cells could be adjusted automatically by this function, - // but we choose to set it explicitly to 10 as the last argument: + // but we choose to set it explicitely to 10 as the last argument: const Point<2> center (1,0); const double inner_radius = 0.5, outer_radius = 1.0; GridGenerator::hyper_shell (triangulation, center, inner_radius, outer_radius, 10); - - Triangulation<2>::active_cell_iterator - cell = triangulation.begin_active(), - endc = triangulation.end(); - // By default, the triangulation assumes that all boundaries are straight // and given by the cells of the coarse grid (which we just created). It // uses this information when cells at the boundary are refined and new @@ -136,9 +127,6 @@ void second_grid () // In order to demonstrate how to write a loop over all cells, we will // refine the grid in five steps towards the inner circle of the domain: for (unsigned int step=0; step<5; ++step) - // triangulation.refine_global(1); - - // if(false) { // Next, we need an iterator which points to a cell and which we will // move over all active cells one by one (active cells are those that @@ -197,9 +185,9 @@ void second_grid () // Finally, after these five iterations of refinement, we want to again // write the resulting mesh to a file, again in eps format. This works just // as above: - std::ofstream out ("grid-2.msh"); + std::ofstream out ("grid-2.eps"); GridOut grid_out; - grid_out.write_msh (triangulation, out); + grid_out.write_eps (triangulation, out); // At this point, all objects created in this function will be destroyed in @@ -218,26 +206,6 @@ void second_grid () // fine. } -void test_case() -{ - const unsigned int dim = 2; - - std::vector > ps(2); - ps[0] = Point(1.0,1.0); - ps[1] = Point(-1.0,1.0); - - std::vector ws(2, .5); - - PolarManifold manifold; - - Point p = manifold.get_new_point(ps, ws); - std::cout << "Point 0 : " << ps[0] - << ", Point 1: " << ps[1] - << ", computed point: " << p << std::endl; - - -} - // @sect3{The main function} @@ -246,7 +214,6 @@ void test_case() // two subfunctions, which produce the two grids. int main () { - // first_grid (); + first_grid (); second_grid (); - test_case(); } diff --git a/deal.II/examples/step-10/step-10.cc b/deal.II/examples/step-10/step-10.cc index f62c273b82..ba42848228 100644 --- a/deal.II/examples/step-10/step-10.cc +++ b/deal.II/examples/step-10/step-10.cc @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include @@ -82,8 +82,8 @@ namespace Step10 // radius equals one. Triangulation triangulation; GridGenerator::hyper_ball (triangulation); - static const HyperBallBoundary boundary; - triangulation.set_boundary (0, boundary); + static const PolarManifold boundary; + triangulation.set_manifold (0, boundary); // Next generate output for this grid and for a once refined grid. Note // that we have hidden the mesh refinement in the loop header, which might @@ -216,8 +216,8 @@ namespace Step10 Triangulation triangulation; GridGenerator::hyper_ball (triangulation); - static const HyperBallBoundary boundary; - triangulation.set_boundary (0, boundary); + static const PolarManifold boundary; + triangulation.set_manifold (0, boundary); const MappingQ mapping (degree); @@ -352,8 +352,8 @@ namespace Step10 Triangulation triangulation; GridGenerator::hyper_ball (triangulation); - static const HyperBallBoundary boundary; - triangulation.set_boundary (0, boundary); + static const PolarManifold boundary; + triangulation.set_manifold (0, boundary); const MappingQ mapping (degree); const FE_Q fe (1); diff --git a/deal.II/examples/step-11/step-11.cc b/deal.II/examples/step-11/step-11.cc index 49cfda2b25..28775f4d2d 100644 --- a/deal.II/examples/step-11/step-11.cc +++ b/deal.II/examples/step-11/step-11.cc @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include @@ -414,8 +414,8 @@ namespace Step11 void LaplaceProblem::run () { GridGenerator::hyper_ball (triangulation); - static const HyperBallBoundary boundary; - triangulation.set_boundary (0, boundary); + static const PolarManifold boundary; + triangulation.set_manifold (0, boundary); for (unsigned int cycle=0; cycle<6; ++cycle, triangulation.refine_global(1)) { diff --git a/deal.II/examples/step-15/step-15.cc b/deal.II/examples/step-15/step-15.cc index dca38227eb..024f831d84 100644 --- a/deal.II/examples/step-15/step-15.cc +++ b/deal.II/examples/step-15/step-15.cc @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include @@ -628,8 +628,8 @@ namespace Step15 // the origin, created in the same way as shown in step-6. The mesh is // globally refined twice followed later on by several adaptive cycles: GridGenerator::hyper_ball (triangulation); - static const HyperBallBoundary boundary; - triangulation.set_boundary (0, boundary); + static const PolarManifold boundary; + triangulation.set_manifold (0, boundary); triangulation.refine_global(2); // The Newton iteration starts next. During the first step we do not have diff --git a/deal.II/examples/step-16/step-16.cc b/deal.II/examples/step-16/step-16.cc index f5e657493e..86a8e4e6ba 100644 --- a/deal.II/examples/step-16/step-16.cc +++ b/deal.II/examples/step-16/step-16.cc @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include #include @@ -768,8 +768,8 @@ namespace Step16 { GridGenerator::hyper_ball (triangulation); - static const HyperBallBoundary boundary; - triangulation.set_boundary (0, boundary); + static const PolarManifold boundary; + triangulation.set_manifold (0, boundary); triangulation.refine_global (1); } diff --git a/deal.II/examples/step-17/step-17.cc b/deal.II/examples/step-17/step-17.cc index 0b9499c848..e6b5c907d9 100644 --- a/deal.II/examples/step-17/step-17.cc +++ b/deal.II/examples/step-17/step-17.cc @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/deal.II/examples/step-18/step-18.cc b/deal.II/examples/step-18/step-18.cc index 9de024169a..bcd2add729 100644 --- a/deal.II/examples/step-18/step-18.cc +++ b/deal.II/examples/step-18/step-18.cc @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include #include @@ -845,12 +845,12 @@ namespace Step18 // z-axis. Note that the boundary objects need to live as long as the // triangulation does; we can achieve this by making the objects static, // which means that they live as long as the program runs: - static const CylinderBoundary inner_cylinder (inner_radius, 2); - static const CylinderBoundary outer_cylinder (outer_radius, 2); + static const CylinderManifold inner_cylinder (inner_radius, 2); + static const CylinderManifold outer_cylinder (outer_radius, 2); // We then attach these two objects to the triangulation, and make them // correspond to boundary indicators 2 and 3: - triangulation.set_boundary (2, inner_cylinder); - triangulation.set_boundary (3, outer_cylinder); + triangulation.set_manifold (2, inner_cylinder); + triangulation.set_manifold (3, outer_cylinder); // There's one more thing we have to take care of (we should have done so // above already, but for didactic reasons it was more appropriate to diff --git a/deal.II/examples/step-2/step-2.cc b/deal.II/examples/step-2/step-2.cc index cb6cd25b2e..173841e1f7 100644 --- a/deal.II/examples/step-2/step-2.cc +++ b/deal.II/examples/step-2/step-2.cc @@ -25,7 +25,7 @@ #include #include #include -#include +#include // However, the next file is new. We need this include file for the // association of degrees of freedom ("DoF"s) to vertices, lines, and cells: @@ -88,8 +88,8 @@ void make_grid (Triangulation<2> &triangulation) center, inner_radius, outer_radius, 10); - static const HyperShellBoundary<2> boundary_description(center); - triangulation.set_boundary (0, boundary_description); + static const PolarManifold<2> boundary_description(center); + triangulation.set_manifold (0, boundary_description); for (unsigned int step=0; step<5; ++step) { diff --git a/deal.II/examples/step-22/step-22.cc b/deal.II/examples/step-22/step-22.cc index 96ea2b0427..7703cc0b28 100644 --- a/deal.II/examples/step-22/step-22.cc +++ b/deal.II/examples/step-22/step-22.cc @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include diff --git a/deal.II/examples/step-24/step-24.cc b/deal.II/examples/step-24/step-24.cc index e44ea21f12..f711c4e678 100644 --- a/deal.II/examples/step-24/step-24.cc +++ b/deal.II/examples/step-24/step-24.cc @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include @@ -271,8 +271,8 @@ namespace Step24 { const Point center; GridGenerator::hyper_ball (triangulation, center, 1.); - static const HyperBallBoundary boundary_description (center, 1.); - triangulation.set_boundary (0,boundary_description); + static const PolarManifold boundary_description (center); + triangulation.set_manifold (0,boundary_description); triangulation.refine_global (7); time_step = GridTools::minimal_cell_diameter(triangulation) / diff --git a/deal.II/examples/step-28/step-28.cc b/deal.II/examples/step-28/step-28.cc index f4365766fd..475af6d47f 100644 --- a/deal.II/examples/step-28/step-28.cc +++ b/deal.II/examples/step-28/step-28.cc @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/deal.II/examples/step-29/step-29.cc b/deal.II/examples/step-29/step-29.cc index 9c3360572b..5278c7a1c2 100644 --- a/deal.II/examples/step-29/step-29.cc +++ b/deal.II/examples/step-29/step-29.cc @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include @@ -500,8 +500,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 PolarManifold 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 diff --git a/deal.II/examples/step-32/step-32.cc b/deal.II/examples/step-32/step-32.cc index 0c7ccc8a8f..e991399a3a 100644 --- a/deal.II/examples/step-32/step-32.cc +++ b/deal.II/examples/step-32/step-32.cc @@ -51,7 +51,7 @@ #include #include #include -#include +#include #include #include @@ -3522,9 +3522,9 @@ namespace Step32 EquationData::R1, (dim==3) ? 96 : 12, true); - static HyperShellBoundary boundary; - triangulation.set_boundary (0, boundary); - triangulation.set_boundary (1, boundary); + static PolarManifold boundary; + triangulation.set_manifold (0, boundary); + triangulation.set_manifold (1, boundary); global_Omega_diameter = GridTools::diameter (triangulation); diff --git a/deal.II/examples/step-34/step-34.cc b/deal.II/examples/step-34/step-34.cc index 7eb237953a..b3c7d1c3cf 100644 --- a/deal.II/examples/step-34/step-34.cc +++ b/deal.II/examples/step-34/step-34.cc @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include @@ -184,7 +184,7 @@ namespace Step34 // // Experimenting a little with the computation of the angles gives very // accurate results for simpler geometries. To verify this you can comment - // out, in the read_domain() method, the tria.set_boundary(1, boundary) + // out, in the read_domain() method, the tria.set_manifold (1, boundary) // line, and check the alpha that is generated by the program. By removing // this call, whenever the mesh is refined new nodes will be placed along // the straight lines that made up the coarse mesh, rather than be pulled @@ -496,7 +496,7 @@ namespace Step34 void BEMProblem::read_domain() { static const Point center = Point(); - static const HyperBallBoundary boundary(center,1.); + static const PolarManifold boundary(center); std::ifstream in; switch (dim) @@ -517,7 +517,7 @@ namespace Step34 gi.attach_triangulation (tria); gi.read_ucd (in); - tria.set_boundary(1, boundary); + tria.set_manifold (1, boundary); } diff --git a/deal.II/examples/step-35/step-35.cc b/deal.II/examples/step-35/step-35.cc index 6dfe49d2e7..5753231311 100644 --- a/deal.II/examples/step-35/step-35.cc +++ b/deal.II/examples/step-35/step-35.cc @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include #include diff --git a/deal.II/examples/step-37/step-37.cc b/deal.II/examples/step-37/step-37.cc index 8a2a17723d..7dfea760be 100644 --- a/deal.II/examples/step-37/step-37.cc +++ b/deal.II/examples/step-37/step-37.cc @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include diff --git a/deal.II/examples/step-38/step-38.cc b/deal.II/examples/step-38/step-38.cc index d8d17da2b2..ac5c8a2c3d 100644 --- a/deal.II/examples/step-38/step-38.cc +++ b/deal.II/examples/step-38/step-38.cc @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include @@ -318,8 +318,8 @@ namespace Step38 template void LaplaceBeltramiProblem::make_grid_and_dofs () { - static HyperBallBoundary surface_description; - triangulation.set_boundary (0, surface_description); + static PolarManifold surface_description; + triangulation.set_manifold (0, surface_description); { Triangulation volume_mesh; diff --git a/deal.II/examples/step-42/step-42.cc b/deal.II/examples/step-42/step-42.cc index efcdad4921..81a5202a62 100644 --- a/deal.II/examples/step-42/step-42.cc +++ b/deal.II/examples/step-42/step-42.cc @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include @@ -755,8 +755,8 @@ void PlasticityContactProblem::make_grid() { GridTools::transform(&rotate_half_sphere, triangulation); Point < dim > shift(0.5, 0.5, 0.5); GridTools::shift(shift, triangulation); - static HyperBallBoundary boundary_description(Point(0.5,0.5,0.5), radius); - triangulation.set_boundary (0, boundary_description); + static PolarManifold boundary_description(Point(0.5,0.5,0.5)); + triangulation.set_manifold (0, boundary_description); triangulation.refine_global(n_initial_refinements); diff --git a/deal.II/examples/step-44/step-44.cc b/deal.II/examples/step-44/step-44.cc index 8983261329..fe51603a0b 100644 --- a/deal.II/examples/step-44/step-44.cc +++ b/deal.II/examples/step-44/step-44.cc @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include diff --git a/deal.II/examples/step-47/step-47.cc b/deal.II/examples/step-47/step-47.cc index e607cb2d87..89f687a95a 100644 --- a/deal.II/examples/step-47/step-47.cc +++ b/deal.II/examples/step-47/step-47.cc @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include @@ -1065,8 +1065,8 @@ namespace Step47 GridGenerator::hyper_ball (triangulation); //GridGenerator::hyper_cube (triangulation, -1, 1); - static const HyperBallBoundary boundary; - triangulation.set_boundary (0, boundary); + static const PolarManifold boundary; + triangulation.set_manifold (0, boundary); triangulation.refine_global (2); } diff --git a/deal.II/examples/step-49/step-49.cc b/deal.II/examples/step-49/step-49.cc index a1139eb765..a7f36f260d 100644 --- a/deal.II/examples/step-49/step-49.cc +++ b/deal.II/examples/step-49/step-49.cc @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include @@ -194,8 +194,8 @@ void grid_3 () // an object that describes a circle (i.e., a hyper ball) with appropriate // center and radius and assign it to the triangulation. We can then refine // twice: - const HyperBallBoundary<2> boundary_description(Point<2>(0,0), 0.25); - triangulation.set_boundary (1, boundary_description); + const PolarManifold<2> boundary_description(Point<2>(0,0)); + triangulation.set_manifold (1, boundary_description); triangulation.refine_global(2); // The mesh so generated is then passed to the function that generates @@ -204,7 +204,7 @@ void grid_3 () // object is destroyed first in this function since it was declared after // the triangulation). mesh_info (triangulation, "grid-3.eps"); - triangulation.set_boundary (1); + triangulation.set_manifold (1); } // There is one snag to doing things as shown above: If one moves the nodes on diff --git a/deal.II/examples/step-5/step-5.cc b/deal.II/examples/step-5/step-5.cc index f1d146935b..27f0e2dbbb 100644 --- a/deal.II/examples/step-5/step-5.cc +++ b/deal.II/examples/step-5/step-5.cc @@ -50,7 +50,7 @@ // We will use a circular domain, and the object describing the boundary of it // comes from this file: -#include +#include // This is C++ ... #include @@ -599,8 +599,8 @@ void Step5::run () // the first example. Note that the HyperBallBoundary constructor takes two // parameters, the center of the ball and the radius, but that their default // (the origin and 1.0) are the ones which we would like to use here. - static const HyperBallBoundary boundary; - triangulation.set_boundary (0, boundary); + static const PolarManifold boundary; + triangulation.set_manifold (0, boundary); for (unsigned int cycle=0; cycle<6; ++cycle) { diff --git a/deal.II/examples/step-50/step-50.cc b/deal.II/examples/step-50/step-50.cc index b1398c7362..72198b1a4d 100644 --- a/deal.II/examples/step-50/step-50.cc +++ b/deal.II/examples/step-50/step-50.cc @@ -61,7 +61,7 @@ #include #include #include -#include +#include #include #include diff --git a/deal.II/examples/step-51/step-51.cc b/deal.II/examples/step-51/step-51.cc index bc4778c23a..ab772a39a1 100644 --- a/deal.II/examples/step-51/step-51.cc +++ b/deal.II/examples/step-51/step-51.cc @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/deal.II/examples/step-6/step-6.cc b/deal.II/examples/step-6/step-6.cc index 681b9e4a34..0f9495a5ea 100644 --- a/deal.II/examples/step-6/step-6.cc +++ b/deal.II/examples/step-6/step-6.cc @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include @@ -676,8 +676,8 @@ void Step6::run () { GridGenerator::hyper_ball (triangulation); - static const HyperBallBoundary boundary; - triangulation.set_boundary (0, boundary); + static const PolarManifold boundary; + triangulation.set_manifold (0, boundary); triangulation.refine_global (1); } diff --git a/deal.II/examples/step-7/step-7.cc b/deal.II/examples/step-7/step-7.cc index 058e7cf1cd..0bce558c82 100644 --- a/deal.II/examples/step-7/step-7.cc +++ b/deal.II/examples/step-7/step-7.cc @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/deal.II/examples/step-8/step-8.cc b/deal.II/examples/step-8/step-8.cc index da7eccfd57..27043e2db1 100644 --- a/deal.II/examples/step-8/step-8.cc +++ b/deal.II/examples/step-8/step-8.cc @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/deal.II/examples/step-9/step-9.cc b/deal.II/examples/step-9/step-9.cc index 9f6883e273..1feb9d9c0a 100644 --- a/deal.II/examples/step-9/step-9.cc +++ b/deal.II/examples/step-9/step-9.cc @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include