From d01b801bbd645ed9e4da91a9e19ed3deec536eb1 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 9 Feb 2006 02:51:56 +0000 Subject: [PATCH] Rename LaplaceProblem by HelmholtzProblem, since this is actually what we solve. git-svn-id: https://svn.dealii.org/trunk@12274 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-7/step-7.cc | 106 +++++++++++++++--------------- 1 file changed, 54 insertions(+), 52 deletions(-) diff --git a/deal.II/examples/step-7/step-7.cc b/deal.II/examples/step-7/step-7.cc index e64365bb9e..1ca3de6d01 100644 --- a/deal.II/examples/step-7/step-7.cc +++ b/deal.II/examples/step-7/step-7.cc @@ -11,7 +11,9 @@ /* to the file deal.II/doc/license.html for the text and */ /* further information on this license. */ - // These first include files have all + // @sect3{Include files} + + // These first include files have all // been treated in previous examples, // so we won't explain what is in // them again. @@ -374,7 +376,7 @@ double RightHandSide::value (const Point &p, } - // @sect3{The Laplace solver class} + // @sect3{The Helmholtz solver class} // Then we need the class that does // all the work. It is mostly the @@ -384,7 +386,7 @@ double RightHandSide::value (const Point &p, // respective functions or variables // below. template -class LaplaceProblem +class HelmholtzProblem { public: // We will use this class in @@ -407,13 +409,13 @@ class LaplaceProblem // element and the refinement // mode as parameter and stores // them in local variables. - LaplaceProblem (const FiniteElement &fe, - const RefinementMode refinement_mode); + HelmholtzProblem (const FiniteElement &fe, + const RefinementMode refinement_mode); // The following two functions // are the same as in previous // examples. - ~LaplaceProblem (); + ~HelmholtzProblem (); void run (); @@ -672,8 +674,8 @@ class LaplaceProblem // triangulation (which is empty at // present, however). template -LaplaceProblem::LaplaceProblem (const FiniteElement &fe, - const RefinementMode refinement_mode) : +HelmholtzProblem::HelmholtzProblem (const FiniteElement &fe, + const RefinementMode refinement_mode) : dof_handler (triangulation), fe (&fe), refinement_mode (refinement_mode) @@ -682,7 +684,7 @@ LaplaceProblem::LaplaceProblem (const FiniteElement &fe, template -LaplaceProblem::~LaplaceProblem () +HelmholtzProblem::~HelmholtzProblem () { dof_handler.clear (); } @@ -696,7 +698,7 @@ LaplaceProblem::~LaplaceProblem () // difference being the renumbering // step. template -void LaplaceProblem::setup_system () +void HelmholtzProblem::setup_system () { dof_handler.distribute_dofs (*fe); // Renumbering the degrees of @@ -755,7 +757,7 @@ void LaplaceProblem::setup_system () // changed anyway, so we comment on // this function fairly extensively. template -void LaplaceProblem::assemble_system () +void HelmholtzProblem::assemble_system () { // First we need to define objects // which will be used as quadrature @@ -1049,7 +1051,7 @@ void LaplaceProblem::assemble_system () // Solving the system of equations is // done in the same way as before. template -void LaplaceProblem::solve () +void HelmholtzProblem::solve () { SolverControl solver_control (1000, 1e-12); SolverCG<> cg (solver_control); @@ -1070,7 +1072,7 @@ void LaplaceProblem::solve () // constructor, we do global or // adaptive refinement. template -void LaplaceProblem::refine_grid () +void HelmholtzProblem::refine_grid () { switch (refinement_mode) { @@ -1082,26 +1084,26 @@ void LaplaceProblem::refine_grid () break; }; - // In case of adaptive - // refinement, we use the same - // functions and classes as in - // the previous example - // program. Note that one - // could treat Neumann - // boundaries differently than - // Dirichlet boundaries, and - // one should in fact do so - // here since we have Neumann - // boundary conditions on part - // of the boundaries, but - // since we don't have a - // function here that - // describes the Neumann - // values (we only construct - // these values from the exact - // solution when assembling - // the matrix), we omit this - // detail here. + // In case of adaptive + // refinement, we use the same + // functions and classes as in + // the previous example + // program. Note that one + // could treat Neumann + // boundaries differently than + // Dirichlet boundaries, and + // one should in fact do so + // here since we have Neumann + // boundary conditions on part + // of the boundaries, but + // since we don't have a + // function here that + // describes the Neumann + // values (we only construct + // these values from the exact + // solution when assembling + // the matrix), we omit this + // detail here. case adaptive_refinement: { Vector estimated_error_per_cell (triangulation.n_active_cells()); @@ -1134,7 +1136,7 @@ void LaplaceProblem::refine_grid () // convergence against the continuous // solution in a nice format. template -void LaplaceProblem::process_solution (const unsigned int cycle) +void HelmholtzProblem::process_solution (const unsigned int cycle) { // In order to integrate the // difference between computed @@ -1319,7 +1321,7 @@ void LaplaceProblem::process_solution (const unsigned int cycle) // linear system, solution, and // post-processing. template -void LaplaceProblem::run () +void HelmholtzProblem::run () { for (unsigned int cycle=0; cycle<7; ++cycle) { @@ -1510,16 +1512,16 @@ void LaplaceProblem::run () break; default: - // The finite element is - // neither Q1 nor Q2. This - // should not have happened, - // but maybe someone has tried - // to change this in ``main'', - // so it might happen. We catch - // this case and throw an - // exception, since we don't - // know how to name the - // respective output file + // The finite element is + // neither Q1 nor Q2. This + // should not have happened, + // but maybe someone has tried + // to change this in ``main'', + // so it might happen. We catch + // this case and throw an + // exception, since we don't + // know how to name the + // respective output file Assert (false, ExcInternalError()); }; @@ -1786,7 +1788,7 @@ int main () // order to destroy the // respective objects (i.e. the // finite element and the - // LaplaceProblem object) at + // HelmholtzProblem object) at // the end of the block and // before we go to the next // run. @@ -1796,8 +1798,8 @@ int main () << std::endl; FE_Q fe(1); - LaplaceProblem laplace_problem_2d (fe, LaplaceProblem::adaptive_refinement); - laplace_problem_2d.run (); + HelmholtzProblem helmholtz_problem_2d (fe, HelmholtzProblem::adaptive_refinement); + helmholtz_problem_2d.run (); std::cout << std::endl; }; @@ -1808,8 +1810,8 @@ int main () << std::endl; FE_Q fe(1); - LaplaceProblem laplace_problem_2d (fe, LaplaceProblem::global_refinement); - laplace_problem_2d.run (); + HelmholtzProblem helmholtz_problem_2d (fe, HelmholtzProblem::global_refinement); + helmholtz_problem_2d.run (); std::cout << std::endl; }; @@ -1820,8 +1822,8 @@ int main () << std::endl; FE_Q fe(2); - LaplaceProblem laplace_problem_2d (fe, LaplaceProblem::global_refinement); - laplace_problem_2d.run (); + HelmholtzProblem helmholtz_problem_2d (fe, HelmholtzProblem::global_refinement); + helmholtz_problem_2d.run (); std::cout << std::endl; }; -- 2.39.5