From 7431684b6a8ed9cca943c6c0544c4432b6ecb0d3 Mon Sep 17 00:00:00 2001 From: bangerth Date: Sun, 21 Aug 2011 15:08:24 +0000 Subject: [PATCH] Avoid a Clang compiler error by resorting include files. git-svn-id: https://svn.dealii.org/trunk@24164 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-26/step-26.cc | 62 ++++++++++++++--------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/deal.II/examples/step-26/step-26.cc b/deal.II/examples/step-26/step-26.cc index e81d5d4c95..cc070a5147 100644 --- a/deal.II/examples/step-26/step-26.cc +++ b/deal.II/examples/step-26/step-26.cc @@ -3,7 +3,7 @@ /* $Id$ */ /* */ -/* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors */ +/* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2011 by the deal.II authors */ /* */ /* This file is subject to QPL and may not be distributed */ /* without copyright and license information. Please refer */ @@ -18,6 +18,7 @@ // not explain their meaning here // again. #include +#include #include #include #include @@ -51,7 +52,6 @@ #include #include -#include // The last step is as in all // previous programs: @@ -64,7 +64,7 @@ class PointCloudSurface : public StraightBoundary<3> * Constructor. */ PointCloudSurface (const std::string &filename); - + /** * Let the new point be the * arithmetic mean of the two @@ -138,7 +138,7 @@ class PointCloudSurface : public StraightBoundary<3> * point cloud, rather than doing any * sort of interpolation. */ - Point<3> closest_point (const Point<3> &p) const; + Point<3> closest_point (const Point<3> &p) const; private: std::vector > point_list; }; @@ -150,7 +150,7 @@ PointCloudSurface::PointCloudSurface (const std::string &filename) { std::ifstream in (filename.c_str()); AssertThrow (in, ExcIO()); - + while (in) { Point<3> p; @@ -160,7 +160,7 @@ PointCloudSurface::PointCloudSurface (const std::string &filename) AssertThrow (point_list.size() > 1, ExcIO()); } - + // next fit a linear model through the data // cloud to rectify it in a local // coordinate system @@ -179,7 +179,7 @@ PointCloudSurface::PointCloudSurface (const std::string &filename) // next do a least squares fit to the // function ax+by. this leads to the // following equations: - + // min f(a,b) = sum_i (zi-a xi - b yi)^2 / 2 // // f_a = sum_i (zi - a xi - b yi) xi = 0 @@ -216,7 +216,7 @@ PointCloudSurface::PointCloudSurface (const std::string &filename) = Point<2>(-b,a) / std::sqrt(a*a+b*b); const double stretch_factor = std::sqrt(1.+a*a+b*b); - + for (unsigned int i=0; i &p) const { double distance = p.distance (point_list[0]); Point<3> point = point_list[0]; - + for (std::vector >::const_iterator i=point_list.begin(); i != point_list.end(); ++i) { @@ -270,7 +270,7 @@ PointCloudSurface::closest_point (const Point<3> &p) const return point; } - + Point<3> PointCloudSurface:: get_new_point_on_line (const Triangulation<3>::line_iterator &line) const @@ -344,12 +344,12 @@ PointCloudSurface pds("surface-points"); // respectively. Apart from this, // everything is as before. template -class LaplaceProblem +class LaplaceProblem { public: LaplaceProblem (); void run (); - + private: void make_grid_and_dofs (); void assemble_system (); @@ -374,11 +374,11 @@ class LaplaceProblem template -class BoundaryValues : public Function +class BoundaryValues : public Function { public: BoundaryValues () : Function() {} - + virtual double value (const Point &p, const unsigned int component = 0) const; }; @@ -387,7 +387,7 @@ class BoundaryValues : public Function template double BoundaryValues::value (const Point &p, - const unsigned int /*component*/) const + const unsigned int /*component*/) const { return std::max(p[dim-1], -5.); } @@ -497,15 +497,15 @@ void LaplaceProblem::make_grid_and_dofs () break; } triangulation.set_boundary (1, pds); - - + + for (unsigned int v=0; v::vertices_per_cell; ++v) if (triangulation.begin()->vertex(v)[2] > 0) triangulation.begin()->vertex(v) = pds.closest_point (Point<3>(triangulation.begin()->vertex(v)[0], triangulation.begin()->vertex(v)[1], 0)); - + for (unsigned int i=0; i<4; ++i) { for (typename Triangulation::active_cell_iterator @@ -514,7 +514,7 @@ void LaplaceProblem::make_grid_and_dofs () for (unsigned int f=0; f::faces_per_cell; ++f) if (cell->face(f)->boundary_indicator() == 1) cell->set_refine_flag (); - + triangulation.execute_coarsening_and_refinement (); std::cout << "Refinement cycle " << i << std::endl @@ -526,8 +526,8 @@ void LaplaceProblem::make_grid_and_dofs () << std::endl; } - - + + dof_handler.distribute_dofs (fe); std::cout << " Number of degrees of freedom: " @@ -563,7 +563,7 @@ void LaplaceProblem::make_grid_and_dofs () // way we assemble matrix and right // hand side vector dimension // independently: there is simply no - // difference to the + // difference to the // two-dimensional case. Since the // important objects used in this // function (quadrature formula, @@ -580,13 +580,13 @@ void LaplaceProblem::make_grid_and_dofs () // don't have to care about most // things. template -void LaplaceProblem::assemble_system () -{ +void LaplaceProblem::assemble_system () +{ MatrixTools::create_laplace_matrix (dof_handler, QGauss(2), system_matrix); system_rhs = 0; - + std::map boundary_values; VectorTools::interpolate_boundary_values (dof_handler, 0, @@ -609,7 +609,7 @@ void LaplaceProblem::assemble_system () // function is copied verbatim from the // previous example. template -void LaplaceProblem::solve () +void LaplaceProblem::solve () { // NEW SolverControl solver_control (dof_handler.n_dofs(), @@ -678,10 +678,10 @@ void LaplaceProblem::output_results () const // additional output, it is the same // as for the previous example. template -void LaplaceProblem::run () +void LaplaceProblem::run () { std::cout << "Solving problem in " << dim << " space dimensions." << std::endl; - + make_grid_and_dofs(); assemble_system (); solve (); @@ -763,13 +763,13 @@ void LaplaceProblem::run () // written. By changing it you can get more // information about the innards of the // library. -int main () +int main () { deallog.depth_console (0); { LaplaceProblem<3> laplace_problem_3d; laplace_problem_3d.run (); } - + return 0; } -- 2.39.5