From 4a06c6d6afcca36faece0ddcdff501044870e1aa Mon Sep 17 00:00:00 2001 From: bangerth Date: Wed, 20 Aug 2008 14:33:49 +0000 Subject: [PATCH] Instead of copying into the global matrix/vector by hand and later calling condense on the resulting object, use ConstraintMatrix::distribute_local_to_global. git-svn-id: https://svn.dealii.org/trunk@16612 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-31/step-31.cc | 101 ++++++---------------------- 1 file changed, 20 insertions(+), 81 deletions(-) diff --git a/deal.II/examples/step-31/step-31.cc b/deal.II/examples/step-31/step-31.cc index a8911193d5..be3ed10c0e 100644 --- a/deal.II/examples/step-31/step-31.cc +++ b/deal.II/examples/step-31/step-31.cc @@ -1181,15 +1181,10 @@ BoussinesqFlowProblem::assemble_stokes_preconditioner () } cell->get_dof_indices (local_dof_indices); - - for (unsigned int i=0; i::assemble_stokes_system () cell->get_dof_indices (local_dof_indices); if (rebuild_stokes_matrix == true) - for (unsigned int i=0; i boundary_values; - -// typename DoFHandler::active_cell_iterator -// cell = dof_handler.begin_active(), -// emdc = dof_handler.end(); -// for (; cell!=endc; ++cell) -// for (unsigned int v=0; v::vertices_per_cell; ++v) -// if (cell->vertex(v).distance(dim == 2 -// ? -// Point(0,-1) -// : -// Point(0,0,-1)) < 1e-6) -// { -// std::cout << "Found cell and vertex: " << cell << ' ' -// << v << std::endl; - -// boundary_values[cell->vertex_dof_index(v,0)] = 0; -// break; -// } - -// std::vector component_mask (dim+2, true); -// component_mask[dim] = component_mask[dim+1] = false; -// VectorTools::interpolate_boundary_values (dof_handler, -// 0, -// ZeroFunction(dim+2), -// boundary_values, -// component_mask); - -// MatrixTools::apply_boundary_values (boundary_values, -// stokes_matrix, -// solution, -// system_rhs); + stokes_constraints.distribute_local_to_global (local_rhs, + local_dof_indices, + stokes_rhs); } + rebuild_stokes_matrix = false; + std::cout << std::endl; } @@ -1799,20 +1747,13 @@ void BoussinesqFlowProblem::assemble_temperature_matrix () cell->get_dof_indices (local_dof_indices); - for (unsigned int i=0; i::assemble_temperature_system () } cell->get_dof_indices (local_dof_indices); - - for (unsigned int i=0; i