From: bangerth Date: Thu, 24 Jun 2010 01:39:13 +0000 (+0000) Subject: Use intermediate compressed sparsity pattern. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32dbc625436c54e04cd2f84a642913fae178dcb3;p=dealii-svn.git Use intermediate compressed sparsity pattern. git-svn-id: https://svn.dealii.org/trunk@21304 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-45/step-45.cc b/deal.II/examples/step-45/step-45.cc index 356d85a0a9..bc52cf6793 100644 --- a/deal.II/examples/step-45/step-45.cc +++ b/deal.II/examples/step-45/step-45.cc @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -236,16 +237,23 @@ void LaplaceProblem::make_grid_and_dofs () // upper and lower parts of the boundary // and close the // ConstraintMatrix object. - VectorTools::interpolate_boundary_values (dof_handler, 1, ZeroFunction<2> (), constraints); + VectorTools::interpolate_boundary_values (dof_handler, 1, + ZeroFunction<2> (), + constraints); constraints.close (); // Then we create the sparsity pattern and // the system matrix and initialize the // solution and right-hand side vectors. const unsigned int n_dofs = dof_handler.n_dofs (); - - sparsity_pattern.reinit (n_dofs, n_dofs, dof_handler.max_couplings_between_dofs ()); - DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern, constraints, false); - sparsity_pattern.compress (); + + CompressedSparsityPattern c_sparsity_pattern (n_dofs, n_dofs); + DoFTools::make_sparsity_pattern (dof_handler, + c_sparsity_pattern, + constraints, + false); + c_sparsity_pattern.compress (); + sparsity_pattern.copy_from (c_sparsity_pattern); + system_matrix.reinit (sparsity_pattern); system_rhs.reinit (n_dofs); solution.reinit (n_dofs);