From 68fa659acd63456dec0f6a4896a33a4374e52740 Mon Sep 17 00:00:00 2001 From: bangerth Date: Thu, 9 Aug 2012 20:28:54 +0000 Subject: [PATCH] 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 --- deal.II/examples/step-18/step-18.cc | 2 +- deal.II/examples/step-4/step-4.cc | 2 +- deal.II/examples/step-42/step-42.cc | 4 +- deal.II/examples/step-5/step-5.cc | 2 +- deal.II/examples/step-6/step-6.cc | 2 +- deal.II/include/deal.II/base/utilities.h | 39 ++++++ .../deal.II/dofs/dof_accessor.templates.h | 8 +- deal.II/include/deal.II/dofs/dof_handler.h | 8 +- deal.II/include/deal.II/dofs/dof_objects.h | 4 +- deal.II/include/deal.II/fe/fe_tools.h | 2 +- .../deal.II/multigrid/mg_dof_handler.h | 6 +- deal.II/source/base/index_set.cc | 21 ++-- deal.II/source/base/utilities.cc | 40 ++++++ deal.II/source/dofs/dof_accessor.cc | 2 +- deal.II/source/dofs/dof_handler.cc | 26 ++-- deal.II/source/dofs/dof_handler.inst.in | 6 +- deal.II/source/dofs/dof_objects.inst.in | 10 +- deal.II/source/dofs/dof_renumbering.cc | 118 +++++++++--------- deal.II/source/dofs/dof_renumbering.inst.in | 12 +- deal.II/source/dofs/dof_tools.inst.in | 6 +- .../source/numerics/point_value_history.cc | 2 +- tests/benchmarks/spec2006-447.dealII.cc | 6 +- tests/bits/anna_1.cc | 2 +- tests/bits/anna_2.cc | 2 +- tests/bits/get_dof_indices_01.cc | 2 +- tests/bits/joa_1.cc | 2 +- tests/bits/step-13.cc | 4 +- tests/bits/step-14.cc | 6 +- tests/bits/step-15.cc | 2 +- tests/bits/step-16.cc | 4 +- tests/bits/step-3.cc | 2 +- tests/bits/step-4.cc | 2 +- tests/bits/step-5.cc | 2 +- tests/bits/step-6.cc | 2 +- tests/bits/step-7.cc | 2 +- tests/bits/step-8.cc | 2 +- tests/codim_one/bem.cc | 6 +- tests/codim_one/gradients.cc | 2 +- tests/deal.II/block_matrices.cc | 2 +- tests/deal.II/fe_values_view_21.cc | 2 +- tests/deal.II/fe_values_view_22.cc | 2 +- tests/deal.II/inhomogeneous_constraints.cc | 6 +- .../inhomogeneous_constraints_block.cc | 6 +- .../inhomogeneous_constraints_nonsymmetric.cc | 6 +- .../inhomogeneous_constraints_vector.cc | 2 +- tests/deal.II/point_value_history_01.cc | 2 +- tests/distributed_grids/2d_dofhandler_01.cc | 2 +- tests/fail/circular_01.cc | 2 +- tests/fail/hp-step-14.cc | 6 +- tests/fail/hp-step-15.cc | 2 +- tests/fe/abf_01.cc | 2 +- tests/fe/deformed_projection.h | 2 +- tests/fe/non_primitive_1.cc | 6 +- tests/fe/non_primitive_2.cc | 4 +- tests/fe/rt_normal_02.cc | 4 +- tests/hp/compare_hp_vs_nonhp_01.cc | 4 +- tests/hp/continuous_1d_01.cc | 2 +- tests/hp/continuous_2d_01.cc | 2 +- tests/hp/continuous_3d_01.cc | 2 +- tests/hp/crash_05.cc | 2 +- tests/hp/crash_17.cc | 2 +- tests/hp/crash_17_compressed_set_sparsity.cc | 2 +- tests/hp/crash_18.cc | 2 +- tests/hp/crash_18_compressed_set_sparsity.cc | 2 +- tests/hp/random.cc | 2 +- tests/hp/step-13.cc | 4 +- tests/hp/step-3.cc | 2 +- tests/hp/step-3a.cc | 2 +- tests/hp/step-3b.cc | 2 +- tests/hp/step-3c.cc | 2 +- tests/hp/step-4.cc | 2 +- tests/hp/step-5.cc | 2 +- tests/hp/step-6.cc | 2 +- tests/hp/step-7.cc | 2 +- tests/hp/step-8.cc | 2 +- tests/mpi/p4est_2d_dofhandler_01.cc | 2 +- tests/mpi/p4est_2d_dofhandler_03.cc | 2 +- tests/mpi/p4est_2d_dofhandler_04.cc | 2 +- tests/mpi/p4est_2d_renumber_01.cc | 2 +- tests/mpi/p4est_2d_renumber_02.cc | 2 +- tests/multigrid/renumbering_01.cc | 2 +- tests/multigrid/step-16.cc | 4 +- tests/umfpack/umfpack_04.cc | 2 +- 83 files changed, 287 insertions(+), 205 deletions(-) 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