From: Wolfgang Bangerth Date: Sun, 4 Oct 2009 23:13:08 +0000 (+0000) Subject: More minor reformatting. X-Git-Tag: v8.0.0~6983 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4556226df9cca4ef1284b9957331e05f4c0b302e;p=dealii.git More minor reformatting. git-svn-id: https://svn.dealii.org/trunk@19699 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-35/step-35.cc b/deal.II/examples/step-35/step-35.cc index 6a2ad85ecd..123b659f3e 100644 --- a/deal.II/examples/step-35/step-35.cc +++ b/deal.II/examples/step-35/step-35.cc @@ -721,7 +721,7 @@ NavierStokesProjection::NavierStokesProjection(const RunTimeParameters::Dat << " The obtained results will be nonsense" << std::endl; - AssertThrow (! ( (dt <= 0.) or (dt > .5*T)), ExcInvalidTimeStep (dt, .5*T)); + AssertThrow (! ( (dt <= 0.) || (dt > .5*T)), ExcInvalidTimeStep (dt, .5*T)); create_triangulation (data.n_of_global_refines); initialize(); @@ -745,15 +745,18 @@ void NavierStokesProjection::create_triangulation (const unsigned int n_of_ GridIn grid_in; grid_in.attach_triangulation (triangulation); - std::string filename = "nsbench2.inp"; - std::ifstream file (filename.c_str()); - Assert (file, ExcFileNotOpen (filename.c_str())); - grid_in.read_ucd (file); - file.close(); + { + std::string filename = "nsbench2.inp"; + std::ifstream file (filename.c_str()); + Assert (file, ExcFileNotOpen (filename.c_str())); + grid_in.read_ucd (file); + } - std::cout << "Number of refines = " << n_of_refines << std::endl; + std::cout << "Number of refines = " << n_of_refines + << std::endl; triangulation.refine_global (n_of_refines); - std::cout << "Number of active cells: " << triangulation.n_active_cells() << std::endl; + std::cout << "Number of active cells: " << triangulation.n_active_cells() + << std::endl; boundary_indicators = triangulation.get_boundary_indicators(); @@ -1045,35 +1048,51 @@ void NavierStokesProjection::diffusion_step (const bool reinit_prec) vel_it_matrix[d].add (1., vel_Advection); vel_exact.set_component(d); - std::vector::const_iterator boundaries = boundary_indicators.begin(), - b_end = boundary_indicators.end(); boundary_values.clear(); - for (; boundaries != b_end; ++boundaries) + for (std::vector::const_iterator + boundaries = boundary_indicators.begin(); + boundaries != boundary_indicators.end(); + ++boundaries) { switch (*boundaries) { case 1: - VectorTools::interpolate_boundary_values (dof_handler_velocity, *boundaries, - ZeroFunction(), boundary_values); + VectorTools:: + interpolate_boundary_values (dof_handler_velocity, + *boundaries, + ZeroFunction(), + boundary_values); break; case 2: - VectorTools::interpolate_boundary_values (dof_handler_velocity, *boundaries, - vel_exact, boundary_values); + VectorTools:: + interpolate_boundary_values (dof_handler_velocity, + *boundaries, + vel_exact, + boundary_values); break; case 3: if (d != 0) - VectorTools::interpolate_boundary_values (dof_handler_velocity, *boundaries, - ZeroFunction(), boundary_values); + VectorTools:: + interpolate_boundary_values (dof_handler_velocity, + *boundaries, + ZeroFunction(), + boundary_values); break; case 4: - VectorTools::interpolate_boundary_values (dof_handler_velocity, *boundaries, - ZeroFunction(), boundary_values); + VectorTools:: + interpolate_boundary_values (dof_handler_velocity, + *boundaries, + ZeroFunction(), + boundary_values); break; default: Assert (false, ExcNotImplemented()); } } - MatrixTools::apply_boundary_values (boundary_values, vel_it_matrix[d], u_n[d], force[d]); + MatrixTools::apply_boundary_values (boundary_values, + vel_it_matrix[d], + u_n[d], + force[d]); } @@ -1082,8 +1101,12 @@ void NavierStokesProjection::diffusion_step (const bool reinit_prec) { if (reinit_prec) prec_velocity[d].initialize (vel_it_matrix[d], - SparseILU::AdditionalData (vel_diag_strength, vel_off_diagonals)); - tasks += Threads::new_task (&NavierStokesProjection::diffusion_component_solve, *this, d); + SparseILU:: + AdditionalData (vel_diag_strength, + vel_off_diagonals)); + tasks += Threads::new_task (&NavierStokesProjection:: + diffusion_component_solve, + *this, d); } tasks.join_all(); } @@ -1092,12 +1115,13 @@ template void NavierStokesProjection::diffusion_component_solve (const unsigned int d) { SolverControl solver_control (vel_max_its, vel_eps*force[d].l2_norm()); - SolverGMRES<> gmres (solver_control, SolverGMRES<>::AdditionalData (vel_Krylov_size)); + SolverGMRES<> gmres (solver_control, + SolverGMRES<>::AdditionalData (vel_Krylov_size)); gmres.solve (vel_it_matrix[d], u_n[d], force[d], prec_velocity[d]); } - // @sect4{ The NavierStokesProjection::assemble_advection_term method and related} + // @sect4{ The NavierStokesProjection::assemble_advection_term method and related} template void NavierStokesProjection::assemble_advection_term() {