From: bangerth Date: Thu, 9 Aug 2012 20:28:54 +0000 (+0000) Subject: Apply a few patches rescued from a previous branch. This probably only covers a small... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68fa659acd63456dec0f6a4896a33a4374e52740;p=dealii-svn.git Apply a few patches rescued from a previous branch. This probably only covers a small fraction of the places that need to be converted, but better than nothing. git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_3@25842 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-18/step-18.cc b/deal.II/examples/step-18/step-18.cc index 0297cdfab8..5482c16010 100644 --- a/deal.II/examples/step-18/step-18.cc +++ b/deal.II/examples/step-18/step-18.cc @@ -1481,7 +1481,7 @@ namespace Step18 FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); Vector cell_rhs (dofs_per_cell); - std::vector local_dof_indices (dofs_per_cell); + std::vector local_dof_indices (dofs_per_cell); BodyForce body_force; std::vector > body_force_values (n_q_points, diff --git a/deal.II/examples/step-4/step-4.cc b/deal.II/examples/step-4/step-4.cc index 40bf96d41c..2106b15f38 100644 --- a/deal.II/examples/step-4/step-4.cc +++ b/deal.II/examples/step-4/step-4.cc @@ -437,7 +437,7 @@ void Step4::assemble_system () FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); Vector cell_rhs (dofs_per_cell); - std::vector local_dof_indices (dofs_per_cell); + std::vector local_dof_indices (dofs_per_cell); // Next, we again have to loop over all // cells and assemble local contributions. diff --git a/deal.II/examples/step-42/step-42.cc b/deal.II/examples/step-42/step-42.cc index 1f434510dd..02b0ead735 100644 --- a/deal.II/examples/step-42/step-42.cc +++ b/deal.II/examples/step-42/step-42.cc @@ -638,7 +638,7 @@ void Step4::assemble_mass_matrix () FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); - std::vector local_dof_indices (dofs_per_cell); + std::vector local_dof_indices (dofs_per_cell); const FEValuesExtractors::Vector displacement (0); @@ -700,7 +700,7 @@ void Step4::assemble_nl_system (TrilinosWrappers::MPI::Vector &u) FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); Vector cell_rhs (dofs_per_cell); - std::vector local_dof_indices (dofs_per_cell); + std::vector local_dof_indices (dofs_per_cell); typename DoFHandler::active_cell_iterator cell = dof_handler.begin_active(), endc = dof_handler.end(); diff --git a/deal.II/examples/step-5/step-5.cc b/deal.II/examples/step-5/step-5.cc index c5bd15aedf..0eb8ec03dd 100644 --- a/deal.II/examples/step-5/step-5.cc +++ b/deal.II/examples/step-5/step-5.cc @@ -442,7 +442,7 @@ void Step5::assemble_system () FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); Vector cell_rhs (dofs_per_cell); - std::vector local_dof_indices (dofs_per_cell); + std::vector local_dof_indices (dofs_per_cell); // Here is one difference: for this // program, we will again use a diff --git a/deal.II/examples/step-6/step-6.cc b/deal.II/examples/step-6/step-6.cc index fca0d404aa..4a3ea005e5 100644 --- a/deal.II/examples/step-6/step-6.cc +++ b/deal.II/examples/step-6/step-6.cc @@ -563,7 +563,7 @@ void Step6::assemble_system () FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); Vector cell_rhs (dofs_per_cell); - std::vector local_dof_indices (dofs_per_cell); + std::vector local_dof_indices (dofs_per_cell); const Coefficient coefficient; std::vector coefficient_values (n_q_points); diff --git a/deal.II/include/deal.II/base/utilities.h b/deal.II/include/deal.II/base/utilities.h index 8bd5a226a9..280f18208a 100644 --- a/deal.II/include/deal.II/base/utilities.h +++ b/deal.II/include/deal.II/base/utilities.h @@ -642,6 +642,45 @@ namespace Utilities #endif + + template + std::vector + reverse_permutation (const std::vector &permutation) + { + const unsigned int n = permutation.size(); + + std::vector out (n); + for (unsigned int i=0; i + std::vector + invert_permutation (const std::vector &permutation) + { + const unsigned int n = permutation.size(); + + std::vector out (n, numbers::invalid_unsigned_int); + + for (unsigned int i=0; i inline -unsigned int +types::global_dof_index DoFAccessor::dof_index (const unsigned int i, const unsigned int fe_index) const { @@ -1526,7 +1526,7 @@ DoFAccessor::fe_index_is_active (const unsigned int fe_index) const template inline -unsigned int +types::global_dof_index DoFAccessor::vertex_dof_index (const unsigned int vertex, const unsigned int i, const unsigned int fe_index) const @@ -2034,7 +2034,7 @@ get_dof_indices (std::vector &dof_indices, template