From: Martin Kronbichler Date: Mon, 9 Mar 2009 12:22:00 +0000 (+0000) Subject: Use the new CellSimilarity capability of FEValues in order to speed up assembly. X-Git-Tag: v8.0.0~7978 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6318b1dc52f7f1bf5f01883611c45e463ab0fa9;p=dealii.git Use the new CellSimilarity capability of FEValues in order to speed up assembly. git-svn-id: https://svn.dealii.org/trunk@18468 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-32/step-32.cc b/deal.II/examples/step-32/step-32.cc index 35adcfff59..79fc28af55 100644 --- a/deal.II/examples/step-32/step-32.cc +++ b/deal.II/examples/step-32/step-32.cc @@ -792,24 +792,30 @@ BoussinesqFlowProblem::assemble_stokes_preconditioner () Utilities::Trilinos::get_this_mpi_process(trilinos_communicator)) { stokes_fe_values.reinit (cell); - local_matrix = 0; - for (unsigned int q=0; qget_dof_indices (local_dof_indices); @@ -926,7 +932,8 @@ void BoussinesqFlowProblem::assemble_stokes_system () stokes_fe_values.reinit (cell); temperature_fe_values.reinit (temperature_cell); - local_matrix = 0; + if (stokes_fe_values.get_cell_similarity() != CellSimilarity::translation) + local_matrix = 0; local_rhs = 0; temperature_fe_values.get_function_values (old_temperature_solution, @@ -939,7 +946,8 @@ void BoussinesqFlowProblem::assemble_stokes_system () for (unsigned int k=0; k::assemble_stokes_system () } } - if (rebuild_stokes_matrix) + if (rebuild_stokes_matrix && + stokes_fe_values.get_cell_similarity() != CellSimilarity::translation) for (unsigned int i=0; i gravity = ( (dim == 2) ? (Point (0,1)) : (Point (0,0,1)) ); @@ -968,12 +977,14 @@ void BoussinesqFlowProblem::assemble_stokes_system () if (rebuild_stokes_matrix == true) stokes_constraints.distribute_local_to_global (local_matrix, + local_rhs, local_dof_indices, - stokes_matrix); - - stokes_constraints.distribute_local_to_global (local_rhs, - local_dof_indices, - stokes_rhs); + stokes_matrix, + stokes_rhs); + else + stokes_constraints.distribute_local_to_global (local_rhs, + local_dof_indices, + stokes_rhs); } stokes_matrix.compress(); @@ -1024,31 +1035,34 @@ void BoussinesqFlowProblem::assemble_temperature_matrix () if (cell->subdomain_id() == Utilities::Trilinos::get_this_mpi_process(trilinos_communicator) ) { - local_mass_matrix = 0; - local_stiffness_matrix = 0; - temperature_fe_values.reinit (cell); - for (unsigned int q=0; qget_dof_indices (local_dof_indices);