From 00177a83edbd746ad1c90c5a00cb694685ee44e3 Mon Sep 17 00:00:00 2001 From: bangerth Date: Wed, 20 Mar 2013 03:38:11 +0000 Subject: [PATCH] Use standard names. git-svn-id: https://svn.dealii.org/trunk@28949 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-26/step-26.cc | 42 ++++++++++++++--------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/deal.II/examples/step-26/step-26.cc b/deal.II/examples/step-26/step-26.cc index 39d037c00f..55148712cb 100644 --- a/deal.II/examples/step-26/step-26.cc +++ b/deal.II/examples/step-26/step-26.cc @@ -62,10 +62,10 @@ namespace Step26 SparsityPattern sparsity_pattern; SparseMatrix mass_matrix; SparseMatrix laplace_matrix; - SparseMatrix matrix_u; + SparseMatrix system_matrix; - Vector solution_u; - Vector old_solution_u; + Vector solution; + Vector old_solution; Vector system_rhs; double time, time_step; @@ -169,14 +169,14 @@ namespace Step26 mass_matrix.reinit(sparsity_pattern); laplace_matrix.reinit(sparsity_pattern); - matrix_u.reinit(sparsity_pattern); + system_matrix.reinit(sparsity_pattern); MatrixCreator::create_mass_matrix(dof_handler, QGauss(3), mass_matrix); MatrixCreator::create_laplace_matrix(dof_handler, QGauss(3), laplace_matrix); - solution_u.reinit(dof_handler.n_dofs()); - old_solution_u.reinit(dof_handler.n_dofs()); + solution.reinit(dof_handler.n_dofs()); + old_solution.reinit(dof_handler.n_dofs()); system_rhs.reinit(dof_handler.n_dofs()); constraints.close(); @@ -189,9 +189,9 @@ namespace Step26 SolverCG<> cg(solver_control); PreconditionSSOR<> preconditioner; - preconditioner.initialize(matrix_u, 1.0); + preconditioner.initialize(system_matrix, 1.0); - cg.solve(matrix_u, solution_u, system_rhs, preconditioner); + cg.solve(system_matrix, solution, system_rhs, preconditioner); std::cout << " u-equation: " << solver_control.last_step() << " CG iterations." << std::endl; @@ -203,7 +203,7 @@ namespace Step26 DataOut data_out; data_out.attach_dof_handler(dof_handler); - data_out.add_data_vector(solution_u, "U"); + data_out.add_data_vector(solution, "U"); data_out.build_patches(); @@ -212,7 +212,7 @@ namespace Step26 std::ofstream output(filename.c_str()); data_out.write_vtk(output); - std::cout << " max= " << time << ' ' << solution_u.linfty_norm() << std::endl; + std::cout << " max= " << time << ' ' << solution.linfty_norm() << std::endl; } template @@ -220,16 +220,16 @@ namespace Step26 { setup_system(); - VectorTools::interpolate(dof_handler, ZeroFunction(), solution_u); + VectorTools::interpolate(dof_handler, ZeroFunction(), solution); timestep_number = 0; output_results(); VectorTools::interpolate(dof_handler, ZeroFunction(), - old_solution_u); + old_solution); - Vector tmp(solution_u.size()); - Vector forcing_terms(solution_u.size()); + Vector tmp(solution.size()); + Vector forcing_terms(solution.size()); for (timestep_number = 1, time = time_step; time <= 0.5; time += time_step, ++timestep_number) @@ -237,9 +237,9 @@ namespace Step26 std::cout << "Time step " << timestep_number << " at t=" << time << std::endl; - mass_matrix.vmult(system_rhs, old_solution_u); + mass_matrix.vmult(system_rhs, old_solution); - laplace_matrix.vmult(tmp, old_solution_u); + laplace_matrix.vmult(tmp, old_solution); system_rhs.add(-(1 - theta) * time_step, tmp); RightHandSide rhs_function; @@ -265,16 +265,16 @@ namespace Step26 VectorTools::interpolate_boundary_values(dof_handler, 0, boundary_values_u_function, boundary_values); - matrix_u.copy_from(mass_matrix); - matrix_u.add(theta * time_step, laplace_matrix); - MatrixTools::apply_boundary_values(boundary_values, matrix_u, - solution_u, system_rhs); + system_matrix.copy_from(mass_matrix); + system_matrix.add(theta * time_step, laplace_matrix); + MatrixTools::apply_boundary_values(boundary_values, system_matrix, + solution, system_rhs); } solve_u(); output_results(); - old_solution_u = solution_u; + old_solution = solution; } } } -- 2.39.5